From 08f37cc2fa8fe07bea95584e312b9ad846793406 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 19 Aug 2015 15:09:25 -0700 Subject: [PATCH] Added overload for 'String#split' to take objects with '[Symbol.split]' method. --- src/lib/es6.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index e9a23cc2eea..83000e7d4b5 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -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 HTML anchor element and sets the name attribute to the text value * @param name