Skip to content

Commit 6a8a452

Browse files
committed
Improve typing
1 parent 3714468 commit 6a8a452

File tree

1 file changed

+8
-15
lines changed
  • lib/node_modules/@stdlib/array/filled-by/docs/types

1 file changed

+8
-15
lines changed

lib/node_modules/@stdlib/array/filled-by/docs/types/index.d.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// <reference types="@stdlib/types"/>
2222

23-
import { RealOrComplexTypedArray } from '@stdlib/types/array';
23+
import { RealOrComplexTypedArray, DataType } from '@stdlib/types/array';
2424
import { Collection } from '@stdlib/types/object';
2525
import { IterableIterator } from '@stdlib/types/iter';
2626

@@ -71,7 +71,6 @@ type Callback = Nullary | Unary;
7171
* - `generic`: generic JavaScript values
7272
*
7373
* @param dtype - data type
74-
* @throws must provide a recognized data type
7574
* @returns filled array
7675
*
7776
* @example
@@ -82,7 +81,7 @@ type Callback = Nullary | Unary;
8281
* var arr = filledarrayBy( 'float32' );
8382
* // returns <Float32Array>
8483
*/
85-
declare function filledarrayBy( dtype?: string ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
84+
declare function filledarrayBy( dtype?: DataType ): ArrayOrTypedArray; // tslint:disable-line:unified-signatures
8685

8786
/**
8887
* Creates a filled array according to a provided callback function and having a specified `length`.
@@ -122,7 +121,6 @@ declare function filledarrayBy( length: number, clbk: Callback, thisArg?: any ):
122121
* @param dtype - data type
123122
* @param clbk - callback function
124123
* @param thisArg - callback function execution context
125-
* @throws must provide a recognized data type
126124
* @returns filled array
127125
*
128126
* @example
@@ -131,7 +129,7 @@ declare function filledarrayBy( length: number, clbk: Callback, thisArg?: any ):
131129
* var arr = filledarrayBy( 5, 'float64', constantFunction( 1.0 ) );
132130
* // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
133131
*/
134-
declare function filledarrayBy( length: number, dtype: string, clbk: Callback, thisArg?: any ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
132+
declare function filledarrayBy( length: number, dtype: DataType, clbk: Callback, thisArg?: any ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
135133

136134
/**
137135
* Creates a filled array from another `array` according to a provided callback function.
@@ -171,7 +169,6 @@ declare function filledarrayBy( array: Collection, clbk: Callback, thisArg?: any
171169
* @param dtype - data type
172170
* @param clbk - callback function
173171
* @param thisArg - callback function execution context
174-
* @throws must provide a recognized data type
175172
* @returns filled array
176173
*
177174
* @example
@@ -180,7 +177,7 @@ declare function filledarrayBy( array: Collection, clbk: Callback, thisArg?: any
180177
* var arr = filledarrayBy( [ 5.0, -3.0, 2.0 ], 'float64', constantFunction( 1.0 ) );
181178
* // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
182179
*/
183-
declare function filledarrayBy( array: Collection, dtype: string, clbk: Callback, thisArg?: any ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
180+
declare function filledarrayBy( array: Collection, dtype: DataType, clbk: Callback, thisArg?: any ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
184181

185182
/**
186183
* Creates a filled array from an iterable according to a callback function.
@@ -224,7 +221,6 @@ declare function filledarrayBy( iterable: IterableIterator, callback: Callback,
224221
* @param dtype - data type
225222
* @param clbk - callback function
226223
* @param thisArg - callback function execution context
227-
* @throws must provide a recognized data type
228224
* @returns filled array
229225
*
230226
* @example
@@ -237,7 +233,7 @@ declare function filledarrayBy( iterable: IterableIterator, callback: Callback,
237233
* var arr = filledarrayBy( it, 'float64', constantFunction( 1.0 ) );
238234
* // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
239235
*/
240-
declare function filledarrayBy( iterable: IterableIterator, dtype: string, callback: Callback, thisArg?: any ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
236+
declare function filledarrayBy( iterable: IterableIterator, dtype: DataType, callback: Callback, thisArg?: any ): ArrayOrTypedArray; // tslint:disable-line:max-line-length unified-signatures
241237

242238
/**
243239
* Returns a filled typed array view of an `ArrayBuffer` according to a provided callback function.
@@ -291,7 +287,6 @@ declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, length:
291287
* @param dtype - data type
292288
* @param clbk - callback function
293289
* @param thisArg - callback function execution context
294-
* @throws must provide a recognized data type
295290
* @returns filled array
296291
*
297292
* @example
@@ -302,7 +297,7 @@ declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, length:
302297
* var arr = filledarrayBy( buf, 8, 2, 'float64', constantFunction( 1.0 ) );
303298
* // returns <Float64Array>[ 1.0, 1.0 ]
304299
*/
305-
declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, length: number, dtype: string, clbk: Callback, thisArg?: any ): RealOrComplexTypedArray; // tslint:disable-line:max-line-length unified-signatures
300+
declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, length: number, dtype: DataType, clbk: Callback, thisArg?: any ): RealOrComplexTypedArray; // tslint:disable-line:max-line-length unified-signatures
306301

307302
/**
308303
* Returns a filled typed array view of an `ArrayBuffer` according to a provided callback function.
@@ -354,7 +349,6 @@ declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, clbk: C
354349
* @param dtype - data type
355350
* @param clbk - callback function
356351
* @param thisArg - callback function execution context
357-
* @throws must provide a recognized data type
358352
* @returns filled array
359353
*
360354
* @example
@@ -365,7 +359,7 @@ declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, clbk: C
365359
* var arr = filledarrayBy( buf, 8, 'float64', constantFunction( 1.0 ) );
366360
* // returns <Float64Array>[ 1.0, 1.0, 1.0 ]
367361
*/
368-
declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, dtype: string, clbk: Callback, thisArg?: any ): RealOrComplexTypedArray; // tslint:disable-line:max-line-length unified-signatures
362+
declare function filledarrayBy( buffer: ArrayBuffer, byteOffset: number, dtype: DataType, clbk: Callback, thisArg?: any ): RealOrComplexTypedArray; // tslint:disable-line:max-line-length unified-signatures
369363

370364
/**
371365
* Returns a filled typed array view of an `ArrayBuffer` according to a provided callback function.
@@ -415,7 +409,6 @@ declare function filledarrayBy( buffer: ArrayBuffer, clbk: Callback, thisArg?: a
415409
* @param dtype - data type
416410
* @param clbk - callback function
417411
* @param thisArg - callback function execution context
418-
* @throws must provide a recognized data type
419412
* @returns filled array
420413
*
421414
* @example
@@ -426,7 +419,7 @@ declare function filledarrayBy( buffer: ArrayBuffer, clbk: Callback, thisArg?: a
426419
* var arr = filledarrayBy( buf, 'float64', constantFunction( 1.0 ) );
427420
* // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]
428421
*/
429-
declare function filledarrayBy( buffer: ArrayBuffer, dtype: string, clbk: Callback, thisArg?: any ): RealOrComplexTypedArray; // tslint:disable-line:max-line-length unified-signatures
422+
declare function filledarrayBy( buffer: ArrayBuffer, dtype: DataType, clbk: Callback, thisArg?: any ): RealOrComplexTypedArray; // tslint:disable-line:max-line-length unified-signatures
430423

431424

432425
// EXPORTS //

0 commit comments

Comments
 (0)