1 | export declare type ArrayLikeIterable<T> = ArrayLike<T> & Iterable<T>;
|
2 | export declare type NumericArray = number[] | TypedArray;
|
3 | export declare type TypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
|
4 | export declare type BigTypedArray = BigInt64Array | BigUint64Array;
|
5 | export declare type FloatArray = Float32Array | Float64Array;
|
6 | export declare type IntArray = Int8Array | Int16Array | Int32Array;
|
7 | export declare type UIntArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
|
8 | export declare type FloatArrayConstructor = Float32ArrayConstructor | Float64ArrayConstructor;
|
9 | export declare type IntArrayConstructor = Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor;
|
10 | export declare type UIntArrayConstructor = Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor;
|
11 | export declare type BigIntArrayConstructor = BigInt64ArrayConstructor | BigUint64ArrayConstructor;
|
12 | export declare type TypedArrayConstructor = FloatArrayConstructor | IntArrayConstructor | UIntArrayConstructor;
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare type Type = "u8" | "u8c" | "i8" | "u16" | "i16" | "u32" | "i32" | "f32" | "f64";
|
20 | export declare type BigType = "i64" | "u64";
|
21 | export declare type UintType = "u8" | "u8c" | "u16" | "u32";
|
22 | export declare type IntType = "i8" | "i16" | "i32";
|
23 | export declare type FloatType = "f32" | "f64";
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export declare enum GLType {
|
32 | I8 = 5120,
|
33 | U8 = 5121,
|
34 | I16 = 5122,
|
35 | U16 = 5123,
|
36 | I32 = 5124,
|
37 | U32 = 5125,
|
38 | F32 = 5126
|
39 | }
|
40 |
|
41 |
|
42 |
|
43 | export declare const GL2TYPE: Record<GLType, Type>;
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | export declare const TYPE2GL: Record<Type, GLType | undefined>;
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | export declare const SIZEOF: {
|
58 | u8: number;
|
59 | u8c: number;
|
60 | i8: number;
|
61 | u16: number;
|
62 | i16: number;
|
63 | u32: number;
|
64 | i32: number;
|
65 | i64: number;
|
66 | u64: number;
|
67 | f32: number;
|
68 | f64: number;
|
69 | };
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export declare const BIT_SHIFTS: {
|
75 | i8: number;
|
76 | u8: number;
|
77 | u8c: number;
|
78 | i16: number;
|
79 | u16: number;
|
80 | i32: number;
|
81 | u32: number;
|
82 | i64: number;
|
83 | u64: number;
|
84 | f32: number;
|
85 | f64: number;
|
86 | };
|
87 | export declare const FLOAT_ARRAY_CTORS: Record<FloatType, FloatArrayConstructor>;
|
88 | export declare const INT_ARRAY_CTORS: Record<IntType, IntArrayConstructor>;
|
89 | export declare const UINT_ARRAY_CTORS: Record<UintType, UIntArrayConstructor>;
|
90 | export declare const BIGINT_ARRAY_CTORS: Record<BigType, BigIntArrayConstructor>;
|
91 | export declare const TYPEDARRAY_CTORS: Record<Type, TypedArrayConstructor>;
|
92 | export interface TypedArrayTypeMap extends Record<Type | GLType, TypedArray> {
|
93 | u8: Uint8Array;
|
94 | u8c: Uint8ClampedArray;
|
95 | i8: Int8Array;
|
96 | u16: Uint16Array;
|
97 | i16: Int16Array;
|
98 | u32: Uint32Array;
|
99 | i32: Int32Array;
|
100 | f32: Float32Array;
|
101 | f64: Float64Array;
|
102 | [GLType.U8]: Uint8Array;
|
103 | [GLType.I8]: Int8Array;
|
104 | [GLType.U16]: Uint16Array;
|
105 | [GLType.I16]: Int16Array;
|
106 | [GLType.U32]: Uint32Array;
|
107 | [GLType.I32]: Int32Array;
|
108 | [GLType.F32]: Float32Array;
|
109 | }
|
110 | export interface BigTypedArrayTypeMap extends Record<BigType, BigTypedArray> {
|
111 | i64: BigInt64Array;
|
112 | u64: BigUint64Array;
|
113 | }
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | export declare const asNativeType: (type: GLType | Type) => Type;
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | export declare const asGLType: (type: GLType | Type) => GLType;
|
139 |
|
140 |
|
141 |
|
142 | export declare const asInt: (...args: number[]) => number[];
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | export declare const sizeOf: (type: Type | BigType | GLType) => number;
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 | export declare function typedArray<T extends Type | GLType>(type: T, length: number): TypedArrayTypeMap[T];
|
156 | export declare function typedArray<T extends Type | GLType>(type: T, src: ArrayLike<number> | ArrayBufferLike): TypedArrayTypeMap[T];
|
157 | export declare function typedArray<T extends Type | GLType>(type: T, buf: ArrayBufferLike, byteOffset: number, length?: number): TypedArrayTypeMap[T];
|
158 | export declare function typedArray<T extends BigType>(type: T, length: number): BigTypedArrayTypeMap[T];
|
159 | export declare function typedArray<T extends BigType>(type: T, src: ArrayLike<bigint> | ArrayBufferLike): BigTypedArrayTypeMap[T];
|
160 | export declare function typedArray<T extends BigType>(type: T, buf: ArrayBufferLike, byteOffset: number, length?: number): BigTypedArrayTypeMap[T];
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 | export declare const typedArrayType: (x: NumericArray) => Type;
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 | export declare const uintTypeForSize: (x: number) => UintType;
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 | export declare const intTypeForSize: (x: number) => IntType;
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | export declare const uintTypeForBits: (x: number) => UintType;
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 | export declare const intTypeForBits: (x: number) => IntType;
|
194 |
|
\ | No newline at end of file |