forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
velocity-animate.d.ts
99 lines (85 loc) · 3.18 KB
/
velocity-animate.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
93
94
95
96
97
98
99
// Type definitions for Velocity 1.2.2
// Project: http://velocityjs.org/
// Definitions by: Greg Smith <https://github.com/smrq/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface JQuery {
velocity(name: string, options: jquery.velocity.RegisteredEffectOptions): JQuery;
velocity(options: {properties: jquery.velocity.Properties; options: jquery.velocity.Options}): JQuery;
velocity(properties: jquery.velocity.Properties, options: jquery.velocity.Options): JQuery;
velocity(properties: jquery.velocity.Properties, duration: number, easing: jquery.velocity.Easing, complete?: jquery.velocity.ElementCallback): JQuery;
velocity(properties: jquery.velocity.Properties, duration: number, complete?: jquery.velocity.ElementCallback): JQuery;
velocity(properties: jquery.velocity.Properties, easing: jquery.velocity.Easing, complete?: jquery.velocity.ElementCallback): JQuery;
velocity(properties: jquery.velocity.Properties, complete?: jquery.velocity.ElementCallback): JQuery;
}
interface JQueryStatic {
Velocity: jquery.velocity.VelocityStatic;
}
declare module jquery.velocity {
type Properties = Object;
type Easing = string|number[];
type ElementCallback = (elements: NodeListOf<HTMLElement>) => void;
type ProgressCallback = (elements: NodeListOf<HTMLElement>, percentComplete: number, timeRemaining: number, timeStart: number) => void;
type EffectCall =
[Properties] |
[Properties, number] |
[Properties, EffectCallOptions] |
[Properties, number, EffectCallOptions];
interface EffectCallOptions {
delay?: any;
easing?: any;
}
interface CommonOptions {
duration?: string|number;
begin?: ElementCallback;
complete?: ElementCallback;
display?: string|boolean;
delay?: number|boolean;
mobileHA?: boolean;
_cacheValues?: boolean;
container?: JQuery;
axis?: string;
offset?: number;
}
interface Options extends CommonOptions {
queue?: string|boolean;
easing?: Easing;
progress?: ProgressCallback;
loop?: number|boolean;
}
interface RegisterEffectOptions {
defaultDuration?: number;
calls: EffectCall[];
reset?: Object;
}
interface RegisteredEffectOptions extends CommonOptions {
stagger?: number;
drag?: boolean;
backwards?: boolean;
}
interface SequenceCall {
e: HTMLElement|JQuery;
p: Properties;
o: SequenceOptions;
}
interface SequenceOptions extends Options {
sequenceQueue?: boolean;
}
interface VelocityStatic {
Sequences: any;
animate(options: {elements: NodeListOf<HTMLElement>; properties: Properties; options: Options}): any;
animate(elements: HTMLElement|NodeListOf<HTMLElement>, properties: Properties, options: Options): any;
RegisterEffect(name: string, options: RegisterEffectOptions): VelocityStatic;
RunSequence(sequence: SequenceCall[]): VelocityStatic;
/**
* Get a hook value. Hooks are the subvalues of multi-value CSS properties.
* It features the same API as $.css().
*/
hook(element: HTMLElement|JQuery, cssKey: string): string;
/**
* Set a hook value. Hooks are the subvalues of multi-value CSS properties.
* It features the same API as $.css().
*/
hook(element: HTMLElement|JQuery, cssKey: string, cssValue: string): void;
}
}