Add replacer function overload for replaceAll (#37476)
This commit is contained in:
parent
326e1c9ff8
commit
a98adefd00
7
src/lib/esnext.string.d.ts
vendored
7
src/lib/esnext.string.d.ts
vendored
|
@ -5,4 +5,11 @@ interface String {
|
||||||
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
||||||
*/
|
*/
|
||||||
replaceAll(searchValue: string | RegExp, replaceValue: string): string;
|
replaceAll(searchValue: string | RegExp, replaceValue: string): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace all instances of a substring in a string, using a regular expression or search string.
|
||||||
|
* @param searchValue A string to search for.
|
||||||
|
* @param replacer A function that returns the replacement text.
|
||||||
|
*/
|
||||||
|
replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue