Added the '[Symbol.split]' method to the 'RegExp' interface.

This commit is contained in:
Daniel Rosenwasser
2015-08-18 15:10:08 -07:00
parent e4077ec0f8
commit f56d8f5509

18
src/lib/es6.d.ts vendored
View File

@@ -686,7 +686,7 @@ interface RegExp {
[Symbol.match](str: string): RegExpMatchArray;
/**
* Replaces text in a string, using a regular expression.
* Replaces text in a string, using this 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
@@ -695,7 +695,7 @@ interface RegExp {
[Symbol.replace](string: string, replaceValue: string): string;
/**
* Replaces text in a string, using a regular expression.
* Replaces text in a string, using this 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.
@@ -710,6 +710,20 @@ interface RegExp {
*/
[Symbol.search](string: string): number;
/**
* Returns an array of substrings that were delimited by strings in the original input that
* match against this regular expression.
*
* If the regular expression contains capturing parentheses, then each time this
* regular expression matches, the results (including any undefined results) of the
* capturing parentheses are spliced.
*
* @param string string value to split
* @param limit if not undefined, the output array is truncated so that it contains no more
* than 'limit' elements.
*/
[Symbol.split](string: string, limit?: number): 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: