2020
2121/// <reference types="@stdlib/types"/>
2222
23- import { RealOrComplexTypedArray } from '@stdlib/types/array' ;
23+ import { RealOrComplexTypedArray , DataType } from '@stdlib/types/array' ;
2424import { Collection } from '@stdlib/types/object' ;
2525import { IterableIterator } from '@stdlib/types/iter' ;
2626
@@ -48,7 +48,6 @@ type ArrayOrTypedArray = Array<any> | RealOrComplexTypedArray;
4848* - `generic`: generic JavaScript values
4949*
5050* @param dtype - data type (default: 'float64')
51- * @throws must provide a recognized data type
5251* @returns filled array
5352*
5453* @example
@@ -59,15 +58,14 @@ type ArrayOrTypedArray = Array<any> | RealOrComplexTypedArray;
5958* var arr = filledarray( 'float32' );
6059* // returns <Float32Array>
6160*/
62- declare function filledarray ( dtype ?: string ) : ArrayOrTypedArray ;
61+ declare function filledarray ( dtype ?: DataType ) : ArrayOrTypedArray ;
6362
6463/**
6564* Creates a filled array having a specified `length`.
6665*
6766* @param value - fill value
6867* @param length - array length
6968* @param dtype - data type (default: 'float64')
70- * @throws must provide a recognized data type
7169* @returns filled array
7270*
7371* @example
@@ -78,15 +76,14 @@ declare function filledarray( dtype?: string ): ArrayOrTypedArray;
7876* var arr = filledarray( 1.0, 5, 'float32' );
7977* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
8078*/
81- declare function filledarray ( value : any , length : number , dtype ?: string ) : ArrayOrTypedArray ; // tslint:disable-line:max-line-length
79+ declare function filledarray ( value : any , length : number , dtype ?: DataType ) : ArrayOrTypedArray ; // tslint:disable-line:max-line-length
8280
8381/**
8482* Creates a filled array from another `array`.
8583*
8684* @param value - fill value
8785* @param array - typed array or array-like object
8886* @param dtype - data type (default: 'float64')
89- * @throws must provide a recognized data type
9087* @returns filled array
9188*
9289* @example
@@ -97,15 +94,14 @@ declare function filledarray( value: any, length: number, dtype?: string ): Arra
9794* var arr = filledarray( 1.0, [ 5.0, -3.0, 2.0 ], 'float32' );
9895* // returns <Float32Array>[ 1.0, 1.0, 1.0 ]
9996*/
100- declare function filledarray ( value : any , array : Collection , dtype ?: string ) : ArrayOrTypedArray ; // tslint:disable-line:max-line-length unified-signatures
97+ declare function filledarray ( value : any , array : Collection , dtype ?: DataType ) : ArrayOrTypedArray ; // tslint:disable-line:max-line-length unified-signatures
10198
10299/**
103100* Creates a filled array from an iterable.
104101*
105102* @param value - fill value
106103* @param iterable - iterable
107104* @param dtype - data type (default: 'float64')
108- * @throws must provide a recognized data type
109105* @returns filled array
110106*
111107* @example
@@ -126,7 +122,7 @@ declare function filledarray( value: any, array: Collection, dtype?: string ): A
126122* var arr = filledarray( 1.0, it, 'float32' );
127123* // returns <Float32Array>[ 1.0, 1.0, 1.0 ]
128124*/
129- declare function filledarray ( value : any , iterable : IterableIterator , dtype ?: string ) : ArrayOrTypedArray ; // tslint:disable-line:max-line-length unified-signatures
125+ declare function filledarray ( value : any , iterable : IterableIterator , dtype ?: DataType ) : ArrayOrTypedArray ; // tslint:disable-line:max-line-length unified-signatures
130126
131127/**
132128* Returns a filled typed array view of an `ArrayBuffer`.
@@ -140,7 +136,6 @@ declare function filledarray( value: any, iterable: IterableIterator, dtype?: st
140136* @param byteOffset - byte offset
141137* @param length - view length
142138* @param dtype - data type (default: 'float64')
143- * @throws must provide a recognized data type
144139* @returns filled array
145140*
146141* @example
@@ -157,7 +152,7 @@ declare function filledarray( value: any, iterable: IterableIterator, dtype?: st
157152* var arr = filledarray( 1.0, buf, 8, 2, 'float32' );
158153* // returns <Float32Array>[ 1.0, 1.0 ]
159154*/
160- declare function filledarray ( value : any , buffer : ArrayBuffer , byteOffset : number , length : number , dtype ?: string ) : RealOrComplexTypedArray ; // tslint:disable-line:max-line-length
155+ declare function filledarray ( value : any , buffer : ArrayBuffer , byteOffset : number , length : number , dtype ?: DataType ) : RealOrComplexTypedArray ; // tslint:disable-line:max-line-length
161156
162157/**
163158* Returns a filled typed array view of an `ArrayBuffer`.
@@ -170,7 +165,6 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
170165* @param buffer - `ArrayBuffer`
171166* @param byteOffset - byte offset
172167* @param dtype - data type (default: 'float64')
173- * @throws must provide a recognized data type
174168* @returns filled array
175169*
176170* @example
@@ -187,7 +181,7 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
187181* var arr = filledarray( 1.0, buf, 8, 'float32' );
188182* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
189183*/
190- declare function filledarray ( value : any , buffer : ArrayBuffer , byteOffset : number , dtype ?: string ) : RealOrComplexTypedArray ; // tslint:disable-line:max-line-length
184+ declare function filledarray ( value : any , buffer : ArrayBuffer , byteOffset : number , dtype ?: DataType ) : RealOrComplexTypedArray ; // tslint:disable-line:max-line-length
191185
192186/**
193187* Returns a filled typed array view of an `ArrayBuffer`.
@@ -199,7 +193,6 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
199193* @param value - fill value
200194* @param buffer - `ArrayBuffer`
201195* @param dtype - data type (default: 'float64')
202- * @throws must provide a recognized data type
203196* @returns filled array
204197*
205198* @example
@@ -216,7 +209,7 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
216209* var arr = filledarray( 1.0, buf, 'float32' );
217210* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
218211*/
219- declare function filledarray ( value : any , buffer : ArrayBuffer , dtype ?: string ) : RealOrComplexTypedArray ; // tslint:disable-line:max-line-length unified-signatures
212+ declare function filledarray ( value : any , buffer : ArrayBuffer , dtype ?: DataType ) : RealOrComplexTypedArray ; // tslint:disable-line:max-line-length unified-signatures
220213
221214
222215// EXPORTS //
0 commit comments