Skip to content

typings: add missing typings for TypedArray #58248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions typings/primordials.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,29 @@ declare namespace primordials {
constructor: new (length: number) => T,
items: readonly TypedArrayContentType<T>[],
): T;
export const TypedArray: TypedArray;
export const TypedArrayPrototype:
| typeof Uint8Array.prototype
| typeof Int8Array.prototype
| typeof Uint16Array.prototype
| typeof Int16Array.prototype
| typeof Uint32Array.prototype
| typeof Int32Array.prototype
| typeof Float32Array.prototype
| typeof Float64Array.prototype
| typeof BigInt64Array.prototype
| typeof BigUint64Array.prototype
| typeof Uint8ClampedArray.prototype;
export const TypedArrayPrototypeGetBuffer: UncurryGetter<TypedArray, "buffer">;
export const TypedArrayPrototypeGetByteLength: UncurryGetter<TypedArray, "byteLength">;
export const TypedArrayPrototypeGetByteOffset: UncurryGetter<TypedArray, "byteOffset">;
export const TypedArrayPrototypeGetLength: UncurryGetter<TypedArray, "length">;
export function TypedArrayPrototypeAt<T extends TypedArray>(self: T, ...args: Parameters<T["at"]>): ReturnType<T["at"]>;
export function TypedArrayPrototypeIncludes<T extends TypedArray>(self: T, ...args: Parameters<T["includes"]>): ReturnType<T["includes"]>;
export function TypedArrayPrototypeFill<T extends TypedArray>(self: T, ...args: Parameters<T["fill"]>): ReturnType<T["fill"]>;
export function TypedArrayPrototypeSet<T extends TypedArray>(self: T, ...args: Parameters<T["set"]>): ReturnType<T["set"]>;
export function TypedArrayPrototypeSubarray<T extends TypedArray>(self: T, ...args: Parameters<T["subarray"]>): ReturnType<T["subarray"]>;
export function TypedArrayPrototypeSlice<T extends TypedArray>(self: T, ...args: Parameters<T["slice"]>): ReturnType<T["slice"]>;
export function TypedArrayPrototypeGetSymbolToStringTag(self: unknown):
| 'Int8Array'
| 'Int16Array'
Expand Down
Loading