Skip to content

Commit eacd4fa

Browse files
committed
Add IntegerTypedArray type for use with crypto.getRandomValues
1 parent b504a1e commit eacd4fa

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/lib/es2020.bigint.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,11 @@ interface BigUint64ArrayConstructor {
706706
}
707707
declare var BigUint64Array: BigUint64ArrayConstructor;
708708

709+
interface IntegerTypedArrayTypes {
710+
BigInt64Array: BigInt64Array;
711+
BigUint64Array: BigUint64Array;
712+
}
713+
709714
interface DataView<TArrayBuffer extends ArrayBufferLike> {
710715
/**
711716
* Gets the BigInt64 value at the specified byte offset from the start of the view. There is

src/lib/es5.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4389,6 +4389,21 @@ interface Float64ArrayConstructor {
43894389
}
43904390
declare var Float64Array: Float64ArrayConstructor;
43914391

4392+
/**
4393+
* Stores types to be used with crypto.getRandomValues
4394+
*/
4395+
interface IntegerTypedArrayTypes {
4396+
Int8Array: Int8Array;
4397+
Int16Array: Int16Array;
4398+
Int32Array: Int32Array;
4399+
Uint8Array: Uint8Array;
4400+
Uint16Array: Uint16Array;
4401+
Uint32Array: Uint32Array;
4402+
Uint8ClampedArray: Uint8ClampedArray;
4403+
}
4404+
4405+
type IntegerTypedArray = IntegerTypedArrayTypes[keyof IntegerTypedArrayTypes];
4406+
43924407
/////////////////////////////
43934408
/// ECMAScript Internationalization API
43944409
/////////////////////////////

0 commit comments

Comments
 (0)