Skip to content
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
116 changes: 113 additions & 3 deletions lib/node_modules/@stdlib/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*/
declare module '@stdlib/types/array' {
import { ComplexLike, Complex32, Complex64, Complex128 } from '@stdlib/types/complex';
import { Uint64 } from '@stdlib/types/number';
import { Remap } from '@stdlib/types/utilities';

/**
Expand Down Expand Up @@ -129,7 +130,7 @@
/**
* Data type for unsigned integer typed arrays.
*/
type UnsignedIntegerDataType = 'uint32' | 'uint16' | 'uint8' | 'uint8c'; // "unsigned_integer"
type UnsignedIntegerDataType = 'uint64' | 'uint32' | 'uint16' | 'uint8' | 'uint8c'; // "unsigned_integer"

/**
* Data type for unsigned integer typed arrays.
Expand Down Expand Up @@ -492,7 +493,7 @@
* @example
* const x: UnsignedIntegerTypedArray = new Uint32Array( 10 );
*/
type UnsignedIntegerTypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
type UnsignedIntegerTypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Uint64Array;

/**
* A boolean typed array.
Expand Down Expand Up @@ -609,7 +610,7 @@
* @example
* const buf = new Uint8Array( 8 );
*
* const z: Complex64Array = {
* const x: BooleanArray = {
* 'byteLength': 8,
* 'byteOffset': 0,
* 'BYTES_PER_ELEMENT': 1,
Expand Down Expand Up @@ -835,6 +836,114 @@
set( value: ArrayLike<number | ComplexLike> | Complex128Array | ComplexLike, i?: number ): void;
}

/**
* A 64-bit unsigned integer array-like value.
*
* @example
* const buf = new Uint32Array( 8 );
*
* const z: Uint64ArrayLike = {
* 'byteLength': 32,
* 'byteOffset': 0,
* 'BYTES_PER_ELEMENT': 8,
* 'length': 4,
* 'get': ( i: number ): obj.Uint64 => {
* return {
* 'hi': buf[ (2*i) ],
* 'lo': buf[ (2*i)+1 ],
* 'byteLength': 8,
* 'BYTES_PER_ELEMENT': 8
* };
* },
* 'set': ( value: obj.Uint64, i?: number ) => {
* i = ( i ) ? i : 0;
* buf[ (2*i)] = value.hi;
* buf[ (2*i)+1 ] = value.lo;
* }
* };
*/
interface Uint64ArrayLike extends AccessorArrayLike<Uint64> {
/**
* Length (in bytes) of the array.
*/
byteLength: number;

/**
* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.
*/
byteOffset: number;

/**
* Size (in bytes) of each array element.
*/
BYTES_PER_ELEMENT: number;

/**
* Number of array elements.
*/
length: number;

/**
* Returns an array element.
*
* @param i - element index
* @returns array element
*/
get( i: number ): Uint64 | void;

/**
* Sets an array element.
*
* @param value - value(s)
* @param i - element index at which to start writing values (default: 0)
*/
set( value: ArrayLike<Uint64 | bigint | number> | Uint64ArrayLike | Uint64 | bigint | number, i?: number ): void;
}

/**
* 64-bit unsigned integer array.
*
* @example
* const buf = new Uint32Array( 8 );
*
* const z: Uint64Array = {
* 'byteLength': 32,
* 'byteOffset': 0,
* 'BYTES_PER_ELEMENT': 8,
* 'length': 4,
* 'get': ( i: number ): obj.Uint64 => {
* return {
* 'hi': buf[ (2*i) ],
* 'lo': buf[ (2*i)+1 ],
* 'byteLength': 8,
* 'BYTES_PER_ELEMENT': 8
* };
* },
* 'set': ( value: obj.Uint64, i?: number ) => {
* i = ( i ) ? i : 0;
* buf[ (2*i) ] = value.hi;
* buf[ (2*i)+1 ] = value.lo;
* }
* };
*/
interface Uint64Array extends Uint64ArrayLike {
/**
* Returns an array element.
*
* @param i - element index
* @returns array element
*/
get( i: number ): Uint64 | void;

/**
* Sets an array element.
*
* @param value - value(s)
* @param i - element index at which to start writing values (default: 0)
*/
set( value: ArrayLike<Uint64 | bigint | number> | Uint64Array | Uint64 | bigint | number, i?: number ): void;
}

/**
* A collection, which is defined as either an array, typed array, or an array-like object (excluding strings and functions).
*
Expand Down Expand Up @@ -939,6 +1048,7 @@
* Mapping of unsigned integer data types to array constructors.
*/
type UnsignedIntegerDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
'uint64': Uint64Array;
'uint32': Uint32Array;
'uint16': Uint16Array;
'uint8': Uint8Array;
Expand Down Expand Up @@ -1747,7 +1857,7 @@
/**
* "Raw" (original) data type value.
*/
value: any;

Check warning on line 1860 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type
}

/**
Expand Down Expand Up @@ -5256,7 +5366,7 @@
/**
* Value associated with a property (default: `undefined`).
*/
value?: any;

Check warning on line 5369 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type
}

/**
Expand Down Expand Up @@ -5290,7 +5400,7 @@
* - When the property is accessed, the function is called without arguments and with `this` set to the object through which the property is accessed (note: this may **not** be the object on which the property is defined due to inheritance).
* - The return value will be used as the value of the property.
*/
get?(): any;

Check warning on line 5403 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* A function which serves as a setter for the property.
Expand All @@ -5300,7 +5410,7 @@
* - If omitted from a descriptor, a property value cannot be assigned.
* - When the property is assigned to, the function is called with one argument (the value being assigned to the property) and with `this` set to the object through which the property is assigned.
*/
set?( x: any ): void;

Check warning on line 5413 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type
}

/**
Expand Down Expand Up @@ -5553,7 +5663,7 @@
* @example
* const rand: PRNG = () => 3.14;
*/
type PRNG = ( ...args: Array<any> ) => number;

Check warning on line 5666 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* A pseudorandom number generator (PRNG) seed for the 32-bit Mersenne Twister (MT19937) PRNG.
Expand Down Expand Up @@ -5773,7 +5883,7 @@
* @param values - input array containing values to write
* @returns boolean indicating whether the underlying WebAssembly memory instance has enough capacity
*/
hasCapacity( byteOffset: number, values: Collection | AccessorArrayLike<any> ): boolean;

Check warning on line 5886 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Returns a boolean indicating whether a provided list of values is a view of the underlying memory of the WebAssembly module.
Expand All @@ -5781,7 +5891,7 @@
* @param values - input array
* @returns boolean indicating whether the list is a memory view
*/
isView( values: Collection | AccessorArrayLike<any> ): boolean;

Check warning on line 5894 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Writes values to the underlying WebAssembly memory instance.
Expand All @@ -5796,7 +5906,7 @@
* @param values - input array containing values to write
* @returns module wrapper instance
*/
write( byteOffset: number, values: Collection | AccessorArrayLike<any> ): ModuleWrapper;

Check warning on line 5909 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type

/**
* Reads values from the underlying WebAssembly memory instance.
Expand All @@ -5811,6 +5921,6 @@
* @param out - output array
* @returns module wrapper instance
*/
read( byteOffset: number, out: Collection | AccessorArrayLike<any> ): ModuleWrapper;

Check warning on line 5924 in lib/node_modules/@stdlib/types/index.d.ts

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected any. Specify a different type
}
}
Loading