mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Added the '[Symbol.replace]' method to the 'RegExp' interface.
This commit is contained in:
parent
1e9b5e4c30
commit
97618104bd
8
src/lib/core.d.ts
vendored
8
src/lib/core.d.ts
vendored
@ -324,9 +324,9 @@ interface String {
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
* @param searchValue A String object or string literal that represents the regular expression
|
||||
* @param replaceValue A function that returns the replacement text.
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string;
|
||||
replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
@ -338,9 +338,9 @@ interface String {
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
|
||||
* @param replaceValue A function that returns the replacement text.
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string;
|
||||
replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
|
||||
/**
|
||||
* Finds the first substring match in a regular expression search.
|
||||
|
||||
17
src/lib/es6.d.ts
vendored
17
src/lib/es6.d.ts
vendored
@ -685,6 +685,23 @@ interface RegExp {
|
||||
*/
|
||||
[Symbol.match](str: string): RegExpMatchArray;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression.
|
||||
* @param string A String object or string literal whose contents matching against
|
||||
* this regular expression will be replaced
|
||||
* @param replaceValue A String object or string literal containing the text to replace for every
|
||||
* successful match of this regular expression.
|
||||
*/
|
||||
[Symbol.replace](string: string, replaceValue: string): string;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression.
|
||||
* @param string A String object or string literal whose contents matching against
|
||||
* this regular expression will be replaced
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
[Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
|
||||
/**
|
||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
||||
* The characters in this string are sequenced and concatenated in the following order:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user