Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/ansi-regex/index.d.ts
1126 views
1
declare namespace ansiRegex {
2
interface Options {
3
/**
4
Match only the first ANSI escape.
5
6
@default false
7
*/
8
onlyFirst: boolean;
9
}
10
}
11
12
/**
13
Regular expression for matching ANSI escape codes.
14
15
@example
16
```
17
import ansiRegex = require('ansi-regex');
18
19
ansiRegex().test('\u001B[4mcake\u001B[0m');
20
//=> true
21
22
ansiRegex().test('cake');
23
//=> false
24
25
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
26
//=> ['\u001B[4m', '\u001B[0m']
27
28
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
29
//=> ['\u001B[4m']
30
31
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
32
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
33
```
34
*/
35
declare function ansiRegex(options?: ansiRegex.Options): RegExp;
36
37
export = ansiRegex;
38
39