forked from uhop/node-re2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
re2.d.ts
50 lines (39 loc) · 1.32 KB
/
re2.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
declare module 're2' {
interface RE2MatchArray<K> extends Array<K> {
index?: number;
input?: K;
0: string;
groups?: {
[key: string]: string
}
}
interface RE2ExecArray<K> extends Array<K> {
index: number;
input: K;
0: string;
groups?: {
[key: string]: string
}
}
interface RE2 extends RegExp {
exec<K extends String | Buffer>(str: K): RE2ExecArray<K> | null;
test(str: string | Buffer): boolean;
match<K extends String | Buffer>(str: K): RE2MatchArray<K> | null;
replace<K extends String | Buffer>(str: K, replaceValue: string | Buffer): K;
replace<K extends String | Buffer>(str: K, replacer: (substring: string, ...args: any[]) => string | Buffer): K;
search(str: string | Buffer): number;
split<K extends String | Buffer>(str: K, limit?: number): K[];
}
interface RE2Constructor extends RegExpConstructor {
new(pattern: Buffer | RegExp | string): RE2;
new(pattern: Buffer | string, flags?: string): RE2;
(pattern: Buffer | RegExp | string): RE2;
(pattern: Buffer | string, flags?: string): RE2;
readonly prototype: RE2;
unicodeWarningLevel: 'nothing' | 'warnOnce' | 'warn' | 'throw';
getUtf8Length(value: string): number;
getUtf16Length(value: Buffer): number;
}
var RE2: RE2Constructor;
export = RE2;
}