forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
117 lines (96 loc) · 2.36 KB
/
index.d.ts
File metadata and controls
117 lines (96 loc) · 2.36 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
declare namespace Flow {
interface File {
document: Document;
settings: Settings;
schemaVersion: SchemaVersion;
}
interface Document {
id: string;
name: string;
type: Types["DOCUMENT"];
children: Page[];
}
interface Page extends Node {
type: Types["PAGE"];
children: Array<Screen | Image | Rectangle | Ellipse | Diamond>;
backgroundColor: Color;
startNodeID?: string | undefined;
}
interface Screen extends Graphic {
type: Types["SCREEN"];
children: Layer[];
connections?: Connection[] | undefined;
}
interface Image extends Graphic {
type: Types["IMAGE"];
connections?: Connection[] | undefined;
}
interface Rectangle extends Shape {
type: Types["RECTANGLE"];
}
interface Ellipse extends Shape {
type: Types["ELLIPSE"];
}
interface Diamond extends Shape {
type: Types["DIAMOND"];
}
interface Layer extends Node {
type: Types["LAYER"] | Types["HOTSPOT"];
position: Point;
size: Size;
connections?: Connection[] | undefined;
}
interface Connection {
nodeID: string;
}
interface Settings {
grid?: [number, number] | undefined;
}
interface Color {
r: number;
g: number;
b: number;
a: number;
}
interface FileAsset {
fileName: string;
dirPath: string;
}
type URLAsset = string;
interface Point {
x: number;
y: number;
}
interface Size {
h: number;
w: number;
}
interface Types {
DOCUMENT: "DOCUMENT";
PAGE: "PAGE";
SCREEN: "SCREEN";
IMAGE: "IMAGE";
RECTANGLE: "RECT";
ELLIPSE: "ELLIPSE";
DIAMOND: "DIAMOND";
HOTSPOT: "HOTSPOT";
LAYER: "LAYER";
}
type SchemaVersion = 1;
}
type NodeType = "DOCUMENT" | "PAGE" | "SCREEN" | "IMAGE" | "RECT" | "ELLIPSE" | "DIAMOND" | "HOTSPOT" | "LAYER";
interface Node {
id: string;
name: string;
type: NodeType;
}
interface Shape extends Node {
position: Flow.Point;
size: Flow.Size;
connections?: Flow.Connection[] | undefined;
}
interface Graphic extends Node {
position: Flow.Point;
size: Flow.Size;
source: Flow.FileAsset | Flow.URLAsset;
}