Skip to content

Commit 1db1c87

Browse files
jazellyaduh95
authored andcommitted
typings: add missing typings for TypedArray
PR-URL: #58248 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 70be158 commit 1db1c87

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

typings/primordials.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,29 @@ declare namespace primordials {
476476
constructor: new (length: number) => T,
477477
items: readonly TypedArrayContentType<T>[],
478478
): T;
479+
export const TypedArray: TypedArray;
480+
export const TypedArrayPrototype:
481+
| typeof Uint8Array.prototype
482+
| typeof Int8Array.prototype
483+
| typeof Uint16Array.prototype
484+
| typeof Int16Array.prototype
485+
| typeof Uint32Array.prototype
486+
| typeof Int32Array.prototype
487+
| typeof Float32Array.prototype
488+
| typeof Float64Array.prototype
489+
| typeof BigInt64Array.prototype
490+
| typeof BigUint64Array.prototype
491+
| typeof Uint8ClampedArray.prototype;
479492
export const TypedArrayPrototypeGetBuffer: UncurryGetter<TypedArray, "buffer">;
480493
export const TypedArrayPrototypeGetByteLength: UncurryGetter<TypedArray, "byteLength">;
481494
export const TypedArrayPrototypeGetByteOffset: UncurryGetter<TypedArray, "byteOffset">;
482495
export const TypedArrayPrototypeGetLength: UncurryGetter<TypedArray, "length">;
496+
export function TypedArrayPrototypeAt<T extends TypedArray>(self: T, ...args: Parameters<T["at"]>): ReturnType<T["at"]>;
497+
export function TypedArrayPrototypeIncludes<T extends TypedArray>(self: T, ...args: Parameters<T["includes"]>): ReturnType<T["includes"]>;
498+
export function TypedArrayPrototypeFill<T extends TypedArray>(self: T, ...args: Parameters<T["fill"]>): ReturnType<T["fill"]>;
499+
export function TypedArrayPrototypeSet<T extends TypedArray>(self: T, ...args: Parameters<T["set"]>): ReturnType<T["set"]>;
500+
export function TypedArrayPrototypeSubarray<T extends TypedArray>(self: T, ...args: Parameters<T["subarray"]>): ReturnType<T["subarray"]>;
501+
export function TypedArrayPrototypeSlice<T extends TypedArray>(self: T, ...args: Parameters<T["slice"]>): ReturnType<T["slice"]>;
483502
export function TypedArrayPrototypeGetSymbolToStringTag(self: unknown):
484503
| 'Int8Array'
485504
| 'Int16Array'

0 commit comments

Comments
 (0)