Skip to content

Commit

Permalink
feat: update namespace TypeScript declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte authored and stdlib-bot committed Jul 14, 2023
1 parent 35ef1b1 commit cf9d671
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 13 deletions.
49 changes: 49 additions & 0 deletions lib/node_modules/@stdlib/array/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import datespace = require( '@stdlib/array/datespace' );
import arrayDataType = require( '@stdlib/array/dtype' );
import arrayDataTypes = require( '@stdlib/array/dtypes' );
import aempty = require( '@stdlib/array/empty' );
import aemptyLike = require( '@stdlib/array/empty-like' );
import filledarray = require( '@stdlib/array/filled' );
import filledarrayBy = require( '@stdlib/array/filled-by' );
import Float32Array = require( '@stdlib/array/float32' );
Expand Down Expand Up @@ -398,6 +399,54 @@ interface Namespace {
*/
aempty: typeof aempty;

/**
* Creates an uninitialized array having the same length and data type as a provided input array.
*
* ## Notes
*
* - In browser environments, the function always returns zero-filled arrays.
* - If `dtype` is `'generic'`, the function always returns a zero-filled array.
* - In Node.js versions `>=3.0.0`, the underlying memory of returned typed arrays is **not** initialized. Memory contents are unknown and may contain **sensitive** data.
*
* The function recognizes the following data types:
*
* - `float64`: double-precision floating-point numbers (IEEE 754)
* - `float32`: single-precision floating-point numbers (IEEE 754)
* - `complex128`: double-precision complex floating-point numbers
* - `complex64`: single-precision complex floating-point numbers
* - `int32`: 32-bit two's complement signed integers
* - `uint32`: 32-bit unsigned integers
* - `int16`: 16-bit two's complement signed integers
* - `uint16`: 16-bit unsigned integers
* - `int8`: 8-bit two's complement signed integers
* - `uint8`: 8-bit unsigned integers
* - `uint8c`: 8-bit unsigned integers clamped to `0-255`
* - `generic`: generic JavaScript values
*
* @param x - input array from which to derive the output array length
* @param dtype - data type
* @returns empty array
*
* @example
* var zeros = require( `@stdlib/array/zeros` );
*
* var x = zeros( 2, 'float32' );
* // returns <Float32Array>[ 0.0, 0.0 ]
*
* var arr = ns.aemptyLike( x );
* // returns <Float32Array>
*
* @example
* var zeros = require( `@stdlib/array/zeros` );
*
* var x = zeros( 2, 'float64' );
* // returns <Float32Array>[ 0.0, 0.0 ]
*
* var arr = ns.aemptyLike( x );
* // returns <Float64Array>
*/
aemptyLike: typeof aemptyLike;

/**
* Returns a filled typed array view of an `ArrayBuffer`.
*
Expand Down
25 changes: 13 additions & 12 deletions lib/node_modules/@stdlib/math/base/special/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2369,23 +2369,24 @@ interface Namespace {
csch: typeof csch;

/**
* Evaluates the signum function of a complex number.
* Evaluates the signum function of a double-precision complex floating-point number.
*
* @param re - real component
* @param im - imaginary component
* @returns real and imaginary components
* @param z - input value
* @returns result
*
* @example
* var v = ns.csignum( -4.2, 5.5 );
* // returns [ -0.6069136033622302, 0.79476781392673 ]
* var Complex128 = require( `@stdlib/complex/float64` );
* var real = require( `@stdlib/complex/real` );
* var imag = require( `@stdlib/complex/imag` );
*
* @example
* var v = ns.csignum( 0.0, 0.0 );
* // returns [ 0.0, 0.0 ]
* var v = cceil( new Complex128( -4.2, 5.5 ) );
* // returns <Complex128>
*
* @example
* var v = ns.csignum( NaN, NaN );
* // returns [ NaN, NaN ]
* var re = real( v );
* // returns -0.6069136033622302
*
* var im = imag( v );
* // returns 0.79476781392673
*/
csignum: typeof csignum;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ interface Namespace {
* var dist = ns.levenshteinDistance( 'algorithm', 'altruistic' );
* // returns 6
*
*
* @example
* var dist = ns.levenshteinDistance( 'hippo', 'elephant' );
* // returns 7
Expand Down
49 changes: 49 additions & 0 deletions lib/node_modules/@stdlib/string/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ import camelcase = require( '@stdlib/string/camelcase' );
import capitalize = require( '@stdlib/string/capitalize' );
import codePointAt = require( '@stdlib/string/code-point-at' );
import constantcase = require( '@stdlib/string/constantcase' );
import dotcase = require( '@stdlib/string/dotcase' );
import endsWith = require( '@stdlib/string/ends-with' );
import first = require( '@stdlib/string/first' );
import forEach = require( '@stdlib/string/for-each' );
import format = require( '@stdlib/string/format' );
import fromCodePoint = require( '@stdlib/string/from-code-point' );
import kebabcase = require( '@stdlib/string/kebabcase' );
Expand Down Expand Up @@ -186,6 +188,26 @@ interface Namespace {
*/
constantcase: typeof constantcase;

/**
* Converts a string to dot case.
*
* @param str - string to convert
* @returns dot-cased string
*
* @example
* var str = ns.dotcase( 'Hello World!' );
* // returns 'hello.world'
*
* @example
* var str = ns.dotcase( 'foo_bar' );
* // returns 'foo.bar'
*
* @example
* var str = ns.dotcase( 'foo-bar' );
* // returns 'foo.bar'
*/
dotcase: typeof dotcase;

/**
* Tests if a string ends with the characters of another string.
*
Expand Down Expand Up @@ -253,6 +275,33 @@ interface Namespace {
*/
first: typeof first;

/**
* Invokes a callback once for each (visual) character of a string.
*
* ## Notes
*
* - When invoked, the input function is provided three arguments:
*
* - `value`: visual character
* - `index`: starting character index
* - `inpStr`: input string
*
* @param str - input string
* @param clbk - function to invoke
* @param thisArg - execution context
* @returns input string
*
* @example
* function log( value, index, inpStr ) {
* console.log( '%s: %d', index, value );
* }
*
* var testStr = 'presidential election';
*
* ns.forEach( testStr, log );
*/
forEach: typeof forEach;

/**
* Inserts supplied variable values into a format string.
*
Expand Down

0 comments on commit cf9d671

Please sign in to comment.