Skip to content

Commit 663211e

Browse files
committed
Update namespace Typescript definitions
1 parent a8438d6 commit 663211e

5 files changed

Lines changed: 247 additions & 2 deletions

File tree

lib/node_modules/@stdlib/constants/float32/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface Namespace {
4444
*
4545
* @example
4646
* var eps = ns.CBRT_EPS;
47-
* // returns 0.004921566601151848
47+
* // returns 0.004921566694974899
4848
*/
4949
CBRT_EPS: typeof CBRT_EPS;
5050

lib/node_modules/@stdlib/math/base/napi/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interface Namespace {
5858
}
5959

6060
/**
61-
* Standard library base math operators.
61+
* Standard library C APIs for registering a Node-API module exporting interfaces.
6262
*/
6363
declare var ns: Namespace;
6464

lib/node_modules/@stdlib/math/docs/types/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import base = require( '@stdlib/math/base' );
2525
import iter = require( '@stdlib/math/iter' );
2626
import special = require( '@stdlib/math/special' );
2727
import strided = require( '@stdlib/math/strided' );
28+
import tools = require( '@stdlib/math/tools' );
2829

2930
/**
3031
* Interface describing the `math` namespace.
@@ -49,6 +50,11 @@ interface Namespace {
4950
* Standard library strided math functions.
5051
*/
5152
strided: typeof strided;
53+
54+
/**
55+
* Standard library math tools.
56+
*/
57+
tools: typeof tools;
5258
}
5359

5460
/**

lib/node_modules/@stdlib/math/iter/docs/types/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import ops = require( '@stdlib/math/iter/ops' );
2525
import sequences = require( '@stdlib/math/iter/sequences' );
2626
import special = require( '@stdlib/math/iter/special' );
27+
import tools = require( '@stdlib/math/iter/tools' );
2728

2829
/**
2930
* Interface describing the `iter` namespace.
@@ -43,6 +44,11 @@ interface Namespace {
4344
* Standard library math iterators for special functions.
4445
*/
4546
special: typeof special;
47+
48+
/**
49+
* Standard library math iterator tooling.
50+
*/
51+
tools: typeof tools;
4652
}
4753

4854
/**

lib/node_modules/@stdlib/string/docs/types/index.d.ts

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/* tslint:disable:max-line-length */
2222
/* tslint:disable:max-file-line-count */
2323

24+
import acronym = require( '@stdlib/string/acronym' );
2425
import camelcase = require( '@stdlib/string/camelcase' );
2526
import capitalize = require( '@stdlib/string/capitalize' );
2627
import codePointAt = require( '@stdlib/string/code-point-at' );
@@ -34,6 +35,7 @@ import lowercase = require( '@stdlib/string/lowercase' );
3435
import nextGraphemeClusterBreak = require( '@stdlib/string/next-grapheme-cluster-break' );
3536
import numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' );
3637
import pad = require( '@stdlib/string/pad' );
38+
import pascalcase = require( '@stdlib/string/pascalcase' );
3739
import percentEncode = require( '@stdlib/string/percent-encode' );
3840
import removeFirst = require( '@stdlib/string/remove-first' );
3941
import removeLast = require( '@stdlib/string/remove-last' );
@@ -45,9 +47,16 @@ import replace = require( '@stdlib/string/replace' );
4547
import reverseString = require( '@stdlib/string/reverse' );
4648
import rpad = require( '@stdlib/string/right-pad' );
4749
import rtrim = require( '@stdlib/string/right-trim' );
50+
import snakecase = require( '@stdlib/string/snakecase' );
4851
import startcase = require( '@stdlib/string/startcase' );
4952
import startsWith = require( '@stdlib/string/starts-with' );
53+
import substringAfter = require( '@stdlib/string/substring-after' );
54+
import substringAfterLast = require( '@stdlib/string/substring-after-last' );
55+
import substringBefore = require( '@stdlib/string/substring-before' );
56+
import substringBeforeLast = require( '@stdlib/string/substring-before-last' );
5057
import trim = require( '@stdlib/string/trim' );
58+
import truncate = require( '@stdlib/string/truncate' );
59+
import truncateMiddle = require( '@stdlib/string/truncate-middle' );
5160
import uncapitalize = require( '@stdlib/string/uncapitalize' );
5261
import uppercase = require( '@stdlib/string/uppercase' );
5362
import utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' );
@@ -56,6 +65,28 @@ import utf16ToUTF8Array = require( '@stdlib/string/utf16-to-utf8-array' );
5665
* Interface describing the `string` namespace.
5766
*/
5867
interface Namespace {
68+
/**
69+
* Generates an acronym for a given string.
70+
*
71+
* @param str - input string
72+
* @param options - function options
73+
* @param options.stopwords - custom stop words
74+
* @returns generated acronym
75+
*
76+
* @example
77+
* var out = ns.acronym( 'the quick brown fox' );
78+
* // returns 'QBF'
79+
*
80+
* @example
81+
* var out = ns.acronym( 'Hard-boiled eggs' );
82+
* // returns 'HBE'
83+
*
84+
* @example
85+
* var out = ns.acronym( 'National Association of Securities Dealers Automated Quotation' );
86+
* // returns 'NASDAQ'
87+
*/
88+
acronym: typeof acronym;
89+
5990
/**
6091
* Converts a string to camel case.
6192
*
@@ -361,6 +392,26 @@ interface Namespace {
361392
*/
362393
pad: typeof pad;
363394

395+
/**
396+
* Converts a string to Pascal case.
397+
*
398+
* @param str - string to convert
399+
* @returns a Pascal-cased string
400+
*
401+
* @example
402+
* var str = ns.pascalcase( 'Hello World!' );
403+
* // returns 'HelloWorld'
404+
*
405+
* @example
406+
* var str = ns.pascalcase( 'foo_bar' );
407+
* // returns 'FooBar'
408+
*
409+
* @example
410+
* var str = ns.pascalcase( 'foo-bar' );
411+
* // returns 'FooBar'
412+
*/
413+
pascalcase: typeof pascalcase;
414+
364415
/**
365416
* Percent-encode a UTF-16 encoded string according to [RFC 3986][1].
366417
*
@@ -617,6 +668,26 @@ interface Namespace {
617668
*/
618669
rtrim: typeof rtrim;
619670

671+
/**
672+
* Converts a string to snake case.
673+
*
674+
* @param str - string to convert
675+
* @returns a snake-cased string
676+
*
677+
* @example
678+
* var str = ns.snakecase( 'fooBar' );
679+
* // returns 'foo_bar'
680+
*
681+
* @example
682+
* var str = ns.snakecase( 'foo-bar' );
683+
* // returns 'foo_bar'
684+
*
685+
* @example
686+
* var str = ns.snakecase( 'foo_bar' );
687+
* // returns 'foo_bar'
688+
*/
689+
snakecase: typeof snakecase;
690+
620691
/**
621692
* Capitalizes the first letter of each word in an input string.
622693
*
@@ -663,6 +734,110 @@ interface Namespace {
663734
*/
664735
startsWith: typeof startsWith;
665736

737+
/**
738+
* Returns the part of a string after a specified substring.
739+
*
740+
* @param str - input string
741+
* @param search - search string
742+
* @returns substring
743+
*
744+
* @example
745+
* var out = ns.substringAfter( 'Hello, world!', ', ' );
746+
* // returns 'world!'
747+
*
748+
* @example
749+
* var out = ns.substringAfter( 'beep boop', 'beep' );
750+
* // returns ' boop'
751+
*
752+
* @example
753+
* var out = ns.substringAfter( 'beep boop', 'boop' );
754+
* // returns ''
755+
*
756+
* @example
757+
* var out = ns.substringAfter( 'beep boop', 'xyz' );
758+
* // returns ''
759+
*/
760+
substringAfter: typeof substringAfter;
761+
762+
/**
763+
* Returns the part of a string after the last occurrence of a specified substring
764+
*
765+
* @param str - input string
766+
* @param search - search value
767+
* @returns substring
768+
*
769+
* @example
770+
* var out = ns.substringAfterLast( 'beep boop', 'b' );
771+
* // returns 'oop'
772+
*
773+
* @example
774+
* var out = ns.substringAfterLast( 'beep boop', 'o' );
775+
* // returns 'p'
776+
*
777+
* @example
778+
* var out = ns.substringAfterLast( 'Hello World', 'o' );
779+
* // returns 'rld'
780+
*
781+
* @example
782+
* var out = ns.substringAfterLast( 'Hello World', '!' );
783+
* // returns ''
784+
*
785+
* @example
786+
* var out = ns.substringAfterLast( 'Hello World', '' );
787+
* // returns ''
788+
*/
789+
substringAfterLast: typeof substringAfterLast;
790+
791+
/**
792+
* Returns the part of a string before a specified substring.
793+
*
794+
* @param str - input string
795+
* @param search - search string
796+
* @returns substring
797+
*
798+
* @example
799+
* var out = ns.substringBefore( 'beep boop', ' ' );
800+
* // returns 'beep'
801+
*
802+
* @example
803+
* var out = ns.substringBefore( 'beep boop', 'p' );
804+
* // returns 'bee'
805+
*
806+
* @example
807+
* var out = ns.substringBefore( 'Hello World!', '' );
808+
* // returns ''
809+
*
810+
* @example
811+
* var out = ns.substringBefore( 'Hello World!', 'XYZ' );
812+
* // returns 'Hello World!'
813+
*/
814+
substringBefore: typeof substringBefore;
815+
816+
/**
817+
* Returns the part of a string before the last occurrence of a specified substring.
818+
*
819+
* @param str - input string
820+
* @param search - search value
821+
* @returns substring
822+
*
823+
* @example
824+
* var out = ns.substringBeforeLast( 'abcba', 'b' );
825+
* // returns 'abc'
826+
*
827+
* @example
828+
* var out = ns.substringBeforeLast( 'Hello World, my friend!', ' ' );
829+
* // returns 'Hello World, my'
830+
*
831+
* @example
832+
* var out = ns.substringBeforeLast( 'abcba', ' ' );
833+
* // returns 'abcba'
834+
*
835+
* @example
836+
* var out = ns.substringBeforeLast( 'abcba', '' );
837+
* // returns 'abcba'
838+
*/
839+
substringBeforeLast: typeof substringBeforeLast;
840+
666841
/**
667842
* Trim whitespace characters from beginning and end of a string.
668843
*
@@ -683,6 +858,64 @@ interface Namespace {
683858
*/
684859
trim: typeof trim;
685860

861+
/**
862+
* Truncates a string to a specified length.
863+
*
864+
* @param str - input string
865+
* @param len - output string length (including ending)
866+
* @param ending - custom ending (default: `...`)
867+
* @returns truncated string
868+
*
869+
* @example
870+
* var out = ns.truncate( 'beep boop', 7 );
871+
* // returns 'beep...'
872+
*
873+
* @example
874+
* var out = ns.truncate( 'beep boop', 7, '|' );
875+
* // returns 'beep b|'
876+
*/
877+
truncate: typeof truncate;
878+
879+
/**
880+
* Truncates a string in the middle to a specified length.
881+
*
882+
* @param str - input string
883+
* @param len - output string length (including sequence)
884+
* @param seq - custom replacement sequence (default: `...`)
885+
* @returns truncated string
886+
*
887+
* @example
888+
* var str = 'beep boop';
889+
* var out = ns.truncateMiddle( str, 5 );
890+
* // returns 'b...p'
891+
*
892+
* @example
893+
* var str = 'beep boop';
894+
* var out = ns.truncateMiddle( str, 5, '>>>' );
895+
* // returns 'b>>>p'
896+
*
897+
* @example
898+
* var str = 'beep boop';
899+
* var out = ns.truncateMiddle( str, 10 );
900+
* // returns 'beep boop'
901+
*
902+
* @example
903+
* var str = 'beep boop';
904+
* var out = ns.truncateMiddle( str, 0 );
905+
* // returns ''
906+
*
907+
* @example
908+
* var str = 'beep boop';
909+
* var out = ns.truncateMiddle( str, 2 );
910+
* // returns '..'
911+
*
912+
* @example
913+
* var str = '🐺 Wolf Brothers 🐺';
914+
* var out = ns.truncateMiddle( str, 7 );
915+
* // returns '🐺 ... 🐺'
916+
*/
917+
truncateMiddle: typeof truncateMiddle;
918+
686919
/**
687920
* Uncapitalizes the first character of a string.
688921
*

0 commit comments

Comments
 (0)