From 4dd701a22c5a4256a225f52ad393066e28a348a2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 19 Aug 2015 15:02:13 -0700 Subject: [PATCH] Added overload for 'String#match' to take objects with '[Symbol.match]' method. --- src/lib/es6.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 10358a5e74d..f4c87636dec 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -425,6 +425,14 @@ interface String { */ startsWith(searchString: string, position?: number): boolean; + // Overloads for objects with methods of well-known symbols. + + /** + * Matches a string an object that supports being matched against, and returns an array containing the results of that search. + * @param regexpLike An object that supports being matched against. + */ + match(regexpLike: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; + /** * Returns an HTML anchor element and sets the name attribute to the text value * @param name