Skip to content

Update namespace TypeScript declarations #2136

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

Merged
merged 1 commit into from
Apr 7, 2024
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
23 changes: 23 additions & 0 deletions lib/node_modules/@stdlib/array/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ import unary4d = require( '@stdlib/array/base/unary4d' );
import unary5d = require( '@stdlib/array/base/unary5d' );
import unarynd = require( '@stdlib/array/base/unarynd' );
import unitspace = require( '@stdlib/array/base/unitspace' );
import arrayWith = require( '@stdlib/array/base/with' );
import zeroTo = require( '@stdlib/array/base/zero-to' );
import zeros = require( '@stdlib/array/base/zeros' );
import zeros2d = require( '@stdlib/array/base/zeros2d' );
Expand Down Expand Up @@ -3996,6 +3997,28 @@ interface Namespace {
*/
unitspace: typeof unitspace;

/**
* Returns a new array with the element at the specified index replaced with a provided value.
*
* @param x - input array
* @param index - index at which to set a provided value
* @param value - replacement value
* @returns output array
*
* @example
* var x = [ 1, 2, 3 ];
*
* var out = ns.arrayWith( x, 0, 7 );
* // returns [ 7, 2, 3 ]
*
* @example
* var x = [ 1, 2, 3, 4, 5, 6 ];
*
* var out = ns.arrayWith( x, 2, 8 );
* // returns [ 1, 8, 3, 4, 5, 6 ]
*/
arrayWith: typeof arrayWith;

/**
* Generates a linearly spaced numeric array whose elements increment by 1 starting from zero.
*
Expand Down
106 changes: 106 additions & 0 deletions lib/node_modules/@stdlib/string/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ import removeLastGraphemeCluster = require( '@stdlib/string/base/remove-last-gra
import repeat = require( '@stdlib/string/base/repeat' );
import replace = require( '@stdlib/string/base/replace' );
import replaceAfter = require( '@stdlib/string/base/replace-after' );
import replaceAfterLast = require( '@stdlib/string/base/replace-after-last' );
import replaceBefore = require( '@stdlib/string/base/replace-before' );
import replaceBeforeLast = require( '@stdlib/string/base/replace-before-last' );
import reverse = require( '@stdlib/string/base/reverse' );
import reverseCodePoints = require( '@stdlib/string/base/reverse-code-points' );
import reverseGraphemeClusters = require( '@stdlib/string/base/reverse-grapheme-clusters' );
Expand Down Expand Up @@ -829,6 +831,11 @@ interface Namespace {
/**
* Replaces the substring after the first occurrence of a specified search string.
*
* ## Notes
*
* - If unable to find search string, the function returns the input string unchanged.
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`.
*
* @param str - input string
* @param search - search string
* @param replacement - replacement string
Expand Down Expand Up @@ -861,9 +868,61 @@ interface Namespace {
*/
replaceAfter: typeof replaceAfter;

/**
* Replaces the substring after the last occurrence of a specified search string.
*
* ## Notes
*
* - The function scans a provided string from the starting index to the beginning of the string (i.e., backward).
* - If unable to find search string, the function returns the input string unchanged.
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`.
*
* @param str - input string
* @param search - search string
* @param replacement - replacement string
* @param fromIndex - index from which to start searching
* @returns output string
*
* @example
* var str = 'beep boop';
* var out = ns.replaceAfterLast( str, ' ', 'foo', str.length );
* // returns 'beep foo'
*
* @example
* var str = 'beep boop';
* var out = ns.replaceAfterLast( str, 'p', 'foo', str.length );
* // returns 'beep boopfoo'
*
* @example
* var str = 'Hello World!';
* var out = ns.replaceAfterLast( str, '', 'foo', str.length );
* // returns 'Hello World!'
*
* @example
* var str = 'Hello World!';
* var out = ns.replaceAfterLast( str, 'xyz', 'foo', str.length );
* // returns 'Hello World!'
*
* @example
* var str = 'beep boop baz';
* var out = ns.replaceAfterLast( str, 'p b', 'foo', str.length );
* // returns 'beep boop bfoo'
*
* @example
* var str = 'beep boop baz';
* var out = ns.replaceAfterLast( str, 'p b', 'foo', 6 );
* // returns 'beep bfoo'
*/
replaceAfterLast: typeof replaceAfterLast;

/**
* Replaces the substring before the first occurrence of a specified search string.
*
* ## Notes
*
* - If unable to find search string, the function returns the input string unchanged.
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`.
*
* @param str - input string
* @param search - search string
* @param replacement - replacement string
Expand All @@ -888,6 +947,53 @@ interface Namespace {
*/
replaceBefore: typeof replaceBefore;

/**
* Replaces the substring before the last occurrence of a specified search string.
*
* ## Notes
*
* - The function scans a provided string from the starting index to the beginning of the string (i.e., backward).
* - If unable to find search string, the function returns the input string unchanged.
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`.
*
* @param str - input string
* @param search - search string
* @param replacement - replacement string
* @param fromIndex - index from which to start searching
* @returns output string
*
* @example
* var str = 'beep boop';
* var out = ns.replaceBeforeLast( str, ' ', 'foo', str.length );
* // returns 'foo boop'
*
* @example
* var str = 'beep boop';
* var out = ns.replaceBeforeLast( str, 'p', 'foo', str.length );
* // returns 'foop'
*
* @example
* var str = 'Hello World!';
* var out = ns.replaceBeforeLast( str, '', 'foo', str.length );
* // returns 'Hello World!'
*
* @example
* var str = 'Hello World!';
* var out = ns.replaceBeforeLast( str, 'xyz', 'foo', str.length );
* // returns 'Hello World!'
*
* @example
* var str = 'beep boop baz';
* var out = ns.replaceBeforeLast( str, 'p b', 'foo', str.length );
* // returns 'foop baz'
*
* @example
* var str = 'beep boop baz';
* var out = ns.replaceBeforeLast( str, 'p b', 'foo', 6 );
* // returns 'foop boop baz'
*/
replaceBeforeLast: typeof replaceBeforeLast;

/**
* Reverses the UTF-16 code units of a string.
*
Expand Down
Loading