/
ansi_up.d.ts
46 lines (46 loc) · 1.23 KB
/
ansi_up.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
export interface AU_Color {
rgb: number[];
class_name: string;
}
export interface TextWithAttr {
fg: AU_Color;
bg: AU_Color;
bold: boolean;
text: string;
}
export interface Formatter {
transform(fragment: TextWithAttr, instance: AnsiUp): any;
compose(segments: any[], instance: AnsiUp): any;
}
declare function rgx(tmplObj: any, ...subst: any[]): RegExp;
export default class AnsiUp {
VERSION: string;
ansi_colors: {
rgb: number[];
class_name: string;
}[][];
htmlFormatter: Formatter;
textFormatter: Formatter;
private palette_256;
private fg;
private bg;
private bold;
private _use_classes;
private _escape_for_html;
private _sgr_regex;
private _buffer;
constructor();
use_classes: boolean;
escape_for_html: boolean;
private setup_256_palette();
private old_escape_for_html(txt);
private old_linkify(txt);
private detect_incomplete_ansi(txt);
private detect_incomplete_link(txt);
ansi_to(txt: string, formatter: Formatter): any;
ansi_to_html(txt: string): string;
ansi_to_text(txt: string): string;
private with_state(text);
private handle_incomplete_sequences(chunks);
private process_ansi(block);
}