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 #1068

Merged
merged 1 commit into from
Jul 21, 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
61 changes: 47 additions & 14 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 @@ -1597,19 +1597,43 @@ interface Namespace {
cceiln: typeof cceiln;

/**
* Computes the cis function of a complex number.
* Evaluates the cis function for a double-precision complex floating-point number.
*
* @param re - real component
* @param im - imaginary component
* @returns real and imaginary components
* @param z - complex number
* @returns result
*
* @example
* var v = ns.ccis( 0.0, 0.0 );
* // returns [ 1.0, 0.0 ]
* var Complex128 = require( `@stdlib/complex/float64` );
* var real = require( `@stdlib/complex/real` );
* var imag = require( `@stdlib/complex/imag` );
*
* var z = new Complex128( 0.0, 0.0 );
* // returns <Complex128>
*
* var out = cccis( z );
* // returns <Complex128>
*
* var re = real( out );
* // returns 1.0
*
* var im = imag( out );
* // returns 0.0
* @example
* var v = ns.ccis( 1.0, 0.0 );
* // returns [ ~0.540, ~0.841 ]
* var Complex128 = require( `@stdlib/complex/float64` );
* var real = require( `@stdlib/complex/real` );
* var imag = require( `@stdlib/complex/imag` );
*
* var z = new Complex128( 1.0, 0.0 );
* // returns <Complex128>
*
* var out = cccis( z );
* // returns <Complex128>
*
* var re = real( out );
* // returns ~0.540
*
* var im = imag( out );
* // returns ~0.841
*/
ccis: typeof ccis;

Expand Down Expand Up @@ -1947,15 +1971,24 @@ interface Namespace {
cidentityf: typeof cidentityf;

/**
* Computes the inverse of a complex number.
* Computes the inverse 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.cinv( 2.0, 4.0 );
* // returns [ 0.1, -0.2 ]
* var Complex128 = require( `@stdlib/complex/float64` );
* var real = require( `@stdlib/complex/real` );
* var imag = require( `@stdlib/complex/imag` );
*
* var v = ns.cinv( new Complex128( 2.0, 4.0 ) );
* // returns <Complex128>
*
* var re = real( v );
* // returns 0.1
*
* var im = imag( v );
* // returns -0.2
*/
cinv: typeof cinv;

Expand Down
182 changes: 180 additions & 2 deletions lib/node_modules/@stdlib/string/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ import camelcase = require( '@stdlib/string/base/camelcase' );
import capitalize = require( '@stdlib/string/base/capitalize' );
import codePointAt = require( '@stdlib/string/base/code-point-at' );
import constantcase = require( '@stdlib/string/base/constantcase' );
import distances = require( '@stdlib/string/base/distances' );
import dotcase = require( '@stdlib/string/base/dotcase' );
import endsWith = require( '@stdlib/string/base/ends-with' );
import first = require( '@stdlib/string/base/first' );
import firstCodePoint = require( '@stdlib/string/base/first-code-point' );
import firstGraphemeCluster = require( '@stdlib/string/base/first-grapheme-cluster' );
import forEach = require( '@stdlib/string/base/for-each' );
import forEachCodePoint = require( '@stdlib/string/base/for-each-code-point' );
import forEachGraphemeCluster = require( '@stdlib/string/base/for-each-grapheme-cluster' );
import formatInterpolate = require( '@stdlib/string/base/format-interpolate' );
import formatTokenize = require( '@stdlib/string/base/format-tokenize' );
import headercase = require( '@stdlib/string/base/headercase' );
Expand Down Expand Up @@ -134,6 +141,11 @@ interface Namespace {
*/
constantcase: typeof constantcase;

/**
* Implementations of various string similarity metrics.
*/
distances: typeof distances;

/**
* Converts a string to dot case.
*
Expand Down Expand Up @@ -176,6 +188,172 @@ interface Namespace {
*/
endsWith: typeof endsWith;

/**
* Returns the first `n` UTF-16 code units of a string.
*
* @param str - input string
* @param n - number of code units to return
* @returns output string
*
* @example
* var out = ns.first( 'last man standing', 1 );
* // returns 'l'
*
* @example
* var out = ns.first( 'presidential election', 1 );
* // returns 'p'
*
* @example
* var out = ns.first( 'JavaScript', 1 );
* // returns 'J'
*
* @example
* var out = ns.first( 'Hidden Treasures', 1 );
* // returns 'H'
*
* @example
* var out = ns.first( 'foo bar', 5 );
* // returns 'foo b'
*/
first: typeof first;

/**
* Returns the first `n` Unicode code points of a string.
*
* @param str - input string
* @param n - number of code points to return
* @returns output string
*
* @example
* var out = ns.firstCodePoint( 'last man standing', 1 );
* // returns 'l'
*
* @example
* var out = ns.firstCodePoint( 'presidential election', 1 );
* // returns 'p'
*
* @example
* var out = ns.firstCodePoint( 'JavaScript', 1 );
* // returns 'J'
*
* @example
* var out = ns.firstCodePoint( 'Hidden Treasures', 1 );
* // returns 'H'
*
* @example
* var out = ns.firstCodePoint( 'foo bar', 5 );
* // returns 'foo b'
*/
firstCodePoint: typeof firstCodePoint;

/**
* Returns the first `n` grapheme clusters (i.e., user-perceived characters) of a string.
*
* @param str - input string
* @param n - number of grapheme clusters to return
* @returns output string
*
* @example
* var out = ns.firstGraphemeCluster( 'last man standing', 1 );
* // returns 'l'
*
* @example
* var out = ns.firstGraphemeCluster( 'presidential election', 1 );
* // returns 'p'
*
* @example
* var out = ns.firstGraphemeCluster( 'JavaScript', 1 );
* // returns 'J'
*
* @example
* var out = ns.firstGraphemeCluster( 'Hidden Treasures', 1 );
* // returns 'H'
*
* @example
* var out = ns.firstGraphemeCluster( '🐶🐮🐷🐰🐸', 2 );
* // returns '🐶🐮'
*
* @example
* var out = ns.firstGraphemeCluster( 'foo bar', 5 );
* // returns 'foo b'
*/
firstGraphemeCluster: typeof firstGraphemeCluster;

/**
* Invokes a function for each UTF-16 code unit in a string.
*
* ## Notes
*
* - When invoked, the provided function is provided three arguments:
*
* - **value**: character.
* - **index**: character index.
* - **str**: input string.
*
* @param str - input string
* @param clbk - function to invoke
* @param thisArg - execution context
* @returns input string
*
* @example
* function log( value, index ) {
* console.log( '%d: %s', index, value );
* }
*
* ns.forEach( 'Hello, World!', log );
*/
forEach: typeof forEach;

/**
* Invokes a function for each Unicode code point in a string.
*
* ## Notes
*
* - When invoked, the provided function is provided three arguments:
*
* - **value**: code point.
* - **index**: starting code point index.
* - **str**: input string.
*
* @param str - input string
* @param clbk - function to invoke
* @param thisArg - execution context
* @returns input string
*
* @example
* function log( value, index ) {
* console.log( '%d: %s', index, value );
* }
*
* ns.forEachCodePoint( 'Hello, World!', log );
*/
forEachCodePoint: typeof forEachCodePoint;

/**
* Invokes a function for each grapheme cluster (i.e., user-perceived character) in a string.
*
* ## Notes
*
* - When invoked, the provided function is provided three arguments:
*
* - **value**: grapheme cluster.
* - **index**: starting grapheme cluster index.
* - **str**: input string.
*
* @param str - input string
* @param clbk - function to invoke
* @param thisArg - execution context
* @returns input string
*
* @example
* function log( value, index ) {
* console.log( '%d: %s', index, value );
* }
*
* ns.forEachGraphemeCluster( 'Hello, World!', log );
*/
forEachGraphemeCluster: typeof forEachGraphemeCluster;

/**
* Generates string from a token array by interpolating values.
*
Expand Down Expand Up @@ -204,10 +382,10 @@ interface Namespace {
formatTokenize: typeof formatTokenize;

/**
* Converts a string to Header case.
* Converts a string to HTTP header case.
*
* @param str - string to convert
* @returns Header-cased string
* @returns HTTP header-cased string
*
* @example
* var str = ns.headercase( 'Hello World!' );
Expand Down
47 changes: 35 additions & 12 deletions lib/node_modules/@stdlib/string/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ 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 headercase = require( '@stdlib/string/headercase' );
import kebabcase = require( '@stdlib/string/kebabcase' );
import lpad = require( '@stdlib/string/left-pad' );
import ltrim = require( '@stdlib/string/left-trim' );
Expand Down Expand Up @@ -243,7 +244,7 @@ interface Namespace {
endsWith: typeof endsWith;

/**
* Removes the first visual character(s) of a string.
* Returns the first character(s) of a string.
*
* @param str - input string
* @param n - number of characters to return (default: 1)
Expand Down Expand Up @@ -276,29 +277,31 @@ interface Namespace {
first: typeof first;

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

Expand Down Expand Up @@ -339,6 +342,26 @@ interface Namespace {
*/
fromCodePoint: typeof fromCodePoint;

/**
* Converts a string to HTTP header case.
*
* @param str - string to convert
* @returns HTTP header-cased string
*
* @example
* var str = ns.headercase( 'Hello World!' );
* // returns 'Hello-World'
*
* @example
* var str = ns.headercase( 'foo_bar' );
* // returns 'Foo-Bar'
*
* @example
* var str = ns.headercase( 'foo-bar' );
* // returns 'Foo-Bar'
*/
headercase: typeof headercase;

/**
* Converts a string to kebab case.
*
Expand Down Expand Up @@ -636,7 +659,7 @@ interface Namespace {
* // returns 'residential election'
*
* @example
* var out = ns.removeFirst( 'javaScript' );
* var out = ns.removeFirst( 'JavaScript' );
* // returns 'avaScript'
*
* @example
Expand Down
Loading