Skip to content

Latest commit

 

History

History
60 lines (56 loc) · 2.06 KB

es2015.symbol.wellknown.d.ts.md

File metadata and controls

60 lines (56 loc) · 2.06 KB

es2015.symbol.wellknown.d.ts Diffs

Index: es2015.symbol.wellknown.d.ts
===================================================================
--- es2015.symbol.wellknown.d.ts
+++ es2015.symbol.wellknown.d.ts
@@ -168,9 +168,8 @@
    * that search.
    * @param string A string to search within.
    */
   [Symbol.match](string: string): RegExpMatchArray | null;
-
   /**
    * Replaces text in a string, using this regular expression.
    * @param string A String object or string literal whose contents matching against
    *               this regular expression will be replaced
@@ -186,9 +185,14 @@
    * @param replacer A function that returns the replacement text.
    */
   [Symbol.replace](
     string: string,
-    replacer: (substring: string, ...args: any[]) => string,
+    replacer: (
+      substring: string,
+      // TODO: could be improved, but blocked by issue:
+      // https://github.com/microsoft/TypeScript/issues/45972
+      ...rest: (string | number)[]
+    ) => string,
   ): string;
 
   /**
    * Finds the position beginning first substring match in a regular expression search
@@ -225,9 +229,8 @@
    */
   match(matcher: {
     [Symbol.match](string: string): RegExpMatchArray | null;
   }): RegExpMatchArray | null;
-
   /**
    * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.
    * @param searchValue An object that supports searching for and replacing matches within a string.
    * @param replaceValue The replacement text.
@@ -247,12 +250,12 @@
   replace(
     searchValue: {
       [Symbol.replace](
         string: string,
-        replacer: (substring: string, ...args: any[]) => string,
+        replacer: (substring: string, ...rest: (string | number)[]) => string,
       ): string;
     },
-    replacer: (substring: string, ...args: any[]) => string,
+    replacer: (substring: string, ...rest: (string | number)[]) => string,
   ): string;
 
   /**
    * Finds the first substring match in a regular expression search.