-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
50 lines (50 loc) · 1.26 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
/**
* `transformOrigin` property name with browser vendor prefix if needed.
*/
export declare const transformOriginProperty: string;
/**
* `transform` property name with browser vendor prefix if needed.
*/
export declare const transformProperty: string;
/**
* make html element scalable by mouse wheel
* @param el target html element
* @param options
*/
export default function Scalable(el: HTMLElement, options?: IOptions): {
reset: () => void;
destroy(): void;
};
/**
* get computed style of transform
* @param el target html element
*/
export declare function getTransform(el: HTMLElement): string[];
/**
* get computed style of transformOrigin
* @param el target html element
*/
export declare function getTransformOrigin(el: HTMLElement): number[];
export interface IOptions {
/**
* triggered when user scaling
* @param e event argument { scale: number }
*/
onScaleChange(e: {
scale: number;
}): void;
/**
* the max value that can be scaled up to.
* default to 10;
*/
maxScale?: number;
/**
* the min value that can be scaled down to.
* default to 1;
*/
minScale?: number;
/**
* if to take the mouse position as the transform origin.
*/
followMouse?: boolean;
}