Added overload for 'String#split' to take objects with '[Symbol.split]' method.

This commit is contained in:
Daniel Rosenwasser 2015-08-19 15:09:25 -07:00
parent 312df84934
commit 08f37cc2fa

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

@ -453,6 +453,13 @@ interface String {
*/
search(searcher: { [Symbol.search](string: string): number; }): number;
/**
* Split a string into substrings using the specified separator and return them as an array.
* @param splitter An object that can split a string.
* @param limit A value used to limit the number of elements returned in the array.
*/
split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];
/**
* Returns an <a> HTML anchor element and sets the name attribute to the text value
* @param name