-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.d.ts
61 lines (51 loc) · 1.2 KB
/
index.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
57
58
59
60
61
declare module 'dotparser' {
export type CompassPt = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
export type Stmt = AttrStmt | EdgeStmt | NodeStmt | Subgraph;
export interface Port {
type: 'port';
id: string | number;
compass_pt?: CompassPt;
}
export interface NodeId {
type: 'node_id';
id: string | number;
port?: Port;
}
export interface HTMLString {
type: 'id';
value: 'string';
html: true;
}
export interface Attr {
type: 'attr';
id: string | number;
eq: string | HTMLString;
}
export interface Subgraph {
type: 'subgraph';
children: Stmt[];
id?: string | number;
}
export interface AttrStmt {
type: 'attr_stmt';
target: 'graph' | 'node' | 'edge';
attr_list: Attr[];
}
export interface EdgeStmt {
type: 'edge_stmt';
edge_list: (Subgraph | NodeId)[];
attr_list: Attr[];
}
export interface NodeStmt {
type: 'node_stmt';
node_id: NodeId;
attr_list: Attr[];
}
export interface Graph {
type: 'graph' | 'digraph';
children: Stmt[];
strict?: boolean;
id?: string | number;
}
export default function parse(input: string, options?: Record<string, any>): Graph[];
}