Skip to content

Add IntegerTypedArray type for use with crypto.getRandomValues #61767

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/harness/fourslashInterfaceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,8 @@ export namespace Completion {
interfaceEntry("Float32ArrayConstructor"),
varEntry("Float64Array"),
interfaceEntry("Float64ArrayConstructor"),
interfaceEntry("IntegerTypedArrayTypes"),
typeEntry("IntegerTypedArray"),
moduleEntry("Intl"),
typeEntry("WeakKey"),
interfaceEntry("WeakKeyTypes"),
Expand Down
5 changes: 5 additions & 0 deletions src/lib/es2020.bigint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,11 @@ interface BigUint64ArrayConstructor {
}
declare var BigUint64Array: BigUint64ArrayConstructor;

interface IntegerTypedArrayTypes {
BigInt64Array: BigInt64Array;
BigUint64Array: BigUint64Array;
}

interface DataView<TArrayBuffer extends ArrayBufferLike> {
/**
* Gets the BigInt64 value at the specified byte offset from the start of the view. There is
Expand Down
15 changes: 15 additions & 0 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4389,6 +4389,21 @@ interface Float64ArrayConstructor {
}
declare var Float64Array: Float64ArrayConstructor;

/**
* Stores types to be used with crypto.getRandomValues
*/
interface IntegerTypedArrayTypes {
Int8Array: Int8Array;
Int16Array: Int16Array;
Int32Array: Int32Array;
Uint8Array: Uint8Array;
Uint16Array: Uint16Array;
Uint32Array: Uint32Array;
Uint8ClampedArray: Uint8ClampedArray;
}

type IntegerTypedArray = IntegerTypedArrayTypes[keyof IntegerTypedArrayTypes];

/////////////////////////////
/// ECMAScript Internationalization API
/////////////////////////////
Expand Down
Loading