Added overload for 'String#search' to take objects with '[Symbol.search]' method.
This commit is contained in:
parent
25d55b5101
commit
312df84934
10
src/lib/es6.d.ts
vendored
10
src/lib/es6.d.ts
vendored
|
@ -429,9 +429,9 @@ interface String {
|
|||
|
||||
/**
|
||||
* 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.
|
||||
* @param matcher An object that supports being matched against.
|
||||
*/
|
||||
match(regexpLike: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray;
|
||||
match(matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using an object that supports replacement within a string.
|
||||
|
@ -447,6 +447,12 @@ interface String {
|
|||
*/
|
||||
replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
|
||||
/**
|
||||
* Finds the first substring match in a regular expression search.
|
||||
* @param searcher An object which supports searching within a string.
|
||||
*/
|
||||
search(searcher: { [Symbol.search](string: string): number; }): number;
|
||||
|
||||
/**
|
||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
||||
* @param name
|
||||
|
|
Loading…
Reference in a new issue