main
js 270 lines 5.55 KB
Raw
1 // flow-typed signature: c29a716c1825927cdfc3ad29fe929754
2 // flow-typed version: 52ab99c6db/geometry/flow_>=v0.261.x
3
4 // https://www.w3.org/TR/geometry-1/
5
6 type DOMMatrix2DInit =
7 | {|
8 a: number,
9 b: number,
10 c: number,
11 d: number,
12 e: number,
13 f: number,
14 |}
15 | {|
16 m11: number,
17 m12: number,
18 m21: number,
19 m22: number,
20 m41: number,
21 m42: number,
22 |};
23
24 type DOMMatrixInit =
25 | {|
26 ...DOMMatrix2DInit,
27 is2D: true,
28 |}
29 | {|
30 ...DOMMatrix2DInit,
31 is2D: false,
32 m13: number,
33 m14: number,
34 m23: number,
35 m24: number,
36 m31: number,
37 m32: number,
38 m33: number,
39 m34: number,
40 m43: number,
41 m44: number,
42 |};
43
44 type DOMPointInit = {|
45 w: number,
46 x: number,
47 y: number,
48 z: number,
49 |};
50
51 type DOMQuadInit = {|
52 p1: DOMPointInit,
53 p2: DOMPointInit,
54 p3: DOMPointInit,
55 p4: DOMPointInit,
56 |};
57
58 type DOMRectInit = {|
59 height: number,
60 width: number,
61 x: number,
62 y: number,
63 |};
64
65 declare class DOMMatrix extends DOMMatrixReadOnly {
66 a: number;
67 b: number;
68 c: number;
69 d: number;
70 e: number;
71 f: number;
72 m11: number;
73 m12: number;
74 m13: number;
75 m14: number;
76 m21: number;
77 m22: number;
78 m23: number;
79 m24: number;
80 m31: number;
81 m32: number;
82 m33: number;
83 m34: number;
84 m41: number;
85 m42: number;
86 m43: number;
87 m44: number;
88
89 static fromFloat32Array(array32: Float32Array): DOMMatrix;
90 static fromFloat64Array(array64: Float64Array): DOMMatrix;
91 static fromMatrix(other?: DOMMatrixInit): DOMMatrix;
92
93 constructor(init?: string | Array<number>): void;
94 invertSelf(): DOMMatrix;
95 multiplySelf(other?: DOMMatrixInit): DOMMatrix;
96 preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;
97 rotateAxisAngleSelf(
98 x?: number,
99 y?: number,
100 z?: number,
101 angle?: number
102 ): DOMMatrix;
103 rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;
104 rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
105 scale3dSelf(
106 scale?: number,
107 originX?: number,
108 originY?: number,
109 originZ?: number
110 ): DOMMatrix;
111 scaleSelf(
112 scaleX?: number,
113 scaleY?: number,
114 scaleZ?: number,
115 originX?: number,
116 originY?: number,
117 originZ?: number
118 ): DOMMatrix;
119 setMatrixValue(transformList: string): DOMMatrix;
120 skewXSelf(sx?: number): DOMMatrix;
121 skewYSelf(sy?: number): DOMMatrix;
122 translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;
123 }
124
125 declare class DOMMatrixReadOnly {
126 +a: number;
127 +b: number;
128 +c: number;
129 +d: number;
130 +e: number;
131 +f: number;
132 +is2D: boolean;
133 +isIdentity: boolean;
134 +m11: number;
135 +m12: number;
136 +m13: number;
137 +m14: number;
138 +m21: number;
139 +m22: number;
140 +m23: number;
141 +m24: number;
142 +m31: number;
143 +m32: number;
144 +m33: number;
145 +m34: number;
146 +m41: number;
147 +m42: number;
148 +m43: number;
149 +m44: number;
150
151 static fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;
152 static fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;
153 static fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;
154
155 constructor(init?: string | Array<number>): void;
156 flipX(): DOMMatrix;
157 flipY(): DOMMatrix;
158 inverse(): DOMMatrix;
159 multiply(other?: DOMMatrixInit): DOMMatrix;
160 rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
161 rotateAxisAngle(
162 x?: number,
163 y?: number,
164 z?: number,
165 angle?: number
166 ): DOMMatrix;
167 rotateFromVector(x?: number, y?: number): DOMMatrix;
168 scale(
169 scaleX?: number,
170 scaleY?: number,
171 scaleZ?: number,
172 originX?: number,
173 originY?: number,
174 originZ?: number
175 ): DOMMatrix;
176 scale3d(
177 scale?: number,
178 originX?: number,
179 originY?: number,
180 originZ?: number
181 ): DOMMatrix;
182 scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
183 skewX(sx?: number): DOMMatrix;
184 skewY(sy?: number): DOMMatrix;
185 toFloat32Array(): Float32Array;
186 toFloat64Array(): Float64Array;
187 toJSON(): Object;
188 transformPoint(point?: DOMPointInit): DOMPoint;
189 translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
190 toString(): string;
191 }
192
193 declare class DOMPoint extends DOMPointReadOnly {
194 w: number;
195 x: number;
196 y: number;
197 z: number;
198
199 static fromPoint(other?: DOMPointInit): DOMPoint;
200
201 constructor(x?: number, y?: number, z?: number, w?: number): void;
202 }
203
204 declare class DOMPointReadOnly {
205 +w: number;
206 +x: number;
207 +y: number;
208 +z: number;
209
210 static fromPoint(other?: DOMPointInit): DOMPointReadOnly;
211
212 constructor(x?: number, y?: number, z?: number, w?: number): void;
213 matrixTransform(matrix?: DOMMatrixInit): DOMPoint;
214 toJSON(): Object;
215 }
216
217 declare class DOMQuad {
218 +p1: DOMPoint;
219 +p2: DOMPoint;
220 +p3: DOMPoint;
221 +p4: DOMPoint;
222
223 static fromQuad(other?: DOMQuadInit): DOMQuad;
224 static fromRect(other?: DOMRectInit): DOMQuad;
225
226 constructor(
227 p1?: DOMPointInit,
228 p2?: DOMPointInit,
229 p3?: DOMPointInit,
230 p4?: DOMPointInit
231 ): void;
232 getBounds(): DOMRect;
233 toJSON(): Object;
234 }
235
236 declare class DOMRect extends DOMRectReadOnly {
237 height: number;
238 width: number;
239 x: number;
240 y: number;
241
242 constructor(x?: number, y?: number, width?: number, height?: number): void;
243
244 static fromRect(other?: DOMRectInit): DOMRect;
245 }
246
247 declare class DOMRectList {
248 +length: number;
249
250 @@iterator(): Iterator<DOMRect>;
251
252 item(index: number): DOMRect;
253 [index: number]: DOMRect;
254 }
255
256 declare class DOMRectReadOnly {
257 +bottom: number;
258 +height: number;
259 +left: number;
260 +right: number;
261 +top: number;
262 +width: number;
263 +x: number;
264 +y: number;
265
266 constructor(x?: number, y?: number, width?: number, height?: number): void;
267
268 static fromRect(other?: DOMRectInit): DOMRectReadOnly;
269 toJSON(): Object;
270 }