animejs 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -215
- package/lib/anime.cjs +2 -2
- package/lib/anime.esm.js +951 -287
- package/lib/anime.esm.min.js +2 -2
- package/lib/anime.iife.js +2 -2
- package/lib/anime.iife.min.js +2 -2
- package/lib/anime.min.cjs +2 -2
- package/lib/anime.umd.js +2 -2
- package/lib/anime.umd.min.js +2 -2
- package/lib/gui/index.js +6341 -0
- package/package.json +1 -1
- package/types/index.d.ts +179 -116
- package/types/index.js +756 -237
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ declare function getTargetValue(targetSelector: TargetsParam, propName: string,
|
|
|
70
70
|
declare function sync(callback?: Callback<Timer>): Timer;
|
|
71
71
|
declare function setTargetValues(targets: TargetsParam, parameters: AnimationParams): JSAnimation;
|
|
72
72
|
declare function remove(targets: TargetsParam, renderable?: Renderable | WAAPIAnimation, propertyName?: string): TargetsArray;
|
|
73
|
+
declare const keepTime: (constructor: (...args: any[]) => Tickable | ((...args: any[]) => void)) => (...args: any[]) => Tickable | ((...args: any[]) => void);
|
|
73
74
|
declare function lerp(start: number, end: number, amount: number, renderable?: Renderable | boolean): number;
|
|
74
75
|
declare namespace utils {
|
|
75
76
|
export { registerTargets as $ };
|
|
@@ -82,6 +83,7 @@ declare namespace utils {
|
|
|
82
83
|
export { shuffle };
|
|
83
84
|
export { lerp };
|
|
84
85
|
export { sync };
|
|
86
|
+
export { keepTime };
|
|
85
87
|
export let clamp: ((v: number, min: number, max: number) => number) & ChainedClamp;
|
|
86
88
|
export let round: ((v: number, decimalLength: number) => number) & ChainedRound;
|
|
87
89
|
export let snap: ((v: number, increment: number | number[]) => number) & ChainedSnap;
|
|
@@ -199,8 +201,8 @@ declare function registerTargets(targets: DOMTargetsParam): DOMTargetsArray;
|
|
|
199
201
|
declare function registerTargets(targets: JSTargetsParam): JSTargetsArray;
|
|
200
202
|
declare function registerTargets(targets: TargetsParam): TargetsArray;
|
|
201
203
|
declare function random(min: number, max: number, decimalLength?: number): number;
|
|
202
|
-
declare function randomPick(items: string | any[]): any;
|
|
203
204
|
declare function shuffle(items: any[]): any[];
|
|
205
|
+
declare function randomPick(items: string | any[]): any;
|
|
204
206
|
declare namespace svg {
|
|
205
207
|
export { morphTo };
|
|
206
208
|
export { createMotionPath };
|
|
@@ -212,43 +214,11 @@ declare function createMotionPath(path: TargetsParam): {
|
|
|
212
214
|
translateY: FunctionValue;
|
|
213
215
|
rotate: FunctionValue;
|
|
214
216
|
};
|
|
215
|
-
declare function createDrawable(selector: TargetsParam, start?: number, end?: number): Array<
|
|
217
|
+
declare function createDrawable(selector: TargetsParam, start?: number, end?: number): Array<DrawableSVGGeometry>;
|
|
216
218
|
declare function stagger(val: number | string | [
|
|
217
219
|
number | string,
|
|
218
220
|
number | string
|
|
219
|
-
], params?:
|
|
220
|
-
type StaggerParameters = {
|
|
221
|
-
start?: number | string;
|
|
222
|
-
from?: number | "first" | "center" | "last";
|
|
223
|
-
reversed?: boolean;
|
|
224
|
-
grid?: Array<number>;
|
|
225
|
-
axis?: ("x" | "y");
|
|
226
|
-
ease?: EasingParam;
|
|
227
|
-
modifier?: TweenModifier;
|
|
228
|
-
};
|
|
229
|
-
type StaggerFunction = (target?: Target, index?: number, length?: number, tl?: Timeline) => number | string;
|
|
230
|
-
declare class Timeline extends Timer {
|
|
231
|
-
constructor(parameters?: TimelineParams);
|
|
232
|
-
labels: Record<string, number>;
|
|
233
|
-
defaults: DefaultsParams;
|
|
234
|
-
onRender: Callback<this>;
|
|
235
|
-
_ease: EasingFunction;
|
|
236
|
-
add(a1: TargetsParam, a2: AnimationParams, a3?: TimePosition): this;
|
|
237
|
-
add(a1: TimerParams, a2?: TimePosition): this;
|
|
238
|
-
sync(synced?: Tickable, position?: TimePosition): this;
|
|
239
|
-
sync(synced?: globalThis.Animation, position?: TimePosition): this;
|
|
240
|
-
sync(synced?: WAAPIAnimation, position?: TimePosition): this;
|
|
241
|
-
set(targets: TargetsParam, parameters: AnimationParams, position?: TimePosition): this;
|
|
242
|
-
call(callback: Callback<Timer>, position?: TimePosition): this;
|
|
243
|
-
label(labelName: string, position?: TimePosition): this;
|
|
244
|
-
remove(targets: TargetsParam, propertyName?: string): this;
|
|
245
|
-
stretch(newDuration: number): this;
|
|
246
|
-
refresh(): this;
|
|
247
|
-
revert(): this;
|
|
248
|
-
then(callback?: Callback<this>): Promise<any>;
|
|
249
|
-
}
|
|
250
|
-
declare function createTimeline(parameters?: TimelineParams): Timeline;
|
|
251
|
-
type TimePosition = number | string | Function;
|
|
221
|
+
], params?: StaggerParams): StaggerFunction;
|
|
252
222
|
declare namespace eases {
|
|
253
223
|
export let linear: (...args?: (string | number)[]) => EasingFunction;
|
|
254
224
|
export let irregular: (length?: number, randomness?: number) => EasingFunction;
|
|
@@ -337,7 +307,19 @@ declare class Animatable {
|
|
|
337
307
|
revert(): this;
|
|
338
308
|
}
|
|
339
309
|
declare function createAnimatable(targets: TargetsParam, parameters: AnimatableParams): AnimatableObject;
|
|
340
|
-
type Revertible = Animatable | Tickable | Draggable | ScrollObserver | Scope;
|
|
310
|
+
type Revertible = Animatable | Tickable | Draggable | ScrollObserver | TextSplitter | Scope;
|
|
311
|
+
type StaggerFunction = (target?: Target, index?: number, length?: number, tl?: Timeline) => number | string;
|
|
312
|
+
type StaggerParams = {
|
|
313
|
+
start?: number | string;
|
|
314
|
+
from?: number | 'first' | 'center' | 'last' | 'random';
|
|
315
|
+
reversed?: boolean;
|
|
316
|
+
grid?: Array<number>;
|
|
317
|
+
axis?: ('x' | 'y');
|
|
318
|
+
use?: string | StaggerFunction;
|
|
319
|
+
total?: number;
|
|
320
|
+
ease?: EasingParam;
|
|
321
|
+
modifier?: TweenModifier;
|
|
322
|
+
};
|
|
341
323
|
type EasingFunction = (time: number) => number;
|
|
342
324
|
type EaseStringParamNames = ('linear' | 'linear(x1, x2 25%, x3)' | 'in' | 'out' | 'inOut' | 'inQuad' | 'outQuad' | 'inOutQuad' | 'inCubic' | 'outCubic' | 'inOutCubic' | 'inQuart' | 'outQuart' | 'inOutQuart' | 'inQuint' | 'outQuint' | 'inOutQuint' | 'inSine' | 'outSine' | 'inOutSine' | 'inCirc' | 'outCirc' | 'inOutCirc' | 'inExpo' | 'outExpo' | 'inOutExpo' | 'inBounce' | 'outBounce' | 'inOutBounce' | 'inBack' | 'outBack' | 'inOutBack' | 'inElastic' | 'outElastic' | 'inOutElastic' | 'irregular' | 'cubicBezier' | 'steps' | 'in(p = 1.675)' | 'out(p = 1.675)' | 'inOut(p = 1.675)' | 'inBack(overshoot = 1.70158)' | 'outBack(overshoot = 1.70158)' | 'inOutBack(overshoot = 1.70158)' | 'inElastic(amplitude = 1, period = .3)' | 'outElastic(amplitude = 1, period = .3)' | 'inOutElastic(amplitude = 1, period = .3)' | 'irregular(length = 10, randomness = 1)' | 'cubicBezier(x1, y1, x2, y2)' | 'steps(steps = 10)');
|
|
343
325
|
type EasingParam = (string & {}) | EaseStringParamNames | EasingFunction | Spring;
|
|
@@ -352,9 +334,6 @@ type JSTargetsParam = Array<JSTarget> | JSTarget;
|
|
|
352
334
|
type JSTargetsArray = Array<JSTarget>;
|
|
353
335
|
type TargetsParam = Array<TargetSelector> | TargetSelector;
|
|
354
336
|
type TargetsArray = Array<Target>;
|
|
355
|
-
type FunctionValue = (target: Target, index: number, length: number) => number | string | TweenObjectValue | Array<number | string | TweenObjectValue>;
|
|
356
|
-
type TweenModifier = (value: number) => number | string;
|
|
357
|
-
type ColorArray = [number, number, number, number];
|
|
358
337
|
type Callback<T> = (self: T, e?: PointerEvent) => any;
|
|
359
338
|
type TickableCallbacks<T extends unknown> = {
|
|
360
339
|
onBegin?: Callback<T>;
|
|
@@ -367,6 +346,26 @@ type TickableCallbacks<T extends unknown> = {
|
|
|
367
346
|
type RenderableCallbacks<T extends unknown> = {
|
|
368
347
|
onRender?: Callback<T>;
|
|
369
348
|
};
|
|
349
|
+
type TimerOptions = {
|
|
350
|
+
id?: number | string;
|
|
351
|
+
duration?: TweenParamValue;
|
|
352
|
+
delay?: TweenParamValue;
|
|
353
|
+
loopDelay?: number;
|
|
354
|
+
reversed?: boolean;
|
|
355
|
+
alternate?: boolean;
|
|
356
|
+
loop?: boolean | number;
|
|
357
|
+
autoplay?: boolean | ScrollObserver;
|
|
358
|
+
frameRate?: number;
|
|
359
|
+
playbackRate?: number;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
*
|
|
363
|
+
* /**
|
|
364
|
+
*/
|
|
365
|
+
type TimerParams = TimerOptions & TickableCallbacks<Timer>;
|
|
366
|
+
type FunctionValue = (target: Target, index: number, length: number) => number | string | TweenObjectValue | Array<number | string | TweenObjectValue>;
|
|
367
|
+
type TweenModifier = (value: number) => number | string;
|
|
368
|
+
type ColorArray = [number, number, number, number];
|
|
370
369
|
type Tween = {
|
|
371
370
|
id: number;
|
|
372
371
|
parent: JSAnimation;
|
|
@@ -436,23 +435,6 @@ type TweenPropertySiblings = {
|
|
|
436
435
|
type TweenLookups = Record<string, TweenPropertySiblings>;
|
|
437
436
|
type TweenReplaceLookups = WeakMap<Target, TweenLookups>;
|
|
438
437
|
type TweenAdditiveLookups = Map<Target, TweenLookups>;
|
|
439
|
-
type TimerOptions = {
|
|
440
|
-
id?: number | string;
|
|
441
|
-
duration?: TweenParamValue;
|
|
442
|
-
delay?: TweenParamValue;
|
|
443
|
-
loopDelay?: number;
|
|
444
|
-
reversed?: boolean;
|
|
445
|
-
alternate?: boolean;
|
|
446
|
-
loop?: boolean | number;
|
|
447
|
-
autoplay?: boolean | ScrollObserver;
|
|
448
|
-
frameRate?: number;
|
|
449
|
-
playbackRate?: number;
|
|
450
|
-
};
|
|
451
|
-
/**
|
|
452
|
-
*
|
|
453
|
-
* /**
|
|
454
|
-
*/
|
|
455
|
-
type TimerParams = TimerOptions & TickableCallbacks<Timer>;
|
|
456
438
|
type TweenParamValue = number | string | FunctionValue;
|
|
457
439
|
type TweenPropValue = TweenParamValue | [TweenParamValue, TweenParamValue];
|
|
458
440
|
type TweenComposition = (string & {}) | 'none' | 'replace' | 'blend' | compositionTypes;
|
|
@@ -504,6 +486,102 @@ type AnimatablePropertyParamsOptions = {
|
|
|
504
486
|
composition?: TweenComposition;
|
|
505
487
|
};
|
|
506
488
|
type AnimatableParams = Record<string, TweenParamValue | EasingParam | TweenModifier | TweenComposition | AnimatablePropertyParamsOptions> & AnimatablePropertyParamsOptions;
|
|
489
|
+
type ReactRef = {
|
|
490
|
+
current?: HTMLElement | SVGElement | null;
|
|
491
|
+
};
|
|
492
|
+
type AngularRef = {
|
|
493
|
+
nativeElement?: HTMLElement | SVGElement;
|
|
494
|
+
};
|
|
495
|
+
type ScopeParams = {
|
|
496
|
+
root?: DOMTargetSelector | ReactRef | AngularRef;
|
|
497
|
+
defaults?: DefaultsParams;
|
|
498
|
+
mediaQueries?: Record<string, string>;
|
|
499
|
+
};
|
|
500
|
+
type ScopedCallback<T> = (scope: Scope) => T;
|
|
501
|
+
type ScopeCleanupCallback = (scope?: Scope) => any;
|
|
502
|
+
type ScopeConstructorCallback = (scope?: Scope) => ScopeCleanupCallback | void;
|
|
503
|
+
type ScopeMethod = (...args: any[]) => ScopeCleanupCallback | void;
|
|
504
|
+
type DraggableAxisParam = {
|
|
505
|
+
mapTo?: string;
|
|
506
|
+
modifier?: TweenModifier;
|
|
507
|
+
composition?: TweenComposition;
|
|
508
|
+
snap?: number | number[] | ((draggable: Draggable) => number | Array<number>);
|
|
509
|
+
};
|
|
510
|
+
type DraggableCursorParams = {
|
|
511
|
+
onHover?: string;
|
|
512
|
+
onGrab?: string;
|
|
513
|
+
};
|
|
514
|
+
type DraggableParams = {
|
|
515
|
+
trigger?: DOMTargetSelector;
|
|
516
|
+
container?: number[] | DOMTargetSelector | ((draggable: Draggable) => DOMTargetSelector | Array<number>);
|
|
517
|
+
x?: boolean | DraggableAxisParam;
|
|
518
|
+
y?: boolean | DraggableAxisParam;
|
|
519
|
+
modifier?: TweenModifier;
|
|
520
|
+
snap?: number | number[] | ((draggable: Draggable) => number | Array<number>);
|
|
521
|
+
containerPadding?: number | number[] | ((draggable: Draggable) => number | Array<number>);
|
|
522
|
+
containerFriction?: number | ((draggable: Draggable) => number);
|
|
523
|
+
releaseContainerFriction?: number | ((draggable: Draggable) => number);
|
|
524
|
+
dragSpeed?: number | ((draggable: Draggable) => number);
|
|
525
|
+
scrollSpeed?: number | ((draggable: Draggable) => number);
|
|
526
|
+
scrollThreshold?: number | ((draggable: Draggable) => number);
|
|
527
|
+
minVelocity?: number | ((draggable: Draggable) => number);
|
|
528
|
+
maxVelocity?: number | ((draggable: Draggable) => number);
|
|
529
|
+
velocityMultiplier?: number | ((draggable: Draggable) => number);
|
|
530
|
+
releaseMass?: number;
|
|
531
|
+
releaseStiffness?: number;
|
|
532
|
+
releaseDamping?: number;
|
|
533
|
+
releaseEase?: EasingParam;
|
|
534
|
+
cursor?: boolean | DraggableCursorParams | ((draggable: Draggable) => boolean | DraggableCursorParams);
|
|
535
|
+
onGrab?: Callback<Draggable>;
|
|
536
|
+
onDrag?: Callback<Draggable>;
|
|
537
|
+
onRelease?: Callback<Draggable>;
|
|
538
|
+
onUpdate?: Callback<Draggable>;
|
|
539
|
+
onSettle?: Callback<Draggable>;
|
|
540
|
+
onSnap?: Callback<Draggable>;
|
|
541
|
+
onResize?: Callback<Draggable>;
|
|
542
|
+
onAfterResize?: Callback<Draggable>;
|
|
543
|
+
};
|
|
544
|
+
type splitTemplateParams = {
|
|
545
|
+
class?: false | string;
|
|
546
|
+
wrap?: boolean | 'hidden' | 'clip' | 'visible' | 'scroll' | 'auto';
|
|
547
|
+
clone?: boolean | 'top' | 'right' | 'bottom' | 'left' | 'center';
|
|
548
|
+
};
|
|
549
|
+
type SplitValue = boolean | string;
|
|
550
|
+
type SplitFunctionValue = (value?: Node | HTMLElement) => any;
|
|
551
|
+
type TextSplitterParams = {
|
|
552
|
+
lines?: SplitValue | splitTemplateParams | SplitFunctionValue;
|
|
553
|
+
words?: SplitValue | splitTemplateParams | SplitFunctionValue;
|
|
554
|
+
chars?: SplitValue | splitTemplateParams | SplitFunctionValue;
|
|
555
|
+
accessible?: boolean;
|
|
556
|
+
includeSpaces?: boolean;
|
|
557
|
+
debug?: boolean;
|
|
558
|
+
};
|
|
559
|
+
type DrawableSVGGeometry = SVGGeometryElement & {
|
|
560
|
+
setAttribute(name: 'draw', value: `${number} ${number}`): void;
|
|
561
|
+
draw: `${number} ${number}`;
|
|
562
|
+
};
|
|
563
|
+
declare class Timeline extends Timer {
|
|
564
|
+
constructor(parameters?: TimelineParams);
|
|
565
|
+
labels: Record<string, number>;
|
|
566
|
+
defaults: DefaultsParams;
|
|
567
|
+
onRender: Callback<this>;
|
|
568
|
+
_ease: EasingFunction;
|
|
569
|
+
add(a1: TargetsParam, a2: AnimationParams, a3?: TimePosition): this;
|
|
570
|
+
add(a1: TimerParams, a2?: TimePosition): this;
|
|
571
|
+
sync(synced?: Tickable, position?: TimePosition): this;
|
|
572
|
+
sync(synced?: globalThis.Animation, position?: TimePosition): this;
|
|
573
|
+
sync(synced?: WAAPIAnimation, position?: TimePosition): this;
|
|
574
|
+
set(targets: TargetsParam, parameters: AnimationParams, position?: TimePosition): this;
|
|
575
|
+
call(callback: Callback<Timer>, position?: TimePosition): this;
|
|
576
|
+
label(labelName: string, position?: TimePosition): this;
|
|
577
|
+
remove(targets: TargetsParam, propertyName?: string): this;
|
|
578
|
+
stretch(newDuration: number): this;
|
|
579
|
+
refresh(): this;
|
|
580
|
+
revert(): this;
|
|
581
|
+
then(callback?: Callback<this>): Promise<any>;
|
|
582
|
+
}
|
|
583
|
+
declare function createTimeline(parameters?: TimelineParams): Timeline;
|
|
584
|
+
type TimePosition = number | string | Function;
|
|
507
585
|
declare class Draggable {
|
|
508
586
|
constructor(target: TargetsParam, parameters?: DraggableParams);
|
|
509
587
|
containerArray: number[];
|
|
@@ -675,46 +753,6 @@ declare class Draggable {
|
|
|
675
753
|
handleEvent(e: Event): void;
|
|
676
754
|
}
|
|
677
755
|
declare function createDraggable(target: TargetsParam, parameters?: DraggableParams): Draggable;
|
|
678
|
-
type DraggableCursorParams = {
|
|
679
|
-
onHover?: string;
|
|
680
|
-
onGrab?: string;
|
|
681
|
-
};
|
|
682
|
-
type DraggableAxisParam = {
|
|
683
|
-
mapTo?: string;
|
|
684
|
-
modifier?: TweenModifier;
|
|
685
|
-
composition?: TweenComposition;
|
|
686
|
-
snap?: number | number[] | ((draggable: Draggable) => number | Array<number>);
|
|
687
|
-
};
|
|
688
|
-
type DraggableParams = {
|
|
689
|
-
trigger?: DOMTargetSelector;
|
|
690
|
-
container?: number[] | DOMTargetSelector | ((draggable: Draggable) => DOMTargetSelector | Array<number>);
|
|
691
|
-
x?: boolean | DraggableAxisParam;
|
|
692
|
-
y?: boolean | DraggableAxisParam;
|
|
693
|
-
modifier?: TweenModifier;
|
|
694
|
-
snap?: number | number[] | ((draggable: Draggable) => number | Array<number>);
|
|
695
|
-
containerPadding?: number | number[] | ((draggable: Draggable) => number | Array<number>);
|
|
696
|
-
containerFriction?: number | ((draggable: Draggable) => number);
|
|
697
|
-
releaseContainerFriction?: number | ((draggable: Draggable) => number);
|
|
698
|
-
dragSpeed?: number | ((draggable: Draggable) => number);
|
|
699
|
-
scrollSpeed?: number | ((draggable: Draggable) => number);
|
|
700
|
-
scrollThreshold?: number | ((draggable: Draggable) => number);
|
|
701
|
-
minVelocity?: number | ((draggable: Draggable) => number);
|
|
702
|
-
maxVelocity?: number | ((draggable: Draggable) => number);
|
|
703
|
-
velocityMultiplier?: number | ((draggable: Draggable) => number);
|
|
704
|
-
releaseMass?: number;
|
|
705
|
-
releaseStiffness?: number;
|
|
706
|
-
releaseDamping?: number;
|
|
707
|
-
releaseEase?: EasingParam;
|
|
708
|
-
cursor?: boolean | DraggableCursorParams | ((draggable: Draggable) => boolean | DraggableCursorParams);
|
|
709
|
-
onGrab?: Callback<Draggable>;
|
|
710
|
-
onDrag?: Callback<Draggable>;
|
|
711
|
-
onRelease?: Callback<Draggable>;
|
|
712
|
-
onUpdate?: Callback<Draggable>;
|
|
713
|
-
onSettle?: Callback<Draggable>;
|
|
714
|
-
onSnap?: Callback<Draggable>;
|
|
715
|
-
onResize?: Callback<Draggable>;
|
|
716
|
-
onAfterResize?: Callback<Draggable>;
|
|
717
|
-
};
|
|
718
756
|
declare class Transforms {
|
|
719
757
|
constructor($el: DOMTarget | DOMProxy);
|
|
720
758
|
$el: DOMTarget | DOMProxy;
|
|
@@ -755,35 +793,29 @@ declare class Scope {
|
|
|
755
793
|
constructor(parameters?: ScopeParams);
|
|
756
794
|
defaults: DefaultsParams;
|
|
757
795
|
root: Document | DOMTarget;
|
|
758
|
-
constructors: Array<
|
|
759
|
-
revertConstructors: Array<
|
|
796
|
+
constructors: Array<ScopeConstructorCallback>;
|
|
797
|
+
revertConstructors: Array<ScopeCleanupCallback>;
|
|
760
798
|
revertibles: Array<Revertible>;
|
|
761
|
-
|
|
799
|
+
constructorsOnce: (ScopeConstructorCallback | ((scope: this) => Tickable))[];
|
|
800
|
+
revertConstructorsOnce: Array<ScopeCleanupCallback>;
|
|
801
|
+
revertiblesOnce: Array<Revertible>;
|
|
802
|
+
once: boolean;
|
|
803
|
+
onceIndex: number;
|
|
804
|
+
methods: Record<string, ScopeMethod>;
|
|
762
805
|
matches: Record<string, boolean>;
|
|
763
806
|
mediaQueryLists: Record<string, MediaQueryList>;
|
|
764
807
|
data: Record<string, any>;
|
|
765
|
-
|
|
808
|
+
register(revertible: Revertible): void;
|
|
809
|
+
execute<T>(cb: ScopedCallback<T>): T;
|
|
766
810
|
refresh(): this;
|
|
767
811
|
add(a1: string, a2: ScopeMethod): this;
|
|
768
|
-
add(a1:
|
|
812
|
+
add(a1: ScopeConstructorCallback): this;
|
|
813
|
+
addOnce(scopeConstructorCallback: ScopeConstructorCallback): this;
|
|
814
|
+
keepTime(cb: (scope: this) => Tickable): Tickable;
|
|
769
815
|
handleEvent(e: Event): void;
|
|
770
816
|
revert(): void;
|
|
771
817
|
}
|
|
772
818
|
declare function createScope(params?: ScopeParams): Scope;
|
|
773
|
-
type ReactRef = {
|
|
774
|
-
current?: HTMLElement | SVGElement | null;
|
|
775
|
-
};
|
|
776
|
-
type AngularRef = {
|
|
777
|
-
nativeElement?: HTMLElement | SVGElement;
|
|
778
|
-
};
|
|
779
|
-
type ScopeParams = {
|
|
780
|
-
root?: DOMTargetSelector | ReactRef | AngularRef;
|
|
781
|
-
defaults?: DefaultsParams;
|
|
782
|
-
mediaQueries?: Record<string, string>;
|
|
783
|
-
};
|
|
784
|
-
type ScopeCleanup = (scope?: Scope) => any;
|
|
785
|
-
type ScopeConstructor = (scope?: Scope) => ScopeCleanup | void;
|
|
786
|
-
type ScopeMethod = (...args: any[]) => ScopeCleanup | void;
|
|
787
819
|
declare const scrollContainers: Map<any, any>;
|
|
788
820
|
declare class ScrollObserver {
|
|
789
821
|
constructor(parameters?: ScrollObserverParams);
|
|
@@ -1016,4 +1048,35 @@ type WAAPIAnimationOptions = {
|
|
|
1016
1048
|
};
|
|
1017
1049
|
type WAAPIAnimationParams = Record<string, WAAPIKeyframeValue | WAAPIAnimationOptions | boolean | ScrollObserver | WAAPICallback | EasingParam | WAAPITweenOptions> & WAAPIAnimationOptions;
|
|
1018
1050
|
declare function easingToLinear(fn: EasingFunction, samples?: number): string;
|
|
1019
|
-
|
|
1051
|
+
declare class TextSplitter {
|
|
1052
|
+
constructor(target: HTMLElement | NodeList | string | Array<HTMLElement>, parameters?: TextSplitterParams);
|
|
1053
|
+
debug: boolean;
|
|
1054
|
+
includeSpaces: boolean;
|
|
1055
|
+
accessible: boolean;
|
|
1056
|
+
linesOnly: boolean;
|
|
1057
|
+
lineTemplate: string | false | SplitFunctionValue;
|
|
1058
|
+
wordTemplate: string | false | SplitFunctionValue;
|
|
1059
|
+
charTemplate: string | false | SplitFunctionValue;
|
|
1060
|
+
$target: HTMLElement;
|
|
1061
|
+
html: string;
|
|
1062
|
+
lines: any[];
|
|
1063
|
+
words: any[];
|
|
1064
|
+
chars: any[];
|
|
1065
|
+
effects: any[];
|
|
1066
|
+
effectsCleanups: any[];
|
|
1067
|
+
cache: string;
|
|
1068
|
+
ready: boolean;
|
|
1069
|
+
width: number;
|
|
1070
|
+
resizeTimeout: NodeJS.Timeout;
|
|
1071
|
+
resizeObserver: ResizeObserver;
|
|
1072
|
+
addEffect(effect: (...args: any[]) => Tickable | (() => void)): void | this;
|
|
1073
|
+
revert(): this;
|
|
1074
|
+
splitNode(node: Node): void;
|
|
1075
|
+
split(clearCache?: boolean): this;
|
|
1076
|
+
refresh(): void;
|
|
1077
|
+
}
|
|
1078
|
+
declare function split(target: HTMLElement | NodeList | string | Array<HTMLElement>, parameters?: TextSplitterParams): TextSplitter;
|
|
1079
|
+
declare namespace text {
|
|
1080
|
+
export { split };
|
|
1081
|
+
}
|
|
1082
|
+
export { engine, utils, svg, stagger, eases, DefaultsParams, Renderable, Tickable, CallbackArgument, Revertible, StaggerFunction, StaggerParams, EasingFunction, EaseStringParamNames, EasingParam, DOMTarget, JSTarget, Target, TargetSelector, DOMTargetSelector, DOMTargetsParam, DOMTargetsArray, JSTargetsParam, JSTargetsArray, TargetsParam, TargetsArray, Callback, TickableCallbacks, RenderableCallbacks, TimerOptions, TimerParams, FunctionValue, TweenModifier, ColorArray, Tween, TweenDecomposedValue, TweenPropertySiblings, TweenLookups, TweenReplaceLookups, TweenAdditiveLookups, TweenParamValue, TweenPropValue, TweenComposition, TweenParamsOptions, TweenValues, TweenKeyValue, ArraySyntaxValue, TweenOptions, TweenObjectValue, PercentageKeyframeOptions, PercentageKeyframeParams, PercentageKeyframes, DurationKeyframes, AnimationOptions, AnimationParams, TimelineOptions, TimelineParams, AnimatablePropertySetter, AnimatablePropertyGetter, AnimatableProperty, AnimatableObject, AnimatablePropertyParamsOptions, AnimatableParams, ReactRef, AngularRef, ScopeParams, ScopedCallback, ScopeCleanupCallback, ScopeConstructorCallback, ScopeMethod, DraggableAxisParam, DraggableCursorParams, DraggableParams, splitTemplateParams, SplitValue, SplitFunctionValue, TextSplitterParams, DrawableSVGGeometry, createTimer, Timer, animate, JSAnimation, createTimeline, Timeline, createAnimatable, Animatable, createDraggable, Draggable, createScope, Scope, onScroll, ScrollObserver, scrollContainers, createSpring, Spring, waapi, WAAPIAnimation, text, TextSplitter };
|