Skip to content

Commit 1df2836

Browse files
Update namespace TypeScript declarations (#462)
Co-authored-by: Planeshifter <[email protected]>
1 parent 7b462a8 commit 1df2836

File tree

23 files changed

+994
-73
lines changed

23 files changed

+994
-73
lines changed

Diff for: lib/node_modules/@stdlib/array/docs/types/index.d.ts

+38-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import datespace = require( '@stdlib/array/datespace' );
3232
import arrayDataType = require( '@stdlib/array/dtype' );
3333
import arrayDataTypes = require( '@stdlib/array/dtypes' );
3434
import filledarray = require( '@stdlib/array/filled' );
35+
import filledarrayBy = require( '@stdlib/array/filled-by' );
3536
import Float32Array = require( '@stdlib/array/float32' );
3637
import Float64Array = require( '@stdlib/array/float64' );
3738
import iterator2array = require( '@stdlib/array/from-iterator' );
@@ -356,10 +357,46 @@ interface Namespace {
356357
* var buf = new ArrayBuffer( 32 );
357358
* var arr = ns.filledarray( 1.0, buf, 'float32' );
358359
* // returns <Float32Array>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
359-
*
360360
*/
361361
filledarray: typeof filledarray;
362362

363+
/**
364+
* Returns a filled typed array view of an `ArrayBuffer` according to a provided callback function.
365+
*
366+
* The function recognizes the following data types:
367+
*
368+
* - `float64`: double-precision floating-point numbers (IEEE 754)
369+
* - `float32`: single-precision floating-point numbers (IEEE 754)
370+
* - `int32`: 32-bit two's complement signed integers
371+
* - `uint32`: 32-bit unsigned integers
372+
* - `int16`: 16-bit two's complement signed integers
373+
* - `uint16`: 16-bit unsigned integers
374+
* - `int8`: 8-bit two's complement signed integers
375+
* - `uint8`: 8-bit unsigned integers
376+
* - `uint8c`: 8-bit unsigned integers clamped to `0-255`
377+
* - `generic`: generic JavaScript values
378+
*
379+
* ## Notes
380+
*
381+
* - Creating a generic array from an `ArrayBuffer` is **not** supported.
382+
*
383+
* @param buffer - `ArrayBuffer`
384+
* @param dtype - data type
385+
* @param clbk - callback function
386+
* @param thisArg - callback function execution context
387+
* @throws must provide a recognized data type
388+
* @returns filled array
389+
*
390+
* @example
391+
* var constantFunction = require( `@stdlib/utils/constant-function` );
392+
* var ArrayBuffer = require( `@stdlib/array/buffer` );
393+
*
394+
* var buf = new ArrayBuffer( 32 );
395+
* var arr = ns.filledarrayBy( buf, 'float64', constantFunction( 1.0 ) );
396+
* // returns <Float64Array>[ 1.0, 1.0, 1.0, 1.0 ]
397+
*/
398+
filledarrayBy: typeof filledarrayBy;
399+
363400
/**
364401
* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.
365402
*/

Diff for: lib/node_modules/@stdlib/blas/base/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ interface Namespace {
810810
}
811811

812812
/**
813-
* "Base" (i.e., lower-level) basic linear algebra subprograms (BLAS).
813+
* Base (i.e., lower-level) basic linear algebra subprograms (BLAS).
814814
*/
815815
declare var ns: Namespace;
816816

Diff for: lib/node_modules/@stdlib/blas/docs/types/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import sswap = require( '@stdlib/blas/sswap' );
3535
*/
3636
interface Namespace {
3737
/**
38-
* "Base" (i.e., lower-level) basic linear algebra subprograms (BLAS).
38+
* Base (i.e., lower-level) basic linear algebra subprograms (BLAS).
3939
*/
4040
base: typeof base;
4141

@@ -89,7 +89,7 @@ interface Namespace {
8989
dswap: typeof dswap;
9090

9191
/**
92-
* Standard library extended BLAS.
92+
* Extended BLAS.
9393
*/
9494
ext: typeof ext;
9595

Diff for: lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3273,7 +3273,7 @@ interface Namespace {
32733273
}
32743274

32753275
/**
3276-
* Base (i.e., lower-level) extensions to basic linear algebra subroutines (BLAS).
3276+
* Extended base (i.e., lower-level) basic linear algebra subroutines (BLAS).
32773277
*/
32783278
declare var ns: Namespace;
32793279

Diff for: lib/node_modules/@stdlib/blas/ext/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import base = require( '@stdlib/blas/ext/base' );
2828
*/
2929
interface Namespace {
3030
/**
31-
* Base (i.e., lower-level) extensions to basic linear algebra subroutines (BLAS).
31+
* Extended base (i.e., lower-level) basic linear algebra subroutines (BLAS).
3232
*/
3333
base: typeof base;
3434
}

Diff for: lib/node_modules/@stdlib/constants/docs/types/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ interface Namespace {
8787
int32: typeof int32;
8888

8989
/**
90-
* Path constants.
90+
* Standard string path constants.
9191
*/
9292
path: typeof path;
9393

@@ -112,7 +112,7 @@ interface Namespace {
112112
uint32: typeof uint32;
113113

114114
/**
115-
* String unicode constants.
115+
* Standard string unicode constants.
116116
*/
117117
unicode: typeof unicode;
118118
}

Diff for: lib/node_modules/@stdlib/math/base/assert/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ interface Namespace {
572572
}
573573

574574
/**
575-
* Base (i.e., lower-level) math assertion utilities.
575+
* Base mathematical assertion utilities.
576576
*/
577577
declare var ns: Namespace;
578578

Diff for: lib/node_modules/@stdlib/math/base/docs/types/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ import utils = require( '@stdlib/math/base/utils' );
3232
*/
3333
interface Namespace {
3434
/**
35-
* Base math assertion utilities.
35+
* Base mathematical assertion utilities.
3636
*/
3737
assert: typeof assert;
3838

3939
/**
40-
* Base math operators.
40+
* Base (i.e., lower-level) math operators.
4141
*/
4242
ops: typeof ops;
4343

4444
/**
45-
* Base special math functions.
45+
* Base (i.e., lower-level) special math functions.
4646
*/
4747
special: typeof special;
4848

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

+214
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,83 @@
2121
/* tslint:disable:max-line-length */
2222
/* tslint:disable:max-file-line-count */
2323

24+
import add = require( '@stdlib/math/base/ops/add' );
25+
import addf = require( '@stdlib/math/base/ops/addf' );
2426
import cadd = require( '@stdlib/math/base/ops/cadd' );
2527
import cdiv = require( '@stdlib/math/base/ops/cdiv' );
2628
import cmul = require( '@stdlib/math/base/ops/cmul' );
2729
import cneg = require( '@stdlib/math/base/ops/cneg' );
2830
import csub = require( '@stdlib/math/base/ops/csub' );
31+
import imul = require( '@stdlib/math/base/ops/imul' );
32+
import imuldw = require( '@stdlib/math/base/ops/imuldw' );
33+
import mul = require( '@stdlib/math/base/ops/mul' );
34+
import sub = require( '@stdlib/math/base/ops/sub' );
35+
import subf = require( '@stdlib/math/base/ops/subf' );
36+
import umul = require( '@stdlib/math/base/ops/umul' );
37+
import umuldw = require( '@stdlib/math/base/ops/umuldw' );
2938

3039
/**
3140
* Interface describing the `ops` namespace.
3241
*/
3342
interface Namespace {
43+
/**
44+
* Computes the sum of two double-precision floating-point numbers `x` and `y`.
45+
*
46+
* @param x - first input value
47+
* @param y - second input value
48+
* @returns sum
49+
*
50+
* @example
51+
* var v = ns.add( -1.0, 5.0 );
52+
* // returns 4.0
53+
*
54+
* @example
55+
* var v = ns.add( 2.0, 5.0 );
56+
* // returns 7.0
57+
*
58+
* @example
59+
* var v = ns.add( 0.0, 5.0 );
60+
* // returns 5.0
61+
*
62+
* @example
63+
* var v = ns.add( -0.0, 0.0 );
64+
* // returns 0.0
65+
*
66+
* @example
67+
* var v = ns.add( NaN, NaN );
68+
* // returns NaN
69+
*/
70+
add: typeof add;
71+
72+
/**
73+
* Computes the sum of two single-precision floating-point numbers `x` and `y`.
74+
*
75+
* @param x - first input value
76+
* @param y - second input value
77+
* @returns sum
78+
*
79+
* @example
80+
* var v = ns.addf( -1.0, 5.0 );
81+
* // returns 4.0
82+
*
83+
* @example
84+
* var v = ns.addf( 2.0, 5.0 );
85+
* // returns 7.0
86+
*
87+
* @example
88+
* var v = ns.addf( 0.0, 5.0 );
89+
* // returns 5.0
90+
*
91+
* @example
92+
* var v = ns.addf( -0.0, 0.0 );
93+
* // returns 0.0
94+
*
95+
* @example
96+
* var v = ns.addf( NaN, NaN );
97+
* // returns NaN
98+
*/
99+
addf: typeof addf;
100+
34101
/**
35102
* Adds two complex numbers.
36103
*
@@ -111,6 +178,153 @@ interface Namespace {
111178
// returns [ 7.0, 2.0 ]
112179
*/
113180
csub: typeof csub;
181+
182+
/**
183+
* Performs C-like multiplication of two signed 32-bit integers.
184+
*
185+
* @param a - signed 32-bit integer
186+
* @param b - signed 32-bit integer
187+
* @returns product
188+
*
189+
* @example
190+
* var v = ns.imul( -10|0, 4|0 );
191+
* // returns -40
192+
*/
193+
imul: typeof imul;
194+
195+
/**
196+
* Performs multiplication of two signed 32-bit integers and returns an array of two signed 32-bit integers which represents the signed 64-bit integer product.
197+
*
198+
* ## Notes
199+
*
200+
* - When computing the product of 32-bit integer values in double-precision floating-point format (the default JavaScript numeric data type), computing the double word product is necessary in order to avoid exceeding the maximum safe double-precision floating-point integer value.
201+
*
202+
* @param a - integer
203+
* @param b - integer
204+
* @returns output array
205+
*
206+
* @example
207+
* var v = ns.imuldw( 0xAAAAAAAA, 0x55555555 );
208+
* // returns [ -477218589, 1908874354 ]
209+
*/
210+
imuldw: typeof imuldw;
211+
212+
/**
213+
* Multiplies two double-precision floating-point numbers `x` and `y`.
214+
*
215+
* @param x - first input value
216+
* @param y - second input value
217+
* @returns result
218+
*
219+
* @example
220+
* var v = ns.mul( -1.0, 5.0 );
221+
* // returns -5.0
222+
*
223+
* @example
224+
* var v = ns.mul( 2.0, 5.0 );
225+
* // returns 10.0
226+
*
227+
* @example
228+
* var v = ns.mul( 0.0, 5.0 );
229+
* // returns 0.0
230+
*
231+
* @example
232+
* var v = ns.mul( -0.0, 0.0 );
233+
* // returns -0.0
234+
*
235+
* @example
236+
* var v = ns.mul( NaN, NaN );
237+
* // returns NaN
238+
*/
239+
mul: typeof mul;
240+
241+
/**
242+
* Subtracts two double-precision floating-point numbers `x` and `y`.
243+
*
244+
* @param x - first input value
245+
* @param y - second input value
246+
* @returns result
247+
*
248+
* @example
249+
* var v = ns.sub( -1.0, 5.0 );
250+
* // returns -6.0
251+
*
252+
* @example
253+
* var v = ns.sub( 2.0, 5.0 );
254+
* // returns -3.0
255+
*
256+
* @example
257+
* var v = ns.sub( 0.0, 5.0 );
258+
* // returns -5.0
259+
*
260+
* @example
261+
* var v = ns.sub( -0.0, 0.0 );
262+
* // returns -0.0
263+
*
264+
* @example
265+
* var v = ns.sub( NaN, NaN );
266+
* // returns NaN
267+
*/
268+
sub: typeof sub;
269+
270+
/**
271+
* Subtracts two single-precision floating-point numbers `x` and `y`.
272+
*
273+
* @param x - first input value
274+
* @param y - second input value
275+
* @returns result
276+
*
277+
* @example
278+
* var v = ns.subf( -1.0, 5.0 );
279+
* // returns -6.0
280+
*
281+
* @example
282+
* var v = ns.subf( 2.0, 5.0 );
283+
* // returns -3.0
284+
*
285+
* @example
286+
* var v = ns.subf( 0.0, 5.0 );
287+
* // returns -5.0
288+
*
289+
* @example
290+
* var v = ns.subf( -0.0, 0.0 );
291+
* // returns -0.0
292+
*
293+
* @example
294+
* var v = ns.subf( NaN, NaN );
295+
* // returns NaN
296+
*/
297+
subf: typeof subf;
298+
299+
/**
300+
* Performs C-like multiplication of two unsigned 32-bit integers.
301+
*
302+
* @param a - unsigned 32-bit integer
303+
* @param b - Unsigned 32-bit integer
304+
* @returns product
305+
*
306+
* @example
307+
* var v = ns.umul( 10>>>0, 4>>>0 );
308+
* // returns 40
309+
*/
310+
umul: typeof umul;
311+
312+
/**
313+
* Performs multiplication of two unsigned 32-bit integers and returns an array of two unsigned 32-bit integers which represents the unsigned 64-bit integer product.
314+
*
315+
* ## Notes
316+
*
317+
* - When computing the product of 32-bit integer values in double-precision floating-point format (the default JavaScript numeric data type), computing the double word product is necessary in order to avoid exceeding the maximum safe double-precision floating-point integer value.
318+
*
319+
* @param a - integer
320+
* @param b - integer
321+
* @returns double word product (in big endian order; i.e., the first element corresponds to the most significant bits and the second element to the least significant bits)
322+
*
323+
* @example
324+
* var v = ns.umuldw( 0xAAAAAAAA, 0x55555555 );
325+
* // returns [ 954437176, 1908874354 ]
326+
*/
327+
umuldw: typeof umuldw;
114328
}
115329

116330
/**

Diff for: lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ interface Namespace {
25592559
fallingFactorial: typeof fallingFactorial;
25602560

25612561
/**
2562-
* Base fast math special functions.
2562+
* Fast math special functions.
25632563
*/
25642564
fast: typeof fast;
25652565

0 commit comments

Comments
 (0)