Add types for XRegExp union function to accept either string[] and RegExp[]

This commit is contained in:
Mateusz Jagiełło
2017-07-13 19:35:08 +02:00
parent 58a8cbc17e
commit 75b18ce853
2 changed files with 5 additions and 2 deletions
+3 -2
View File
@@ -2,6 +2,7 @@
// Project: http://xregexp.com
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>,
// Johannes Fahrenkrug <https://github.com/jfahrenkrug>
// Mateusz Jagiełło <https://github.com/sigo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -83,7 +84,7 @@ declare namespace OuterXRegExp {
function uninstall(options: Object): void;
function uninstall(options: string): void;
function union(patterns: string[], flags?: string): RegExp;
function union(patterns: string[] | RegExp[], flags?: string): RegExp;
var version: string;
// end API definitions
@@ -126,7 +127,7 @@ declare namespace OuterXRegExp {
function uninstall(options: Object): void;
function uninstall(options: string): void;
function union(patterns: string[], flags?: string): RegExp;
function union(patterns: string[] | RegExp[], flags?: string): RegExp;
var version: string;
// end API definitions
}
+2
View File
@@ -145,5 +145,7 @@ XRegExp.uninstall(str);
regex = XRegExp.union(strArr, flags);
regex = XRegExp.union(strArr);
regex = XRegExp.union(expArr, flags);
regex = XRegExp.union(expArr);
// -- -- -- -- -- -- -- -- -- -- -- -- --