@@ -317,13 +317,13 @@ interface String {
317
317
* Matches a string with a regular expression, and returns an array containing the results of that search.
318
318
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
319
319
*/
320
- match ( regexp : string ) : string [ ] ;
320
+ match ( regexp : string ) : RegExpMatchArray ;
321
321
322
322
/**
323
323
* Matches a string with a regular expression, and returns an array containing the results of that search.
324
324
* @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
325
325
*/
326
- match ( regexp : RegExp ) : string [ ] ;
326
+ match ( regexp : RegExp ) : RegExpMatchArray ;
327
327
328
328
/**
329
329
* Replaces text in a string, using a regular expression or search string.
@@ -790,39 +790,16 @@ declare var Date: {
790
790
now ( ) : number ;
791
791
}
792
792
793
- interface RegExpExecArray {
794
- [ index : number ] : string ;
795
- length : number ;
793
+ interface RegExpMatchArray extends Array < string > {
794
+ index ?: number ;
795
+ input ?: string ;
796
+ }
796
797
798
+ interface RegExpExecArray extends Array < string > {
797
799
index : number ;
798
800
input : string ;
799
-
800
- toString ( ) : string ;
801
- toLocaleString ( ) : string ;
802
- concat ( ...items : string [ ] [ ] ) : string [ ] ;
803
- join ( separator ?: string ) : string ;
804
- pop ( ) : string ;
805
- push ( ...items : string [ ] ) : number ;
806
- reverse ( ) : string [ ] ;
807
- shift ( ) : string ;
808
- slice ( start ?: number , end ?: number ) : string [ ] ;
809
- sort ( compareFn ?: ( a : string , b : string ) => number ) : string [ ] ;
810
- splice ( start : number ) : string [ ] ;
811
- splice ( start : number , deleteCount : number , ...items : string [ ] ) : string [ ] ;
812
- unshift ( ...items : string [ ] ) : number ;
813
-
814
- indexOf ( searchElement : string , fromIndex ?: number ) : number ;
815
- lastIndexOf ( searchElement : string , fromIndex ?: number ) : number ;
816
- every ( callbackfn : ( value : string , index : number , array : string [ ] ) => boolean , thisArg ?: any ) : boolean ;
817
- some ( callbackfn : ( value : string , index : number , array : string [ ] ) => boolean , thisArg ?: any ) : boolean ;
818
- forEach ( callbackfn : ( value : string , index : number , array : string [ ] ) => void , thisArg ?: any ) : void ;
819
- map ( callbackfn : ( value : string , index : number , array : string [ ] ) => any , thisArg ?: any ) : any [ ] ;
820
- filter ( callbackfn : ( value : string , index : number , array : string [ ] ) => boolean , thisArg ?: any ) : string [ ] ;
821
- reduce ( callbackfn : ( previousValue : any , currentValue : any , currentIndex : number , array : string [ ] ) => any , initialValue ?: any ) : any ;
822
- reduceRight ( callbackfn : ( previousValue : any , currentValue : any , currentIndex : number , array : string [ ] ) => any , initialValue ?: any ) : any ;
823
801
}
824
802
825
-
826
803
interface RegExp {
827
804
/**
828
805
* Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
0 commit comments