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

feat: update namespace TypeScript declarations #6337

Merged
merged 1 commit into from
Mar 24, 2025
Merged
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
14 changes: 14 additions & 0 deletions lib/node_modules/@stdlib/console/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -59,6 +59,20 @@ interface Namespace {
*
* ns.logEach( '%d < %d ', x, y );
* // e.g., => '1 < 4\n2 < 5\n3 < 6\n'
*
* @example
* var x = [ 0.5, 1.0, 1.5 ];
* var y = [ 0.25, 0.5, 0.75 ];
*
* ns.logEach( '%0.2f > %0.2f', x, y );
* // e.g., => '0.50 > 0.25\n1.00 > 0.50\n1.50 > 0.75\n'
*
* @example
* var x = [ 'foo', 'bar' ];
* var y = [ 'beep', 'boop' ];
*
* ns.logEach( 'x: %s, y: %s', x, y );
* // e.g., => 'x: foo, y: beep\nx: bar, y: boop\n'
*/
logEach: typeof logEach;

22 changes: 22 additions & 0 deletions lib/node_modules/@stdlib/ndarray/base/assert/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ import isRowMajorContiguous = require( '@stdlib/ndarray/base/assert/is-row-major
import isRowMajorString = require( '@stdlib/ndarray/base/assert/is-row-major-string' );
import isSafeDataTypeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' );
import isSameKindDataTypeCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' );
import isScalarMostlySafeCompatible = require( '@stdlib/ndarray/base/assert/is-scalar-mostly-safe-compatible' );
import isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' );
import isSingleSegmentCompatible = require( '@stdlib/ndarray/base/assert/is-single-segment-compatible' );
import isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' );
@@ -839,6 +840,27 @@ interface Namespace {
*/
isSameKindDataTypeCast: typeof isSameKindDataTypeCast;

/**
* Returns a boolean indicating whether a scalar value can be safely cast or, for floating-point data types, downcast to specified ndarray data type.
*
* @param value - scalar value
* @param dtype - ndarray data type
* @returns boolean indicating whether a scalar value can be safely cast
*
* @example
* var bool = ns.isScalarMostlySafeCompatible( 3.0, 'float64' );
* // returns true
*
* @example
* var bool = ns.isScalarMostlySafeCompatible( 3.14, 'int32' );
* // returns false
*
* @example
* var bool = ns.isScalarMostlySafeCompatible( -1, 'uint32' );
* // returns false
*/
isScalarMostlySafeCompatible: typeof isScalarMostlySafeCompatible;

/**
* Tests whether an input value is a supported ndarray signed integer data type.
*
4 changes: 4 additions & 0 deletions lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -952,6 +952,10 @@ interface Namespace {
/**
* Fills an input ndarray with a specified value.
*
* ## Notes
*
* - A `value` must be able to safely cast to the input ndarray data type. Scalar values having floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., a scalar double-precision floating-point number can be used to fill a 'float32' input ndarray).
*
* @param x - input ndarray
* @param value - scalar value
*
32 changes: 32 additions & 0 deletions lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ import empty = require( '@stdlib/ndarray/empty' );
import emptyLike = require( '@stdlib/ndarray/empty-like' );
import FancyArray = require( '@stdlib/ndarray/fancy' );
import fill = require( '@stdlib/ndarray/fill' );
import fillBy = require( '@stdlib/ndarray/fill-by' );
import filter = require( '@stdlib/ndarray/filter' );
import filterMap = require( '@stdlib/ndarray/filter-map' );
import flag = require( '@stdlib/ndarray/flag' );
@@ -574,6 +575,10 @@ interface Namespace {
/**
* Fills an input ndarray with a specified value.
*
* ## Notes
*
* - A `value` must be able to safely cast to the input ndarray data type. Scalar values having floating-point data types (both real and complex) are allowed to downcast to a lower precision data type of the same kind (e.g., a scalar double-precision floating-point number can be used to fill a 'float32' input ndarray).
*
* @param x - input ndarray
* @param value - scalar value
* @returns input ndarray
@@ -593,6 +598,33 @@ interface Namespace {
*/
fill: typeof fill;

/**
* Fills an input ndarray according to a callback function.
*
* @param x - input ndarray
* @param fcn - callback function
* @param thisArg - callback function execution context
* @returns input ndarray
*
* @example
* var zeros = require( '@stdlib/ndarray/zeros' );
* var getData = require( '@stdlib/ndarray/data-buffer' );
*
* function fcn() {
* return 10.0;
* }
*
* var x = zeros( [ 3, 1, 2 ], {
* 'dtype': 'float64'
* });
*
* ns.fillBy( x, fcn );
*
* console.log( getData( x ) );
* // => <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]
*/
fillBy: typeof fillBy;

/**
* Returns a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.
*