1 | /**
|
---|
2 | * Determines the type of the given collection, or returns false.
|
---|
3 | *
|
---|
4 | * @param {unknown} value The potential collection
|
---|
5 | * @returns {TypedArrayName | false | null} 'Int8Array' | 'Uint8Array' | 'Uint8ClampedArray' | 'Int16Array' | 'Uint16Array' | 'Int32Array' | 'Uint32Array' | 'Float32Array' | 'Float64Array' | 'BigInt64Array' | 'BigUint64Array' | false | null
|
---|
6 | */
|
---|
7 | declare function whichTypedArray(value: Int8Array): 'Int8Array';
|
---|
8 | declare function whichTypedArray(value: Uint8Array): 'Uint8Array';
|
---|
9 | declare function whichTypedArray(value: Uint8ClampedArray): 'Uint8ClampedArray';
|
---|
10 | declare function whichTypedArray(value: Int16Array): 'Int16Array';
|
---|
11 | declare function whichTypedArray(value: Uint16Array): 'Uint16Array';
|
---|
12 | declare function whichTypedArray(value: Int32Array): 'Int32Array';
|
---|
13 | declare function whichTypedArray(value: Uint32Array): 'Uint32Array';
|
---|
14 | declare function whichTypedArray(value: Float32Array): 'Float32Array';
|
---|
15 | declare function whichTypedArray(value: Float64Array): 'Float64Array';
|
---|
16 | declare function whichTypedArray(value: BigInt64Array): 'BigInt64Array';
|
---|
17 | declare function whichTypedArray(value: BigUint64Array): 'BigUint64Array';
|
---|
18 | declare function whichTypedArray(value: unknown): false | null;
|
---|
19 |
|
---|
20 | declare namespace whichTypedArray {
|
---|
21 | type TypedArrayName =
|
---|
22 | | 'Int8Array'
|
---|
23 | | 'Uint8Array'
|
---|
24 | | 'Uint8ClampedArray'
|
---|
25 | | 'Int16Array'
|
---|
26 | | 'Uint16Array'
|
---|
27 | | 'Int32Array'
|
---|
28 | | 'Uint32Array'
|
---|
29 | | 'Float32Array'
|
---|
30 | | 'Float64Array'
|
---|
31 | | 'BigInt64Array'
|
---|
32 | | 'BigUint64Array';
|
---|
33 |
|
---|
34 | type TypedArray =
|
---|
35 | | Int8Array
|
---|
36 | | Uint8Array
|
---|
37 | | Uint8ClampedArray
|
---|
38 | | Int16Array
|
---|
39 | | Uint16Array
|
---|
40 | | Int32Array
|
---|
41 | | Uint32Array
|
---|
42 | | Float32Array
|
---|
43 | | Float64Array
|
---|
44 | | BigInt64Array
|
---|
45 | | BigUint64Array;
|
---|
46 |
|
---|
47 | type TypedArrayConstructor =
|
---|
48 | | Int8ArrayConstructor
|
---|
49 | | Uint8ArrayConstructor
|
---|
50 | | Uint8ClampedArrayConstructor
|
---|
51 | | Int16ArrayConstructor
|
---|
52 | | Uint16ArrayConstructor
|
---|
53 | | Int32ArrayConstructor
|
---|
54 | | Uint32ArrayConstructor
|
---|
55 | | Float32ArrayConstructor
|
---|
56 | | Float64ArrayConstructor
|
---|
57 | | BigInt64ArrayConstructor
|
---|
58 | | BigUint64ArrayConstructor;
|
---|
59 | }
|
---|
60 |
|
---|
61 | export = whichTypedArray;
|
---|