20
20
21
21
/// <reference types="@stdlib/types"/>
22
22
23
- import { RealOrComplexTypedArray } from '@stdlib/types/array' ;
23
+ import { RealOrComplexTypedArray , DataType } from '@stdlib/types/array' ;
24
24
import { Collection } from '@stdlib/types/object' ;
25
25
import { IterableIterator } from '@stdlib/types/iter' ;
26
26
@@ -48,7 +48,6 @@ type ArrayOrTypedArray = Array<any> | RealOrComplexTypedArray;
48
48
* - `generic`: generic JavaScript values
49
49
*
50
50
* @param dtype - data type (default: 'float64')
51
- * @throws must provide a recognized data type
52
51
* @returns filled array
53
52
*
54
53
* @example
@@ -59,15 +58,14 @@ type ArrayOrTypedArray = Array<any> | RealOrComplexTypedArray;
59
58
* var arr = filledarray( 'float32' );
60
59
* // returns <Float32Array>
61
60
*/
62
- declare function filledarray ( dtype ?: string ) : ArrayOrTypedArray ;
61
+ declare function filledarray ( dtype ?: DataType ) : ArrayOrTypedArray ;
63
62
64
63
/**
65
64
* Creates a filled array having a specified `length`.
66
65
*
67
66
* @param value - fill value
68
67
* @param length - array length
69
68
* @param dtype - data type (default: 'float64')
70
- * @throws must provide a recognized data type
71
69
* @returns filled array
72
70
*
73
71
* @example
@@ -78,15 +76,14 @@ declare function filledarray( dtype?: string ): ArrayOrTypedArray;
78
76
* var arr = filledarray( 1.0, 5, 'float32' );
79
77
* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
80
78
*/
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
82
80
83
81
/**
84
82
* Creates a filled array from another `array`.
85
83
*
86
84
* @param value - fill value
87
85
* @param array - typed array or array-like object
88
86
* @param dtype - data type (default: 'float64')
89
- * @throws must provide a recognized data type
90
87
* @returns filled array
91
88
*
92
89
* @example
@@ -97,15 +94,14 @@ declare function filledarray( value: any, length: number, dtype?: string ): Arra
97
94
* var arr = filledarray( 1.0, [ 5.0, -3.0, 2.0 ], 'float32' );
98
95
* // returns <Float32Array>[ 1.0, 1.0, 1.0 ]
99
96
*/
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
101
98
102
99
/**
103
100
* Creates a filled array from an iterable.
104
101
*
105
102
* @param value - fill value
106
103
* @param iterable - iterable
107
104
* @param dtype - data type (default: 'float64')
108
- * @throws must provide a recognized data type
109
105
* @returns filled array
110
106
*
111
107
* @example
@@ -126,7 +122,7 @@ declare function filledarray( value: any, array: Collection, dtype?: string ): A
126
122
* var arr = filledarray( 1.0, it, 'float32' );
127
123
* // returns <Float32Array>[ 1.0, 1.0, 1.0 ]
128
124
*/
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
130
126
131
127
/**
132
128
* Returns a filled typed array view of an `ArrayBuffer`.
@@ -140,7 +136,6 @@ declare function filledarray( value: any, iterable: IterableIterator, dtype?: st
140
136
* @param byteOffset - byte offset
141
137
* @param length - view length
142
138
* @param dtype - data type (default: 'float64')
143
- * @throws must provide a recognized data type
144
139
* @returns filled array
145
140
*
146
141
* @example
@@ -157,7 +152,7 @@ declare function filledarray( value: any, iterable: IterableIterator, dtype?: st
157
152
* var arr = filledarray( 1.0, buf, 8, 2, 'float32' );
158
153
* // returns <Float32Array>[ 1.0, 1.0 ]
159
154
*/
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
161
156
162
157
/**
163
158
* Returns a filled typed array view of an `ArrayBuffer`.
@@ -170,7 +165,6 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
170
165
* @param buffer - `ArrayBuffer`
171
166
* @param byteOffset - byte offset
172
167
* @param dtype - data type (default: 'float64')
173
- * @throws must provide a recognized data type
174
168
* @returns filled array
175
169
*
176
170
* @example
@@ -187,7 +181,7 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
187
181
* var arr = filledarray( 1.0, buf, 8, 'float32' );
188
182
* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
189
183
*/
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
191
185
192
186
/**
193
187
* Returns a filled typed array view of an `ArrayBuffer`.
@@ -199,7 +193,6 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
199
193
* @param value - fill value
200
194
* @param buffer - `ArrayBuffer`
201
195
* @param dtype - data type (default: 'float64')
202
- * @throws must provide a recognized data type
203
196
* @returns filled array
204
197
*
205
198
* @example
@@ -216,7 +209,7 @@ declare function filledarray( value: any, buffer: ArrayBuffer, byteOffset: numbe
216
209
* var arr = filledarray( 1.0, buf, 'float32' );
217
210
* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
218
211
*/
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
220
213
221
214
222
215
// EXPORTS //
0 commit comments