|
20 | 20 |
|
21 | 21 | /// <reference types="@stdlib/types"/>
|
22 | 22 |
|
23 |
| -import { typedndarray, genericndarray, Order } from '@stdlib/types/ndarray'; |
| 23 | +import { typedndarray, genericndarray, Order, DataType } from '@stdlib/types/ndarray'; |
24 | 24 | import { ComplexLike } from '@stdlib/types/complex';
|
25 | 25 |
|
26 | 26 | /**
|
@@ -95,6 +95,15 @@ interface Options {
|
95 | 95 | * - Default: 'row-major'.
|
96 | 96 | */
|
97 | 97 | order?: Order | 'same' | 'any';
|
| 98 | + |
| 99 | + /** |
| 100 | + * Output ndarray data type. |
| 101 | + * |
| 102 | + * ## Notes |
| 103 | + * |
| 104 | + * - By default, the function returns an ndarray having the same data type as a provided input ndarray. |
| 105 | + */ |
| 106 | + dtype?: DataType; |
98 | 107 | }
|
99 | 108 |
|
100 | 109 | /**
|
@@ -232,6 +241,7 @@ declare function flattenBy<T = unknown, U extends genericndarray<T> = genericnda
|
232 | 241 | * @param options - function options
|
233 | 242 | * @param options.depth - maximum number of dimensions to flatten
|
234 | 243 | * @param options.order - order in which input ndarray elements should be flattened
|
| 244 | +* @param options.dtype - output ndarray data type |
235 | 245 | * @param fcn - callback function
|
236 | 246 | * @param thisArg - callback execution context
|
237 | 247 | * @returns output ndarray
|
@@ -272,6 +282,7 @@ declare function flattenBy<T extends typedndarray<number> = typedndarray<number>
|
272 | 282 | * @param options - function options
|
273 | 283 | * @param options.depth - maximum number of dimensions to flatten
|
274 | 284 | * @param options.order - order in which input ndarray elements should be flattened
|
| 285 | +* @param options.dtype - output ndarray data type |
275 | 286 | * @param fcn - callback function
|
276 | 287 | * @param thisArg - callback execution context
|
277 | 288 | * @returns output ndarray
|
@@ -309,6 +320,7 @@ declare function flattenBy<T extends ComplexLike = ComplexLike, U extends typedn
|
309 | 320 | * @param options - function options
|
310 | 321 | * @param options.depth - maximum number of dimensions to flatten
|
311 | 322 | * @param options.order - order in which input ndarray elements should be flattened
|
| 323 | +* @param options.dtype - output ndarray data type |
312 | 324 | * @param fcn - callback function
|
313 | 325 | * @param thisArg - callback execution context
|
314 | 326 | * @returns output ndarray
|
@@ -349,6 +361,7 @@ declare function flattenBy<T extends typedndarray<boolean> = typedndarray<boolea
|
349 | 361 | * @param options - function options
|
350 | 362 | * @param options.depth - maximum number of dimensions to flatten
|
351 | 363 | * @param options.order - order in which input ndarray elements should be flattened
|
| 364 | +* @param options.dtype - output ndarray data type |
352 | 365 | * @param fcn - callback function
|
353 | 366 | * @param thisArg - callback execution context
|
354 | 367 | * @returns output ndarray
|
|
0 commit comments