File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414// which would incorrectly accept SharedArrayBuffer instances.
1515// < TypeScript 5.7 doesn't support templates for Uint8Array.
1616// So this type is defined as a workaround to evaluate to Uint8Array<ArrayBuffer> on all versions of TypeScript.
17+
18+ /**
19+ * This is `Uint8Array<ArrayBuffer>`
20+ * (as opposed to `Uint8Array<SharedArrayBuffer>` and `Uint8Array<ArrayBufferLike>`)
21+ * on TypeScript versions that support that distinction.
22+ *
23+ * On TypeScript < 5.7, this is just `Uint8Array`, as it's not a template there.
24+ */
1725export type Uint8ArrayBuffer = ReturnType < typeof Uint8Array . from > ;
26+
27+ /**
28+ * This is `Uint16Array<ArrayBuffer>`
29+ * (as opposed to `Uint16Array<SharedArrayBuffer>` and `Uint16Array<ArrayBufferLike>`)
30+ * on TypeScript versions that support that distinction.
31+ *
32+ * On TypeScript < 5.7, this is just `Uint16Array`, as it's not a template there.
33+ */
1834export type Uint16ArrayBuffer = ReturnType < typeof Uint16Array . from > ;
1935
36+ /**
37+ * This is `Uint32Array<ArrayBuffer>`
38+ * (as opposed to `Uint32Array<SharedArrayBuffer>` and `Uint32Array<ArrayBufferLike>`)
39+ * on TypeScript versions that support that distinction.
40+ *
41+ * On TypeScript < 5.7, this is just `Uint32Array`, as it's not a template there.
42+ */
43+ export type Uint32ArrayBuffer = ReturnType < typeof Uint32Array . from > ;
44+
2045/**
2146 * Output format for typed array conversions
2247 */
You can’t perform that action at this time.
0 commit comments