Skip to content
Open
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
68 changes: 64 additions & 4 deletions lib/node_modules/@stdlib/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/**
* Data type for floating-point typed arrays.
*/
type RealFloatingPointDataType = 'float64' | 'float32'; // "real_floating_point"
type RealFloatingPointDataType = 'float64' | 'float32' | 'float16'; // "real_floating_point"

/**
* Data type for floating-point typed arrays.
Expand Down Expand Up @@ -464,8 +464,9 @@
* @example
* const x: FloatTypedArray = new Float64Array( 10 );
* const y: FloatTypedArray = new Float32Array( 10 );
* const z: FloatTypedArray = new Float16Array( 10 );
*/
type FloatTypedArray = Float32Array | Float64Array;
type FloatTypedArray = Float16Array | Float32Array | Float64Array;

/**
* A complex number typed array.
Expand Down Expand Up @@ -790,6 +791,7 @@
type RealFloatingPointDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
'float64': Float64Array;
'float32': Float32Array;
'float16': Float16Array;
};

/**
Expand Down Expand Up @@ -1462,7 +1464,7 @@
/**
* Data type string for floating-point ndarrays.
*/
type RealFloatingPointDataTypeString = 'float64' | 'float32'; // "real_floating_point"
type RealFloatingPointDataTypeString = 'float64' | 'float32' | 'float16'; // "real_floating_point"

/**
* Data type string for floating-point ndarrays.
Expand Down Expand Up @@ -1656,7 +1658,7 @@
/**
* "Raw" (original) data type value.
*/
value: any;

Check warning on line 1661 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 @@ -2157,7 +2159,7 @@
/**
* Data type object for floating-point ndarrays.
*/
type RealFloatingPointDataTypeObject = Float64DataTypeObject | Float32DataTypeObject; // "real_floating_point"
type RealFloatingPointDataTypeObject = Float64DataTypeObject | Float32DataTypeObject | Float16DataTypeObject; // "real_floating_point"

/**
* Data type object for floating-point ndarrays.
Expand Down Expand Up @@ -3150,6 +3152,63 @@
set( ...args: Array<number> ): float32ndarray;
}

/**
* Interface describing an ndarray having a half-precision floating-point data type.
*
* @example
* const arr: float16ndarray = {
* 'byteLength': 6,
* 'BYTES_PER_ELEMENT': 2,
* 'data': new Float16Array( [ 1, 2, 3 ] ),
* 'dtype': 'float16',
* 'flags': {
* 'ROW_MAJOR_CONTIGUOUS': true,
* 'COLUMN_MAJOR_CONTIGUOUS': false
* },
* 'length': 3,
* 'ndims': 1,
* 'offset': 0,
* 'order': 'row-major',
* 'shape': [ 3 ],
* 'strides': [ 1 ],
* 'get': function get( i ) {
* return this.data[ i ];
* },
* 'set': function set( i, v ) {
* this.data[ i ] = v;
* return this;
* }
* };
*/
interface float16ndarray extends floatndarray {
/**
* Size (in bytes) of each array element.
*/
BYTES_PER_ELEMENT: 2;

/**
* A reference to the underlying data buffer.
*/
data: Float16Array;

/**
* Underlying data type.
*/
dtype: Float16DataType;

/**
* Sets an array element specified according to provided subscripts.
*
* ## Notes
*
* - The number of provided subscripts should equal the number of dimensions.
*
* @param args - subscripts and value to set
* @returns ndarray instance
*/
set( ...args: Array<number> ): float16ndarray;
}

/**
* Interface describing an ndarray having an integer data type.
*
Expand Down Expand Up @@ -4400,6 +4459,7 @@
type RealFloatingPointDataTypeMap = { // eslint-disable-line @typescript-eslint/consistent-type-definitions
'float64': float64ndarray;
'float32': float32ndarray;
'float16': float16ndarray;
};

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

Check warning on line 5051 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 @@ -5022,7 +5082,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 5085 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 @@ -5032,7 +5092,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 5095 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 @@ -5161,7 +5221,7 @@
* @example
* const rand: PRNG = () => 3.14;
*/
type PRNG = ( ...args: Array<any> ) => number;

Check warning on line 5224 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 @@ -5381,7 +5441,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 5444 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 @@ -5389,7 +5449,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 5452 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 @@ -5404,7 +5464,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 5467 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 @@ -5419,6 +5479,6 @@
* @param out - output array
* @returns module wrapper instance
*/
read( byteOffset: number, out: Collection | AccessorArrayLike<any> ): ModuleWrapper;

Check warning on line 5482 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
}
}