interface StringReplacerFn { (match : string, offset : number, string : string) : T } interface RegExpReplacerFn { // Full signature: match, p1, p2, ..., pN, offset, string (match : string, ...args : any[]) : T } declare function stringReplaceToArray(string : string, pattern : string, replacer : StringReplacerFn | T) : (T | string)[] declare function stringReplaceToArray(string : string, pattern : RegExp, replacer : RegExpReplacerFn | T) : (T | string)[] export default stringReplaceToArray