diff --git a/src/lib/es2020.string.d.ts b/src/lib/es2020.string.d.ts index fd8ce55f1405d..58ae8fe75ccee 100644 --- a/src/lib/es2020.string.d.ts +++ b/src/lib/es2020.string.d.ts @@ -4,11 +4,11 @@ interface String { /** - * Matches a string with a regular expression, and returns an iterable of matches + * Matches a string with a regular expression or string, and returns an iterable of matches * containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. + * @param regexp A regular expression or string literal with which to search the string */ - matchAll(regexp: RegExp): RegExpStringIterator; + matchAll(regexp: RegExp | string): RegExpStringIterator; /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ toLocaleLowerCase(locales?: Intl.LocalesArgument): string; diff --git a/tests/baselines/reference/stringMatchAll.types b/tests/baselines/reference/stringMatchAll.types index 0de59f913a9a2..9321c24b18458 100644 --- a/tests/baselines/reference/stringMatchAll.types +++ b/tests/baselines/reference/stringMatchAll.types @@ -6,12 +6,12 @@ const matches = "matchAll".matchAll(/\w/g); > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"matchAll".matchAll(/\w/g) : RegExpStringIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->"matchAll".matchAll : (regexp: RegExp) => RegExpStringIterator -> : ^ ^^ ^^^^^ +>"matchAll".matchAll : (regexp: RegExp | string) => RegExpStringIterator +> : ^ ^^ ^^^^^ >"matchAll" : "matchAll" > : ^^^^^^^^^^ ->matchAll : (regexp: RegExp) => RegExpStringIterator -> : ^ ^^ ^^^^^ +>matchAll : (regexp: RegExp | string) => RegExpStringIterator +> : ^ ^^ ^^^^^ >/\w/g : RegExp > : ^^^^^^