Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update namespace TypeScript declarations #1047

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
55 changes: 33 additions & 22 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 @@ -2284,18 +2284,19 @@ interface Namespace {
coversin: typeof coversin;

/**
* Computes the argument of a complex number in radians.
* Computes the argument of a double-precision complex floating-point number in radians.
*
* ## Notes
*
* - The argument of a complex number, also known as the phase, is the angle of the radius extending from the origin to the complex number plotted in the complex plane and the positive real axis.
*
* @param re - real component
* @param im - imaginary component
* @param z - complex number
* @returns argument
*
* @example
* var phi = ns.cphase( 5.0, 3.0 );
* var Complex128 = require( `@stdlib/complex/float64` );
*
* var phi = ns.cphase( new Complex128( 5.0, 3.0 ) );
* // returns ~0.5404
*/
cphase: typeof cphase;
Expand All @@ -2314,15 +2315,24 @@ interface Namespace {
cpolar: typeof cpolar;

/**
* Rounds a complex number to the nearest integer.
* Rounds each component of a double-precision complex floating-point number to the nearest integer.
*
* @param re - real component
* @param im - imaginary component
* @returns real and imaginary components
* @param z - input value
* @returns result
*
* @example
* var out = ns.cround( 5.5, 3.3 );
* // returns [ 6.0, 3.0 ]
* var Complex128 = require( `@stdlib/complex/float64` );
* var real = require( `@stdlib/complex/real` );
* var imag = require( `@stdlib/complex/imag` );
*
* var v = cceil( new Complex128( -4.2, 5.5 ) );
* // returns <Complex128>
*
* var re = real( v );
* // returns -4.0
*
* var im = imag( v );
* // returns 6.0
*/
cround: typeof cround;

Expand Down Expand Up @@ -2369,23 +2379,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
Loading