-
-
Notifications
You must be signed in to change notification settings - Fork 958
/
Copy pathtypes.ts
84 lines (76 loc) · 1.3 KB
/
types.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
export interface GetSet<Type, This> {
(): Type;
(v: Type | null | undefined): This;
}
export interface Vector2d {
x: number;
y: number;
}
export interface PathSegment {
command:
| 'm'
| 'M'
| 'l'
| 'L'
| 'v'
| 'V'
| 'h'
| 'H'
| 'z'
| 'Z'
| 'c'
| 'C'
| 'q'
| 'Q'
| 't'
| 'T'
| 's'
| 'S'
| 'a'
| 'A';
start: Vector2d;
points: number[];
pathLength: number;
}
export interface IRect {
x: number;
y: number;
width: number;
height: number;
}
export interface IFrame {
time: number;
timeDiff: number;
lastTime: number;
frameRate: number;
}
export type AnimationFn = (frame?: IFrame) => boolean | void;
export enum KonvaNodeEvent {
mouseover = 'mouseover',
mouseout = 'mouseout',
mousemove = 'mousemove',
mouseleave = 'mouseleave',
mouseenter = 'mouseenter',
mousedown = 'mousedown',
mouseup = 'mouseup',
wheel = 'wheel',
contextmenu = 'contextmenu',
click = 'click',
dblclick = 'dblclick',
touchstart = 'touchstart',
touchmove = 'touchmove',
touchend = 'touchend',
tap = 'tap',
dbltap = 'dbltap',
dragstart = 'dragstart',
dragmove = 'dragmove',
dragend = 'dragend',
}
export interface RGB {
r: number;
g: number;
b: number;
}
export interface RGBA extends RGB {
a: number;
}