-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathutils.d.ts
88 lines (86 loc) · 3.97 KB
/
utils.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
/** Parse url query GET parameters */
export const parseUrlQuery: (url: string) => object;
/** Create a serialized representation of a plain object suitable for use in a URL query string */
export const serializeObject: (obj: object) => string;
/** Cross-browser implementation on requestAnimationFrame */
export const requestAnimationFrame: (callback: Function) => number;
/** Cancels an animation frame request */
export const cancelAnimationFrame: (requestID: number) => void;
/** Executes code on next available animation frame */
export const nextFrame: (callback: Function) => number;
/** executes code after required delay. Basically alias for setTimeout */
export const nextTick: (callback: Function, timeout: number) => number;
/** Returns current timestamp in ms */
export const now: () => number;
/** Extends target object with properties and methods from from objects */
export const extend: (target: object, ...from: object[]) => object;
/** Extends target object with properties and methods from from objects */
export const merge: (target: object, ...from: object[]) => object;
/** Returns unique number, increased by 1 with every call */
export const uniqueNumber: () => number;
/** Generates random ID-like string */
export const id: (mask: string, map: string) => string;
/** Returns preloader inner content for MD theme */
export const mdPreloaderContent: () => string;
/** Returns preloader inner content for iOS theme */
export const iosPreloaderContent: () => string;
/** Deletes object properties */
export const deleteProps: (obj: object) => void;
/** */
export const colorHexToRgb: (hex: string) => number[];
/** */
export const colorRgbToHex: (r: number, g: number, b: number) => string;
/** */
export const colorRgbToHsl: (r: number, g: number, b: number) => number[];
/** */
export const colorHslToRgb: (h: number, s: number, l: number) => number[];
/** */
export const colorHsbToHsl: (h: number, s: number, b: number) => number[];
/** */
export const colorHslToHsb: (h: number, s: number, l: number) => number[];
/** */
export const bindMethods: (target: any, obj: any) => any;
export interface Utils {
/** Parse url query GET parameters */
parseUrlQuery: (url: string) => object;
/** Create a serialized representation of a plain object suitable for use in a URL query string */
serializeObject: (obj: object) => string;
/** Cross-browser implementation on requestAnimationFrame */
requestAnimationFrame: (callback: Function) => number;
/** Cancels an animation frame request */
cancelAnimationFrame: (requestID: number) => void;
/** Executes code on next available animation frame */
nextFrame: (callback: Function) => number;
/** executes code after required delay. Basically alias for setTimeout */
nextTick: (callback: Function, timeout: number) => number;
/** Returns current timestamp in ms */
now: () => number;
/** Extends target object with properties and methods from from objects */
extend: (target: object, ...from: object[]) => object;
/** Extends target object with properties and methods from from objects */
merge: (target: object, ...from: object[]) => object;
/** Returns unique number, increased by 1 with every call */
uniqueNumber: () => number;
/** Generates random ID-like string */
id: (mask: string, map: string) => string;
/** Returns preloader inner content for MD theme */
mdPreloaderContent: () => string;
/** Returns preloader inner content for iOS theme */
iosPreloaderContent: () => string;
/** Deletes object properties */
deleteProps: (obj: object) => void;
/** */
colorHexToRgb: (hex: string) => number[];
/** */
colorRgbToHex: (r: number, g: number, b: number) => string;
/** */
colorRgbToHsl: (r: number, g: number, b: number) => number[];
/** */
colorHslToRgb: (h: number, s: number, l: number) => number[];
/** */
colorHsbToHsl: (h: number, s: number, b: number) => number[];
/** */
colorHslToHsb: (h: number, s: number, l: number) => number[];
/** */
bindMethods: (target: any, obj: any) => any;
}