-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
velocity.d.ts
1623 lines (1438 loc) · 46.7 KB
/
velocity.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* velocity-animate (C) 2014-2018 Julian Shapiro.
*
* Licensed under the MIT license. See LICENSE file in the project root for details.
*
* Velocity typings.
*/
/**************
* Interfaces *
**************/
/**
* A single animation for a single element. This extends the strict options (ie,
* after processing) to allow per-element options. Anything that is shared
* between all elements in an animation will be under the `options` member.
*/
export interface AnimationCall extends StrictVelocityOptions {
/**
* Used to store the next AnimationCell in this list.
*
* @private
*/
_next?: AnimationCall;
/**
* Used to store the previous AnimationCell in this list. Used to make
* removing items from the list significantly easier.
*
* @private
*/
_prev?: AnimationCall;
/**
* A number of flags for use in tracking an animation.
*/
_flags: number;
/**
* Properties to be tweened
*/
tweens?: {[property: string]: VelocityTween};
/**
* The current value for the "tween" property, defaults to a percentage if
* not used.
*/
tween?: string;
/**
* The element this specific animation is for. If there is more than one in
* the elements list then this will be duplicated when it is pulled off a
* queue.
*/
element?: HTMLorSVGElement;
/**
* The list of elements associated with this specific animation.
* TODO: This should be removed so we're not trying to lock an element.
* Without this entry, any removed elements will simply not exist in Data
* (a WeakMap) and then can be removed from the list of animations.
* @deprecated
*/
elements?: VelocityResult;
/**
* Shared options for the entire set of elements.
*/
options?: StrictVelocityOptions;
/**
* The time this animation started according to whichever clock we are
* using.
*/
timeStart?: number;
/**
* The time (in ms) that this animation has already run. Used with the
* duration and easing to provide the exact tween needed.
*/
ellapsedTime?: number;
/**
* The percentage complete as a number 0 <= n <= 1
*/
percentComplete?: number;
}
/**
* AnimationFlags are used internally. These are subject to change as they are
* only valid for the internal state of the current version of Velocity.
*
* To get these values use the "option" action with a key of "isReady" etc. All
* of these are gettable with the same pattern of keyname.
*
* @private
*/
export declare const enum AnimationFlags {
/**
* When the tweens are expanded this is set to save future processing.
*/
EXPANDED = 1 << 0, // tslint:disable-line:no-bitwise
/**
* Set once the animation is ready to start - after any delay (and possible
* pause).
*/
READY = 1 << 1, // tslint:disable-line:no-bitwise
/**
* Set once the animation has started.
*/
STARTED = 1 << 2, // tslint:disable-line:no-bitwise
/**
* Set when an animation is manually stopped.
*/
STOPPED = 1 << 3, // tslint:disable-line:no-bitwise
/**
* The pause state of this animation. If true it is paused, if false it was
* paused and needs to be resumed, and if undefined / null then not either.
*/
PAUSED = 1 << 4, // tslint:disable-line:no-bitwise
/**
* Set when the animation is a sync animation.
*/
SYNC = 1 << 5, // tslint:disable-line:no-bitwise
/**
* When the animation is running in reverse, such as for a loop.
*/
REVERSE = 1 << 6, // tslint:disable-line:no-bitwise
}
/**
* Global per-Element data. This is persistent between animations, and freed
* when the garbage collector removes the Element because it is no longer being
* used.
*/
export interface ElementData {
/**
* A generated enum of types of this element, used for Normalizations.
*/
types: number;
/**
* A local cache of the current style values we're using, this is 80x faster
* than <code>element.style</code> access.
*
* Empty strings are set to null to get the value from getComputedStyle
* instead. If getComputedStyle returns an empty string then that is saved.
*/
cache: Properties<string>;
/**
* A cached copy of getComputedStyle, this is 50% the speed of
* <code>element.style</code> access.
*/
computedStyle?: CSSStyleDeclaration;
/**
* Changed as animations start and finish on an element. This allows us to
* keep track of exactly how many are running at a given time.
*/
count: number;
/**
* Animations to be run for each queue. The animations are linked lists,
* but treated as a FIFO queue (new ones are added to the end). When the
* queue is empty (but still running) the key will still exist with a value
* of "null". When the queue is empty and the next entry is pulled from it
* then it will be set to "undefined".
*
* The default queue is an empty string - ""
*/
queueList: {[name: string]: AnimationCall};
/**
* Last properties tweened per each queue. Used for both "reverse" and
* "repeat" methods.
*/
lastAnimationList: {[name: string]: AnimationCall};
/**
* The time the last animation on an element finished. This is used for
* starting a new animation and making sure it follows directly if possible,
* otherwise it will start as if one frame in already.
*/
lastFinishList: {[name: string]: number};
/**
* The window used for this element.
*/
window: Window;
}
/**
* Internal Sequence property value.
*/
export interface Sequence extends ReadonlyArray<TweenStep> {
/**
* Pattern to use for tweening.
*/
pattern: ReadonlyArray<string | boolean>;
/**
* Step value.
*/
[index: number]: TweenStep;
}
export interface SequenceList {
duration: number;
tweens: Properties<Sequence>;
}
/**
* After correcting the options so they are usable internally, they will be of
* this type. The base VelocityOptions includes human readable and shortcuts,
* which this doesn't.
*/
export interface StrictVelocityOptions extends VelocityOptions, VelocityPromise {
/**
* Begin handler. Only the first element to check this callback gets to use
* it. Cleared after calling
*
* @private
*/
begin?: VelocityCallbackFn;
/**
* Complete handler (only the last element in a set gets this)
*
* @private
*/
complete?: VelocityCallbackFn;
/**
* The amount of delay before this animation can start doing anything.
*/
delay?: number;
/**
* The length of time this animation will run for.
*/
duration?: number;
/**
* Easing for this animation while running.
*/
easing?: VelocityEasingFn;
/**
* Loop, calls 2n-1 times reversing it each iteration
*/
loop?: true | number;
/**
* TODO: Remove this so it's a normal property
*/
mobileHA?: boolean;
/**
* Progress handler (only the last element in a set gets this)
*
* @private
*/
progress?: VelocityProgressFn;
/**
* Queue
*/
queue?: false | string;
/**
* Repeat this number of times. If looped then each iteration of the loop
* is actually repeated this number of times.
*/
repeat?: true | number;
/**
* This is a cache of the repeat value. When looping and repeating work
* together, the repeat is looped, so it needs to remember how many repeats
* to perform for each loop.
*/
repeatAgain?: true | number;
/**
* The first AnimationCall to get this - used for the progress callback.
*
* @private
*/
_first?: AnimationCall;
/**
* The total number of AnimationCalls that are pointing at this.
*
* @private
*/
_total?: number;
/**
* The number of AnimationCalls that are ready to start.
*
* @private
*/
_ready?: number;
/**
* The number of AnimationCalls that have started.
*
* @private
*/
_started?: number;
/**
* The number of AnimationCalls that have finished.
*
* @private
*/
_completed?: number;
}
/**
* Internal list of values for a single Sequence data point.
*/
export interface TweenStep extends ReadonlyArray<string | number> {
/**
* Percent of animation.
*/
percent?: number;
/**
* Easing function.
*/
easing?: VelocityEasingFn | null;
/**
* Values to tween and insert into pattern.
*/
[index: number]: string | number;
}
/**
* Direct Velocity access.
*/
export interface Velocity<T = VelocityElements> {
/**
* Available to be able to check what version you're running against.
*/
readonly version: string;
/**
* Velocity option defaults, which can be overriden by the user.
*/
readonly defaults: VelocityOptions & {
/**
* Provided in order to reset Velocity defaults back to their initial
* state.
*/
readonly reset: () => void;
};
/**
* Current internal state of Velocity.
*/
readonly State: VelocityState;
/**
* Actions cannot be replaced if they are internal (hasOwnProperty is false
* but they still exist). Otherwise they can be replaced by users.
*
* All external method calls should be using actions rather than sub-calls
* of Velocity itself.
*/
readonly Actions: {[name: string]: VelocityActionFn};
/**
* Our known easing functions.
*/
readonly Easings: {[name: string]: VelocityEasingFn};
/**
* The currently registered sequences.
*/
readonly Sequences: {[name: string]: SequenceList};
/**
* Used to patch any object to allow Velocity chaining. In order to chain an
* object must either be treatable as an array - with a <code>.length</code>
* property, and each member a Node, or a Node directly.
*
* By default Velocity will try to patch <code>window</code>,
* <code>jQuery</code>, <code>Zepto</code>, and several classes that return
* Nodes or lists of Nodes.
*/
patch(proto: any, global?: boolean): void;
/**
* Set to true, 1 or 2 (most verbose) to output debug info to console.
*/
debug: boolean | 1 | 2;
/**
* In mock mode, all animations are forced to complete immediately upon the
* next rAF tick. If there are further animations queued then they will each
* take one single frame in turn. Loops and repeats will be disabled while
* <code>mock = true</code>.
*/
mock: boolean;
/********************
* Calling Velocity *
********************/
/**
* Finish the running animations on the elements selected.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param queue The queue to finish.
* @param finishAll Should this stop all queued animations too?
*/
(elements: T, action: "finish", queue?: string | false, finishAll?: true): VelocityResult;
/**
* Finish the running animations on the elements selected.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param finishAll Should this stop all queued animations too?
*/
(elements: T, action: "finish", finishAll?: true): VelocityResult;
/**
* Finish the running animations on this VelocityResult or on the elements
* selected.
*
* @param queue The queue to finish.
* @param finishAll Should this stop all queued animations too?
*/
(this: T, action: "finish", queue?: string | false, finishAll?: true): VelocityResult;
/**
* Finish the running animations on this VelocityResult or on the elements
* selected.
*
* @param finishAll Should this stop all queued animations too?
*/
(this: T, action: "finish", finishAll?: true): VelocityResult;
/**
* Finish any running animations.
*
* @param queue The queue to finish.
* @param finishAll Should this stop all queued animations too?
*/
(action: "finish", queue?: string | false, finishAll?: true): VelocityResult;
/**
* Finish any running animations.
*
* @param finishAll Should this stop all queued animations too?
*/
(action: "finish", finishAll?: true): VelocityResult;
/**
* Check if there is a normalisation handler for the named type of `Element`
* and the named property.
*/
(this: T, action: "hasNormalization", constructor: {new: () => Element} | string, name: string): boolean;
/**
* Set the value of an option on a running animation. This performs some
* validation on the named option as only some are available to set at
* runtime.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param option The name of the option to get.
* @param value The value to set it to.
*/
(elements: T, action: "option", option: string, value: any): VelocityResult;
/**
* Get the value of an option on a running animation.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param option The name of the option to get.
*/
(elements: T, action: "option", option: string): any;
/**
* Set the value of an option on a running animation. This performs some
* validation on the named option as only some are available to set at
* runtime.
*
* @param option The name of the option to get.
* @param value The value to set it to.
*/
(this: T, action: "option", option: string, value: any): VelocityResult;
/**
* Get the value of an option on a running animation.
*
* @param option The name of the option to get.
*/
(this: T, action: "option", option: string): any;
/**
* Pause a currently running animation.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param queue The name of the queue to pause on it.
*/
(elements: T, action: "pause", queue?: string): VelocityResult;
/**
* Pause a currently running animation.
*
* @param queue The name of the queue to pause on it.
*/
(this: T, action: "pause", queue?: string): VelocityResult;
/**
* Pause all currently running animations.
*
* @param queue The name of the queue to pause on them.
*/
(action: "pause", queue?: string): VelocityResult;
/**
* Resume a currently paused animation.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param queue The name of the queue to resume on it.
*/
(elements: T, action: "resume", queue?: string): VelocityResult;
/**
* Resume a currently paused animation.
*
* @param queue The name of the queue to resume on it.
*/
(this: T, action: "resume", queue?: string): VelocityResult;
/**
* Resume all currently paused animations.
*
* @param queue The name of the queue to resume on them.
*/
(action: "resume", queue?: string): VelocityResult;
/**
* Register a new easing handler.
*
* @param name The name of the easing to add.
* @param easing The function to call when this easing is used.
*/
(action: "registerEasing", name: string, easing: VelocityEasingFn): void;
/**
* Register a new normalization handler. This is the interface between
* Velocity and the actual properties, so is responsible for reading and
* writing any values on the `Element`.
*
* @param constructor The type of `Element`. If using ia string it will work
* across iframe boundaries.
* @param name The name of the property to provide.
* @param normalization The function to call whenever this property is
* accessed.
* @param unit An optional unit string to add to any numeric values passed.
* @param cache Set to false to prevent this property from being cached.
*/
(action: "registerNormalization", constructor: {new: () => Element} | string, name: string, normalization: VelocityNormalizationsFn, unit?: string, cache?: boolean): void;
/**
* Register a new normalization handler. This is the interface between
* Velocity and the actual properties, so is responsible for reading and
* writing any values on the `Element`.
*
* @param constructor The type of `Element`. If using ia string it will work
* across iframe boundaries.
* @param name The name of the property to provide.
* @param normalization The function to call whenever this property is
* accessed.
* @param cache Set to false to prevent this property from being cached.
*/
(action: "registerNormalization", constructor: {new: () => Element} | string, name: string, normalization: VelocityNormalizationsFn, cache?: boolean): void;
/**
* Register a named animation sequence to be used elsewhere.
*
* @param name The sequence name.
* @param sequence The animation steps to perform.
*/
(action: "registerSequence", name: string, sequence: VelocitySequence): void;
/**
* Register a named animation sequence to be used elsewhere.
*
* @param sequences Multiple named sequences to add.
*/
(action: "registerSequence", sequences: {[name: string]: VelocitySequence}): void;
/**
* Reverse the most recent animations on the supplied elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
*/
(elements: T, action: "reverse", complete?: () => void): VelocityResult;
/**
* Reverse the most recent animations on the supplied elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param duration How long the animation should run in ms.
* @param complete A function to call when finished.
*/
(elements: T, action: "reverse", duration?: number | "fast" | "normal" | "slow", complete?: () => void): VelocityResult;
/**
* Reverse the most recent animations on the supplied elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param duration How long the animation should run in ms.
* @param easing The default easing to apply.
* @param complete A function to call when finished.
*/
(elements: T, action: "reverse", duration?: number | "fast" | "normal" | "slow", easing?: string | number[], complete?: () => void): VelocityResult;
/**
* Reverse the most recent animations on the supplied elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param easing The default easing to apply.
* @param complete A function to call when finished.
*/
(elements: T, action: "reverse", easing?: string | number[], complete?: () => void): VelocityResult;
/**
* Reverse the most recent animations on the supplied elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param options The options to apply.
*/
(elements: T, action: "reverse", options?: VelocityOptions): VelocityResult;
/**
* Stop without finishing the running animations on this VelocityResult or
* on the elements selected.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param queue The queue to stop.
* @param stopAll Should this stop all queued animations too?
*/
(elements: T, action: "stop", queue?: string | false, stopAll?: true): VelocityResult;
/**
* Stop without finishing the running animations on this VelocityResult or
* on the elements selected.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param stopAll Should this stop all queued animations too?
*/
(elements: T, action: "stop", stopAll?: true): VelocityResult;
/**
* Stop without finishing the running animations on this VelocityResult or
* on the elements selected.
*
* @param queue The queue to stop.
* @param stopAll Should this stop all queued animations too?
*/
(this: T, action: "stop", queue?: string | false, stopAll?: true): VelocityResult;
/**
* Stop without finishing the running animations on this VelocityResult or
* on the elements selected.
*
* @param stopAll Should this stop all queued animations too?
*/
(this: T, action: "stop", stopAll?: true): VelocityResult;
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param property The name of the property to access.
*/
(elements: HTMLorSVGElement, action: "style" | "property", property: string): string;
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param property The name of the property to access, or an object with
* `name: value` pairs for setting.
*/
(elements: HTMLorSVGElement, action: "style" | "property", property: string[]): {[property: string]: string}[] | {[property: string]: string};
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param property The name of the property to access.
*/
(this: T, action: "style" | "property", property: string): string | string[];
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param property The name of the property to access.
*/
(elements: T, action: "style" | "property", property: string): string[];
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param property The name of the property to access, or an object with
* `name: value` pairs for setting.
*/
(elements: T, action: "style" | "property", property: string[]): {[property: string]: string}[] | {[property: string]: string}[];
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param property The name of the property to access.
* @param value The value to set the property to.
*/
(this: T, action: "style" | "property", property: string, value: string): VelocityResult;
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param property The name of the property to access.
* @param value The value to set the property to.
*/
(elements: T, action: "style" | "property", property: string, value: string): VelocityResult;
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param property An object with `name: value` pairs for setting.
*/
(this: T, action: "style" | "property", property: {[property: string]: string}): VelocityResult;
/**
* Get or set the value for a property that Velocity understands how to
* access.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param property An object with `name: value` pairs for setting.
*/
(elements: T, action: "style" | "property", property: {[property: string]: string}): VelocityResult;
/**
* Get the tween value for one or more elements using an animation at a
* specific percentage complete. This does not animate the elements, just
* obtains the values based on the current properties.
*
* @param percentComplete What specific percentage is needed (0 <= x <= 1)
* @param property The property to animate.
* @param value The end value or forcefed value.
* @param easing The easing to use.
*/
(this: T, action: "tween", percentComplete: number, property: string, value: VelocityPropertyValue, easing?: VelocityEasingType): string;
/**
* Get the tween value for one or more elements using an animation at a
* specific percentage complete. This does not animate the elements, just
* obtains the values based on the current properties.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param percentComplete What specific percentage is needed (0 <= x <= 1)
* @param property The property to animate.
* @param value The end value or forcefed value.
* @param easing The easing to use.
*/
(elements: T, action: "tween", percentComplete: number, property: string, value: VelocityPropertyValue, easing?: VelocityEasingType): string;
/**
* Get the tween value for one or more elements using an animation at a
* specific percentage complete. This does not animate the elements, just
* obtains the values based on the current properties.
*
* @param percentComplete What specific percentage is needed (0 <= x <= 1)
* @param propertyMap The `key: value` property map to animate to.
* @param easing The easing to use.
*/
(this: T, action: "tween", percentComplete: number, propertyMap: Properties<VelocityProperty>, easing?: VelocityEasingType): Properties<string>;
/**
* Get the tween value for one or more elements using an animation at a
* specific percentage complete. This does not animate the elements, just
* obtains the values based on the current properties.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param percentComplete What specific percentage is needed (0 <= x <= 1)
* @param propertyMap The `key: value` property map to animate to.
* @param easing The easing to use.
*/
(elements: T, action: "tween", percentComplete: number, propertyMap: Properties<VelocityProperty>, easing?: VelocityEasingType): Properties<string>;
/**
* Get the tween value for one or more elements using an animation at a
* specific percentage complete. This does not animate the elements, just
* obtains the values based on the current properties.
*
* When called on Velocity directly without any supplied elements, then the
* values will be based on the `document.body` element. This can be useful
* for simply finding the value for a forcefed animation.
*
* @param percentComplete What specific percentage is needed (0 <= x <= 1)
* @param property The property to animate.
* @param value The end value or forcefed value.
* @param easing The easing to use.
*/
(action: "tween", percentComplete: number, property: string, value: VelocityPropertyValue, easing?: VelocityEasingType): string;
/**
* Get the tween value for one or more elements using an animation at a
* specific percentage complete. This does not animate the elements, just
* obtains the values based on the current properties.
*
* When called on Velocity directly without any supplied elements, then the
* values will be based on the `document.body` element. This can be useful
* for simply finding the value for a forcefed animation.
*
* @param percentComplete What specific percentage is needed (0 <= x <= 1)
* @param propertyMap The `key: value` property map to animate to.
* @param easing The easing to use.
*/
(action: "tween", percentComplete: number, propertyMap: Properties<VelocityProperty>, easing?: VelocityEasingType): Properties<string>;
/**
* Call Velocity with a single object containing all the necessary options.
*
* @param options An object containing the `elements`, `options`, and
* `properties` to use.
*/
(options: VelocityObjectArgs): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param options The options to apply to the animation. This overrides the
* default and any supplied in a sequence.
*/
(elements: T, propertyMap: string | Properties<VelocityProperty>, options?: VelocityOptions): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param duration The length of time to run animation in ms (1000/s).
* @param complete A function to call when the animation is finished.
*/
(elements: T, propertyMap: string | Properties<VelocityProperty>, duration?: number | "fast" | "normal" | "slow", complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param complete A function to call when the animation is finished.
*/
(elements: T, propertyMap: string | Properties<VelocityProperty>, complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param easing The easing to use for this animation.
* @param complete A function to call when the animation is finished.
*/
(elements: T, propertyMap: string | Properties<VelocityProperty>, easing?: string | number[], complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param elements An `Element`, or an array-like list of `Elements` to
* process.
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param duration The length of time to run animation in ms (1000/s).
* @param easing The easing to use for this animation.
* @param complete A function to call when the animation is finished.
*/
(elements: T, propertyMap: string | Properties<VelocityProperty>, duration?: number | "fast" | "normal" | "slow", easing?: string | number[], complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param options The options to apply to the animation. This overrides the
* default and any supplied in a sequence.
*/
(this: T, propertyMap: string | Properties<VelocityProperty>, options?: VelocityOptions): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param duration The length of time to run animation in ms (1000/s).
* @param complete A function to call when the animation is finished.
*/
(this: T, propertyMap: string | Properties<VelocityProperty>, duration?: number | "fast" | "normal" | "slow", complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param complete A function to call when the animation is finished.
*/
(this: T, propertyMap: string | Properties<VelocityProperty>, complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param easing The easing to use for this animation.
* @param complete A function to call when the animation is finished.
*/
(this: T, propertyMap: string | Properties<VelocityProperty>, easing?: string | number[], complete?: () => void): VelocityResult;
/**
* Call velocity on one or more elements.
*
* @param propertyMap The `key: value` property map to animate to, or a
* named sequence to use.
* @param duration The length of time to run animation in ms (1000/s).
* @param easing The easing to use for this animation.
* @param complete A function to call when the animation is finished.
*/
(this: T, propertyMap: string | Properties<VelocityProperty>, duration?: number | "fast" | "normal" | "slow", easing?: string | number[], complete?: () => void): VelocityResult;
}
/**
* Add any easings to this interface to have them picked up by the Easings type.
*/
export interface VelocityEasings {
"at-end": true;
"at-start": true;
"during": true;
"ease": true;
"ease-in": true;
"ease-in-out": true;
"ease-out": true;
"easeIn": true;
"easeInBack": true;
"easeInBounce": true;
"easeInCirc": true;
"easeInCubic": true;