Skip to content

Commit 2f0aa48

Browse files
authored
feat!: update namespace TypeScript declarations
This commit removes the `mulf` symbol from the `math/base/ops` namespace. BREAKING CHANGE: remove `mulf` symbol To migrate, users should access the same symbol via the `number/float32/base` namespace. PR-URL: #5436 Reviewed-by: Athan Reines <[email protected]>
1 parent 2d0c586 commit 2f0aa48

File tree

8 files changed

+115
-46
lines changed

8 files changed

+115
-46
lines changed

lib/node_modules/@stdlib/math/array/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ import special = require( '@stdlib/math/array/special' );
2424
import tools = require( '@stdlib/math/array/tools' );
2525

2626
/**
27-
* Interface describing the namespace.
27+
* Interface describing the `array` namespace.
2828
*/
2929
interface Namespace {
3030
/**
31-
* Special math functions.
31+
* Namespace.
3232
*/
3333
special: typeof special;
3434

3535
/**
36-
* Math tools.
36+
* Math array function tools.
3737
*/
3838
tools: typeof tools;
3939
}
4040

4141
/**
42-
* Standard math.
42+
* Math functions applied to arrays.
4343
*/
4444
declare var ns: Namespace;
4545

lib/node_modules/@stdlib/math/array/special/docs/types/index.d.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,33 @@
2323
import abs = require( '@stdlib/math/array/special/abs' );
2424

2525
/**
26-
* Interface describing the namespace.
26+
* Interface describing the `special` namespace.
2727
*/
2828
interface Namespace {
2929
/**
30-
* TODO
30+
* Computes the absolute value for each element in an input array.
31+
*
32+
* @param x - input array
33+
* @param options - function options
34+
* @returns output array
35+
*
36+
* @example
37+
* var out = ns.abs( [ -1.0, -2.0, -3.0 ] );
38+
* // returns [ 1.0, 2.0, 3.0 ]
39+
*
40+
* @example
41+
* var y = [ 0.0, 0.0, 0.0 ];
42+
*
43+
* var out = ns.abs.assign( [ -1.0, -2.0, -3.0 ], y );
44+
* // returns [ 1.0, 2.0, 3.0 ]
45+
*
46+
* var bool = ( out === y );
3147
*/
3248
abs: typeof abs;
33-
3449
}
3550

3651
/**
37-
* Namespace.
52+
* Special math functions applied to arrays.
3853
*/
3954
declare var ns: Namespace;
4055

lib/node_modules/@stdlib/math/array/tools/docs/types/index.d.ts

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,63 @@
2121
/* eslint-disable max-lines */
2222

2323
import unary = require( '@stdlib/math/array/tools/unary' );
24+
import unaryFactory = require( '@stdlib/math/array/tools/unary-factory' );
2425

2526
/**
2627
* Interface describing the `tools` namespace.
2728
*/
2829
interface Namespace {
2930
/**
30-
* TODO
31+
* Constructor for applying a unary function to each element in a provided array.
32+
*
33+
* @param fcn - unary function to apply
34+
* @param idtypes - list of supported input data types
35+
* @param odtypes - list of supported output data types
36+
* @param policy - output data type policy
37+
* @returns instance
38+
*
39+
* @example
40+
* var base = require( '@stdlib/math/base/special/abs' );
41+
* var dtypes = require( '@stdlib/array/dtypes' );
42+
*
43+
* var idt = dtypes( 'real_and_generic' );
44+
* var odt = idt;
45+
* var policy = 'same';
46+
*
47+
* var abs = new Unary( base, idt, odt, policy );
48+
*
49+
* var x = [ -1.0, -2.0, -3.0 ];
50+
*
51+
* var y = abs.apply( x );
52+
* // returns [ 1.0, 2.0, 3.0 ]
3153
*/
3254
unary: typeof unary;
3355

56+
/**
57+
* Creates a function for applying a unary function to each element in a provided array.
58+
*
59+
* @param fcn - unary function to apply
60+
* @param idtypes - list of supported input data types
61+
* @param odtypes - list of supported output data types
62+
* @param policy - output data type policy
63+
* @returns function for applying a unary function
64+
*
65+
* @example
66+
* var base = require( '@stdlib/math/base/special/abs' );
67+
* var dtypes = require( '@stdlib/array/dtypes' );
68+
*
69+
* var idt = dtypes( 'real_and_generic' );
70+
* var odt = idt;
71+
* var policy = 'same';
72+
*
73+
* var abs = ns.unaryFactory( base, idt, odt, policy );
74+
*
75+
* var x = [ -1.0, -2.0, -3.0 ];
76+
*
77+
* var y = abs( x );
78+
* // returns [ 1.0, 2.0, 3.0 ]
79+
*/
80+
unaryFactory: typeof unaryFactory;
3481
}
3582

3683
/**

lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import csub = require( '@stdlib/math/base/ops/csub' );
3131
import csubf = require( '@stdlib/math/base/ops/csubf' );
3232
import imul = require( '@stdlib/math/base/ops/imul' );
3333
import imuldw = require( '@stdlib/math/base/ops/imuldw' );
34-
import mulf = require( '@stdlib/number/float32/base/mul' );
3534
import subf = require( '@stdlib/math/base/ops/subf' );
3635
import umul = require( '@stdlib/math/base/ops/umul' );
3736
import umuldw = require( '@stdlib/math/base/ops/umuldw' );
@@ -447,35 +446,6 @@ interface Namespace {
447446
*/
448447
imuldw: typeof imuldw;
449448

450-
/**
451-
* Multiplies two single-precision floating-point numbers `x` and `y`.
452-
*
453-
* @param x - first input value
454-
* @param y - second input value
455-
* @returns result
456-
*
457-
* @example
458-
* var v = ns.mulf( -1.0, 5.0 );
459-
* // returns -5.0
460-
*
461-
* @example
462-
* var v = ns.mulf( 2.0, 5.0 );
463-
* // returns 10.0
464-
*
465-
* @example
466-
* var v = ns.mulf( 0.0, 5.0 );
467-
* // returns 0.0
468-
*
469-
* @example
470-
* var v = ns.mulf( -0.0, 0.0 );
471-
* // returns -0.0
472-
*
473-
* @example
474-
* var v = ns.mulf( NaN, NaN );
475-
* // returns NaN
476-
*/
477-
mulf: typeof mulf;
478-
479449
/**
480450
* Subtracts two single-precision floating-point numbers `x` and `y`.
481451
*

lib/node_modules/@stdlib/math/docs/types/index.d.ts

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

2121
/* eslint-disable max-lines */
2222

23+
import array = require( '@stdlib/math/array' );
2324
import base = require( '@stdlib/math/base' );
2425
import iter = require( '@stdlib/math/iter' );
2526
import special = require( '@stdlib/math/special' );
@@ -30,6 +31,11 @@ import tools = require( '@stdlib/math/tools' );
3031
* Interface describing the `math` namespace.
3132
*/
3233
interface Namespace {
34+
/**
35+
* Math functions applied to arrays.
36+
*/
37+
array: typeof array;
38+
3339
/**
3440
* Base (i.e., lower-level) math functions.
3541
*/

lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import isIntegerDataType = require( '@stdlib/ndarray/base/assert/is-integer-data
3838
import isMostlySafeDataTypeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast' );
3939
import isNumericDataType = require( '@stdlib/ndarray/base/assert/is-numeric-data-type' );
4040
import isOrder = require( '@stdlib/ndarray/base/assert/is-order' );
41+
import isOutputDataTypePolicy = require( '@stdlib/ndarray/base/assert/is-output-data-type-policy' );
4142
import isReadOnly = require( '@stdlib/ndarray/base/assert/is-read-only' );
4243
import isRealDataType = require( '@stdlib/ndarray/base/assert/is-real-data-type' );
4344
import isRealFloatingPointDataType = require( '@stdlib/ndarray/base/assert/is-real-floating-point-data-type' );
@@ -602,6 +603,27 @@ interface Namespace {
602603
*/
603604
isOrder: typeof isOrder;
604605

606+
/**
607+
* Tests whether an input value is a supported ndarray output data type policy.
608+
*
609+
* @param v - value to test
610+
* @returns boolean indicating whether an input value is a supported ndarray output data type policy
611+
*
612+
* @example
613+
* var bool = ns.isOutputDataTypePolicy( 'boolean' );
614+
* // returns true
615+
*
616+
* bool = ns.isOutputDataTypePolicy( 'real' );
617+
* // returns true
618+
*
619+
* bool = ns.isOutputDataTypePolicy( 'numeric' );
620+
* // returns true
621+
*
622+
* bool = ns.isOutputDataTypePolicy( 'foo' );
623+
* // returns false
624+
*/
625+
isOutputDataTypePolicy: typeof isOutputDataTypePolicy;
626+
605627
/**
606628
* Tests whether an ndarray is read-only.
607629
*

lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,15 +1174,24 @@ interface Namespace {
11741174
*
11751175
* - `same`: return the same data type.
11761176
* - `promoted`: return a promoted data type.
1177-
* - `bool`: return a boolean data type.
1178-
* - `numeric`: return a numeric data type.
1179-
* - `real`: return a real-valued data type.
1177+
* - `boolean`: return a boolean data type.
1178+
* - `boolean_and_generic`: return a boolean or "generic" data type.
11801179
* - `signed_integer`: return a signed integer data type.
1180+
* - `signed_integer_and_generic`: return a signed integer or "generic" data type.
11811181
* - `unsigned_integer`: return an unsigned integer data type.
1182+
* - `unsigned_integer_and_generic`: return an unsigned integer or "generic" data type.
11821183
* - `integer`: return an integer data type (i.e., either signed or unsigned).
1184+
* - `integer_and_generic`: return an integer (i.e., either signed or unsigned) or "generic" data type.
11831185
* - `floating_point`: return a floating-point data type (i.e., either real-valued or complex-valued).
1186+
* - `floating_point_and_generic`: return a floating-point (i.e., either real-valued or complex-valued) or "generic" data type.
11841187
* - `real_floating_point`: return a real-valued floating-point data type.
1188+
* - `real_floating_point_and_generic`: return a real-valued or "generic" floating-point data type.
11851189
* - `complex_floating_point`: return a complex-valued floating-point data type.
1190+
* - `complex_floating_point_and_generic`: return a complex-valued or "generic" floating-point data type.
1191+
* - `real`: return a real-valued data type.
1192+
* - `real_and_generic`: return a real-valued or "generic" data type.
1193+
* - `numeric`: return a numeric data type.
1194+
* - `numeric_and_generic`: return a numeric or "generic" data type.
11861195
* - `default`: return the default data type.
11871196
*
11881197
* @returns list of data type policies

lib/node_modules/@stdlib/stats/base/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,9 +2556,9 @@ interface Namespace {
25562556
*
25572557
* @param N - number of indexed elements
25582558
* @param x - input array
2559-
* @param strideX - `x` stride length
2559+
* @param strideX - stride length for `x`
25602560
* @param mask - mask array
2561-
* @param strideMask - `mask` stride length
2561+
* @param strideMask - stride length for `mask`
25622562
* @returns minimum value
25632563
*
25642564
* @example
@@ -2582,9 +2582,9 @@ interface Namespace {
25822582
*
25832583
* @param N - number of indexed elements
25842584
* @param x - input array
2585-
* @param strideX - `x` stride length
2585+
* @param strideX - stride length for `x`
25862586
* @param mask - mask array
2587-
* @param strideMask - `mask` stride length
2587+
* @param strideMask - stride length for `mask`
25882588
* @returns range
25892589
*
25902590
* @example

0 commit comments

Comments
 (0)