-
Notifications
You must be signed in to change notification settings - Fork 0
/
unifiedtransform.d.ts
92 lines (79 loc) · 3.01 KB
/
unifiedtransform.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
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
declare module 'UnifiedTransform';
export class UnifiedTransform {
/**
* Specifies a 2D translation by the vector (tx, ty)
*
* @param {number|string} tx The number to be translated on the x-axis.
* @param {number|string} ty The number to be translated on the x-axis.
* @returns
*/
translate(tx: string | number, ty: string | number): UnifiedTransform;
/**
* Specifies a 2D scale operation by the (sx, sy) scaling vector described by the 2 parameters
*
* @param {number|string} sy The number to be scaled on the x-axis.
* @param {number|string} sy The number to be scaled on the y-axis.
* @returns
*/
scale(sx: string | number, sy?: string | number): UnifiedTransform;
/**
* Specifies a 2D rotation by the angle specified in the parameter about the origin of the element or optionally the given point (x, y)
*
* @param {number|string} angle The angle to rotate
* @param {number|string} x The x-coordinate of the point to be rotated around
* @param {number|string} y The y-coordinate of the point to be rotated around
* @returns
*/
rotate(angle: string | number, x: string | number, y: string | number): UnifiedTransform;
/**
* Specifies a 2D skew transformation along the X axis by the given angle.
*
* @param {number|string} degrees The skew angle
* @returns UnifiedTransform
*/
skewX(degrees: string | number): UnifiedTransform;
/**
* Specifies a 2D skew transformation along the Y axis by the given angle.
*
* @param {number|string} degrees The skew angle
* @returns UnifiedTransform
*/
skewY(degrees: string | number): UnifiedTransform;
/**
* Specifies a 2D transformation in the form of a transformation matrix
*
* @param {Array} m The matrix given as a one dimensional array
* @param {string} order The order format of the matrix, CSS, flat or 2D
* @returns UnifiedTransform
*/
applyMatrix(m: (number | string)[][] | (number | string)[], order: "2D" | "flat" | "CSS" = "CSS"): UnifiedTransform;
/**
* Parses a transform string and applies each transformation one after the other
*
* @param {string} str The CSS transform string
* @returns UnifiedTransform
*/
transform(str: string): UnifiedTransform;
/**
* Evaluates a point using the current transformation matrix
*
* @param {number} x
* @param {number} y
* @returns The transformed point
*/
eval(x: number, y: number): Array;
/**
* Gets the 3x3 transform matrix of the current homogeneous transformation
*
* @param {string} order The order of the returned matrix, CSS, flat or 2D
* @returns The current transform matrix
*/
toMatrix(order: "2D" | "flat" | "CSS" = "CSS"): Array;
/**
* Gets a CSS transform string to apply the current matrix
*
* @returns The transform string
*/
toTransformString(): string;
}
export default UnifiedTransform;