import type {FindGlobalType} from './find-global-type.d.ts'; /** Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. Use the `Buffer` type parameter to require a specific buffer type. For example, `TypedArray` excludes views of a `SharedArrayBuffer`, which APIs that take a `BufferSource`, like `crypto.subtle.digest()`, do not accept. `Float16Array` is included only when it exists in your TypeScript `lib` (`ESNext` or `ES2025` and later) or is added by `@types/node`. @example ``` import type {TypedArray} from 'type-fest'; declare function hash(data: TypedArray): Promise; void hash(new Uint8Array(8)); // @ts-expect-error void hash(new Uint8Array(new SharedArrayBuffer(8))); ``` @category Array */ export type TypedArray = | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16ArrayOf | Float32Array | Float64Array | BigInt64Array | BigUint64Array; /** `Float16Array` is looked up through `globalThis`, so that a `lib` without it gets `never` here instead of a compile error. The `prototype` type is `Float16Array`, and a type cannot pass `Buffer` to an interface it cannot name, so the members that use the buffer type are narrowed instead. `subarray()` must be narrowed too, because `@types/node` defines `BufferSource` with `Float16Array`. The narrowed members come first, so that `subarray()` resolves to them. */ type Float16ArrayOf = { readonly buffer: Buffer; subarray(begin?: number, end?: number): Float16ArrayOf; } & FindGlobalType<'Float16Array'>['prototype']; export {};