Skip to content

Commit d8e88f2

Browse files
jazellytargos
authored andcommitted
typings: add missing typings for TypedArray
PR-URL: #58248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 2d5de7e commit d8e88f2

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
@@ -479,10 +479,29 @@ declare namespace primordials {
479479
constructor: new (length: number) => T,
480480
items: readonly TypedArrayContentType<T>[],
481481
): T;
482+
export const TypedArray: TypedArray;
483+
export const TypedArrayPrototype:
484+
| typeof Uint8Array.prototype
485+
| typeof Int8Array.prototype
486+
| typeof Uint16Array.prototype
487+
| typeof Int16Array.prototype
488+
| typeof Uint32Array.prototype
489+
| typeof Int32Array.prototype
490+
| typeof Float32Array.prototype
491+
| typeof Float64Array.prototype
492+
| typeof BigInt64Array.prototype
493+
| typeof BigUint64Array.prototype
494+
| typeof Uint8ClampedArray.prototype;
482495
export const TypedArrayPrototypeGetBuffer: UncurryGetter<TypedArray, "buffer">;
483496
export const TypedArrayPrototypeGetByteLength: UncurryGetter<TypedArray, "byteLength">;
484497
export const TypedArrayPrototypeGetByteOffset: UncurryGetter<TypedArray, "byteOffset">;
485498
export const TypedArrayPrototypeGetLength: UncurryGetter<TypedArray, "length">;
499+
export function TypedArrayPrototypeAt<T extends TypedArray>(self: T, ...args: Parameters<T["at"]>): ReturnType<T["at"]>;
500+
export function TypedArrayPrototypeIncludes<T extends TypedArray>(self: T, ...args: Parameters<T["includes"]>): ReturnType<T["includes"]>;
501+
export function TypedArrayPrototypeFill<T extends TypedArray>(self: T, ...args: Parameters<T["fill"]>): ReturnType<T["fill"]>;
502+
export function TypedArrayPrototypeSet<T extends TypedArray>(self: T, ...args: Parameters<T["set"]>): ReturnType<T["set"]>;
503+
export function TypedArrayPrototypeSubarray<T extends TypedArray>(self: T, ...args: Parameters<T["subarray"]>): ReturnType<T["subarray"]>;
504+
export function TypedArrayPrototypeSlice<T extends TypedArray>(self: T, ...args: Parameters<T["slice"]>): ReturnType<T["slice"]>;
486505
export function TypedArrayPrototypeGetSymbolToStringTag(self: unknown):
487506
| 'Int8Array'
488507
| 'Int16Array'

0 commit comments

Comments
 (0)