-
Notifications
You must be signed in to change notification settings - Fork 0
/
devtools-formatters.d.ts
56 lines (46 loc) · 1.53 KB
/
devtools-formatters.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
51
52
53
54
55
56
// See https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview
declare namespace BetterTypeScript {
type DevtoolsFormatterObjectConfig = Record<string | symbol, any>;
type DevtoolsFormatterElementTagName = (
| "div"
| "span"
| "ol"
| "li"
| "table"
| "tr"
| "td"
);
type DevtoolsFormatterElementTemplate = (
| DevtoolsFormatterStyledElementTemplate
| DevtoolsFormatterUnstyledElementTemplate
);
type DevtoolsFormatterStyledElementTemplate = readonly [
BetterTypeScript.DevtoolsFormatterElementTagName,
{
style?: string,
},
...BetterTypeScript.DevtoolsFormatterItem[],
];
type DevtoolsFormatterUnstyledElementTemplate = readonly [
BetterTypeScript.DevtoolsFormatterElementTagName,
...BetterTypeScript.DevtoolsFormatterItem[],
];
type DevtoolsFormatterObjectReference = readonly [
"object",
{
object: any,
config?: BetterTypeScript.DevtoolsFormatterObjectConfig,
},
];
type DevtoolsFormatterItem = (
| string
| BetterTypeScript.DevtoolsFormatterElementTemplate
| BetterTypeScript.DevtoolsFormatterObjectReference
);
interface DevtoolsFormatter {
header(object?: any, config?: BetterTypeScript.DevtoolsFormatterObjectConfig): BetterTypeScript.DevtoolsFormatterItem | null;
hasBody(object?: any, config?: BetterTypeScript.DevtoolsFormatterObjectConfig): boolean;
body(object?: any, config?: BetterTypeScript.DevtoolsFormatterObjectConfig): BetterTypeScript.DevtoolsFormatterItem;
}
}
declare var devtoolsFormatters: BetterTypeScript.DevtoolsFormatter[];