@xtia/timeline 1.0.1 → 1.0.3

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.
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.easers = void 0;
4
+ const overshoot = 1.70158;
5
+ exports.easers = {
6
+ linear: (x) => x,
7
+ easeIn: (x) => x * x,
8
+ easeIn4: (x) => Math.pow(x, 4),
9
+ easeOut: (x) => 1 - Math.pow((1 - x), 2),
10
+ easeOut4: (x) => 1 - Math.pow((1 - x), 4),
11
+ circleIn: (x) => 1 - Math.sqrt(1 - Math.pow(x, 2)),
12
+ circleIn4: (x) => 1 - Math.sqrt(1 - Math.pow(x, 4)),
13
+ circleOut: (x) => Math.sqrt(1 - Math.pow((1 - x), 2)),
14
+ circleOut4: (x) => Math.sqrt(1 - Math.pow((1 - x), 4)),
15
+ easeInOut: (x) => -Math.cos(x * Math.PI) / 2 + .5,
16
+ elastic: (x) => 1 - Math.cos(4 * Math.PI * x) * (1 - x),
17
+ overshootIn: (x) => --x * x * ((overshoot + 1) * x + overshoot) + 1,
18
+ sine: (x) => (Math.sin(2 * Math.PI * x) + 1) / 2,
19
+ invert: (x) => 1 - x,
20
+ bounce: (x) => {
21
+ if (x < 4 / 11.0) {
22
+ return (121 * x * x) / 16.0;
23
+ }
24
+ else if (x < 8 / 11.0) {
25
+ return (363 / 40.0 * x * x) - (99 / 10.0 * x) + 17 / 5.0;
26
+ }
27
+ else if (x < 9 / 10.0) {
28
+ return (4356 / 361.0 * x * x) - (35442 / 1805.0 * x) + 16061 / 1805.0;
29
+ }
30
+ else {
31
+ return (54 / 5.0 * x * x) - (513 / 25.0 * x) + 268 / 25.0;
32
+ }
33
+ },
34
+ noise: (x) => x == 0 ? 0 : (x >= 1 ? 1 : Math.random()),
35
+ pingpong: (x) => x < .5 ? x * 2 : 1 - (x - .5) * 2,
36
+ };
@@ -0,0 +1,153 @@
1
+ import { Easer, easers } from "./easing";
2
+ import { Blendable } from "./tween";
3
+ /** @internal */
4
+ export declare function createEmitter<T>(onListen: (handler: Handler<T>) => UnsubscribeFunc): Emitter<T>;
5
+ /** @internal */
6
+ export declare function createEmitter<T, API extends object>(onListen: (handler: Handler<T>) => UnsubscribeFunc, api: Omit<API, keyof Emitter<T>>): Emitter<T> & API;
7
+ /** @internal */
8
+ export declare function createProgressEmitter<API extends object>(onListen: (handler: Handler<number>) => UnsubscribeFunc, api: Omit<API, keyof RangeProgression>): RangeProgression & API;
9
+ /** @internal */
10
+ export declare function createProgressEmitter(onListen: (handler: Handler<number>) => UnsubscribeFunc): RangeProgression;
11
+ type Handler<T> = (value: T) => void;
12
+ export type UnsubscribeFunc = () => void;
13
+ export interface Emitter<T> {
14
+ /**
15
+ * Registers a function to receive emitted values
16
+ * @param handler
17
+ * @returns A function to deregister the handler
18
+ */
19
+ listen(handler: Handler<T>): UnsubscribeFunc;
20
+ /**
21
+ * Creates a chainable emitter that applies arbitrary transformation to values emitted by its parent
22
+ * @param mapFunc
23
+ * @returns Listenable: emits transformed values
24
+ */
25
+ map<R>(mapFunc: (value: T) => R): Emitter<R>;
26
+ /**
27
+ * Creates a chainable emitter that selectively forwards emissions along the chain
28
+ * @param check Function that takes an emitted value and returns true if the emission should be forwarded along the chain
29
+ * @returns Listenable: emits values that pass the filter
30
+ */
31
+ filter(check: (value: T) => boolean): Emitter<T>;
32
+ /**
33
+ * Creates a chainable emitter that discards emitted values that are the same as the last value emitted by the new emitter
34
+ * @param compare Optional function that takes the previous and next values and returns true if they should be considered equal
35
+ *
36
+ * If no `compare` function is provided, values will be compared via `===`
37
+ * @returns Listenable: emits non-repeating values
38
+ */
39
+ noRepeat(compare?: (a: T, b: T) => boolean): Emitter<T>;
40
+ /**
41
+ * Creates a chainable emitter that mirrors emissions from the parent emitter, invoking the provided callback `cb` as a side effect for each emission.
42
+ *
43
+ * The callback `cb` is called exactly once per parent emission, regardless of how many listeners are attached to the returned emitter.
44
+ * All listeners attached to the returned emitter receive the same values as the parent emitter.
45
+ *
46
+ * *Note*, the side effect `cb` is only invoked when there is at least one listener attached to the returned emitter
47
+ *
48
+ * @param cb A function to be called as a side effect for each value emitted by the parent emitter.
49
+ * @returns A new emitter that forwards all values from the parent, invoking `cb` as a side effect.
50
+ */
51
+ tap(cb: Handler<T>): Emitter<T>;
52
+ }
53
+ export interface RangeProgression extends Emitter<number> {
54
+ /**
55
+ * Creates a chainable progress emitter that applies an easing function to its parent's emitted values
56
+ *
57
+ * @param easer An easing function of the form `(progression: number) => number`
58
+ * @returns Listenable: emits eased progression values
59
+ */
60
+ ease(easer?: Easer | keyof typeof easers): RangeProgression;
61
+ /**
62
+ * Creates a chainable emitter that interpolates two given values by progression emitted by its parent
63
+ *
64
+ * Can interpolate types `number`, `number[]`, string and objects with a `blend(from: this, to: this): this` method
65
+ *
66
+ * @param from Value to interpolate from
67
+ * @param to Value to interpolate to
68
+ * @returns Listenable: emits interpolated values
69
+ */
70
+ tween(from: number, to: number): Emitter<number>;
71
+ /**
72
+ * Creates a chainable emitter that interpolates two given values by progression emitted by its parent
73
+ *
74
+ * Can interpolate types `number`, `number[]`, string and objects with a `blend(from: this, to: this): this` method
75
+ *
76
+ * #### String interpolation
77
+ * * If the strings contain tweenable tokens (numbers, colour codes) and are otherwise identical, those tokens are interpolated
78
+ * * Otherwise the `from` string is progressively replaced, left-to-right, with the `to` string
79
+ *
80
+ * eg
81
+ * ```ts
82
+ * range
83
+ * .tween("0px 0px 0px #0000", "4px 4px 8px #0005")
84
+ * .listen(s => element.style.textShadow = s);
85
+ * ```
86
+ *
87
+ * @param from Value to interpolate from
88
+ * @param to Value to interpolate to
89
+ * @returns Listenable: emits interpolated values
90
+ */
91
+ tween(from: string, to: string): Emitter<string>;
92
+ /**
93
+ * Creates a chainable emitter that interpolates two given values by progression emitted by its parent
94
+ *
95
+ * Can interpolate types `number`, `number[]`, string and objects with a `blend(from: this, to: this): this` method
96
+ *
97
+ * @param from Value to interpolate from
98
+ * @param to Value to interpolate to
99
+ * @returns Listenable: emits interpolated values
100
+ */
101
+ tween<T extends Blendable | number[]>(from: T, to: T): Emitter<T>;
102
+ /**
103
+ * Creates a chainable progress emitter that quantises progress, as emitted by its parent, to the nearest of `steps` discrete values.
104
+ *
105
+ * @param steps – positive integer (e.g. 10 → 0, .1, .2 … 1)
106
+ * @throws RangeError if steps is not a positive integer
107
+ * @returns Listenable: emits quantised progression values
108
+ */
109
+ snap(steps: number): RangeProgression;
110
+ /**
111
+ * Creates a chainable progress emitter that emits `1` when the incoming progress value is greater‑than‑or‑equal to the supplied `threshold`, otherwise emits `0`
112
+ *
113
+ * @param threshold the cut‑off value
114
+ * @returns Listenable: emits 0 or 1 after comparing progress with a threshold
115
+ */
116
+ threshold(threshold: number): RangeProgression;
117
+ /**
118
+ * Creates a chainable progress emitter that clamps incoming values
119
+ * @param min default 0
120
+ * @param max default 1
121
+ * @returns Listenable: emits clamped progression values
122
+ */
123
+ clamp(min?: number, max?: number): RangeProgression;
124
+ /**
125
+ * Creates a chainable progress emitter that maps incoming values to a repeating linear scale
126
+ * @param count Number of repetitions
127
+ */
128
+ repeat(count: number): RangeProgression;
129
+ /**
130
+ * Creates a chainable progress emitter that mirrors emissions from the parent emitter, invoking the provided callback `cb` as a side effect for each emission.
131
+ *
132
+ * The callback `cb` is called exactly once per parent emission, regardless of how many listeners are attached to the returned emitter.
133
+ * All listeners attached to the returned emitter receive the same values as the parent emitter.
134
+ *
135
+ * *Note*, the side effect `cb` is only invoked when there is at least one listener attached to the returned emitter
136
+ *
137
+ * @param cb A function to be called as a side effect for each value emitted by the parent emitter.
138
+ * @returns A new emitter that forwards all values from the parent, invoking `cb` as a side effect.
139
+ */
140
+ tap(cb: (value: number) => void): RangeProgression;
141
+ /**
142
+ * Creates a chainable progress emitter that selectively forwards emissions along the chain
143
+ * @param check Function that takes an emitted value and returns true if the emission should be forwarded along the chain
144
+ * @returns Listenable: emits values that pass the filter
145
+ */
146
+ filter(check: (value: number) => boolean): RangeProgression;
147
+ /**
148
+ * Creates a chainable progress emitter that discards emitted values that are the same as the last value emitted by the new emitter
149
+ * @returns Listenable: emits non-repeating values
150
+ */
151
+ noRepeat(): RangeProgression;
152
+ }
153
+ export {};
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createEmitter = createEmitter;
4
+ exports.createProgressEmitter = createProgressEmitter;
5
+ const easing_1 = require("./easing");
6
+ const tween_1 = require("./tween");
7
+ const utils_1 = require("./utils");
8
+ /** @internal */
9
+ function createEmitter(onListen, api) {
10
+ const propertyDescriptor = Object.fromEntries(Object.entries({
11
+ listen: (handler) => onListen((value) => {
12
+ handler(value);
13
+ }),
14
+ map: (mapFunc) => createEmitter(handler => onListen((value) => {
15
+ handler(mapFunc(value));
16
+ })),
17
+ filter: (filterFunc) => createEmitter(handler => onListen((value) => {
18
+ if (filterFunc(value))
19
+ handler(value);
20
+ })),
21
+ noRepeat: (compare) => {
22
+ let previous = null;
23
+ return createEmitter(handler => {
24
+ const filteredHandler = (value) => {
25
+ if (!previous || (compare
26
+ ? !compare(previous.value, value)
27
+ : (previous.value !== value))) {
28
+ handler(value);
29
+ previous = { value };
30
+ }
31
+ };
32
+ return onListen(filteredHandler);
33
+ });
34
+ },
35
+ tap: (cb) => createEmitter(createTapListener(cb, onListen)),
36
+ }).map(([key, value]) => [
37
+ key,
38
+ { value }
39
+ ]));
40
+ return Object.create(api ?? {}, propertyDescriptor);
41
+ }
42
+ /** @internal */
43
+ function createProgressEmitter(onListen, api = {}) {
44
+ const propertyDescriptor = Object.fromEntries(Object.entries({
45
+ ease: (easer) => {
46
+ const easerFunc = typeof easer == "string"
47
+ ? easing_1.easers[easer]
48
+ : easer;
49
+ return createProgressEmitter(easer ? (handler => onListen((progress) => {
50
+ handler(easerFunc(progress));
51
+ })) : onListen);
52
+ },
53
+ tween: (from, to) => createEmitter(handler => onListen(progress => handler((0, tween_1.tweenValue)(from, to, progress)))),
54
+ snap: (steps) => {
55
+ if (!Number.isInteger(steps) || steps <= 0) {
56
+ throw new RangeError('snap(steps) requires a positive integer');
57
+ }
58
+ return createProgressEmitter(handler => onListen(progress => {
59
+ const snapped = Math.round(progress * steps) / steps;
60
+ handler((0, utils_1.clamp)(snapped, 0, 1));
61
+ }));
62
+ },
63
+ threshold: (threshold) => createProgressEmitter(handler => onListen(progress => {
64
+ handler(progress >= threshold ? 1 : 0);
65
+ })),
66
+ clamp: (min = 0, max = 1) => createProgressEmitter(handler => onListen(progress => handler((0, utils_1.clamp)(progress, min, max)))),
67
+ repeat: (repetitions) => {
68
+ repetitions = Math.max(0, repetitions);
69
+ return createProgressEmitter(handler => onListen(progress => {
70
+ const out = (progress * repetitions) % 1;
71
+ handler(out);
72
+ }));
73
+ },
74
+ tap: (cb) => createProgressEmitter(createTapListener(cb, onListen)),
75
+ filter: (filterFunc) => createProgressEmitter(handler => onListen((value) => {
76
+ if (filterFunc(value))
77
+ handler(value);
78
+ })),
79
+ noRepeat: () => {
80
+ let previous = null;
81
+ return createProgressEmitter(handler => {
82
+ return onListen((value) => {
83
+ if (!previous || (previous.value !== value)) {
84
+ handler(value);
85
+ previous = { value };
86
+ }
87
+ });
88
+ });
89
+ },
90
+ }).map(([key, value]) => [
91
+ key,
92
+ { value }
93
+ ]));
94
+ return createEmitter(onListen, Object.create(api, propertyDescriptor));
95
+ }
96
+ function createTapListener(callback, parentOnListen) {
97
+ const listeners = [];
98
+ let parentUnsubscribe = null;
99
+ const tapOnListen = (handler) => {
100
+ listeners.push(handler);
101
+ if (listeners.length === 1) {
102
+ parentUnsubscribe = parentOnListen(value => {
103
+ callback(value);
104
+ listeners.slice().forEach(fn => fn(value));
105
+ });
106
+ }
107
+ return () => {
108
+ const idx = listeners.indexOf(handler);
109
+ listeners.splice(idx, 1);
110
+ if (listeners.length === 0 && parentUnsubscribe) {
111
+ parentUnsubscribe();
112
+ parentUnsubscribe = null;
113
+ }
114
+ };
115
+ };
116
+ return tapOnListen;
117
+ }
@@ -0,0 +1,29 @@
1
+ import { Emitter } from "./emitters";
2
+ import { TimelineRange } from "./range";
3
+ export type PointEvent = {
4
+ direction: -1 | 1;
5
+ };
6
+ export interface TimelinePoint extends Emitter<PointEvent> {
7
+ /**
8
+ * Creates a range on the Timeline, with a given duration, starting at this point
9
+ * @param duration
10
+ * @returns Listenable: emits normalised (0..1) range progression
11
+ */
12
+ range(duration: number): TimelineRange;
13
+ /**
14
+ * Creates a range on the Timeline, with a given end point, starting at this point
15
+ * @param endPoint
16
+ * @returns Listenable: emits normalised (0..1) range progression
17
+ */
18
+ to(endPoint: number | TimelinePoint): TimelineRange;
19
+ /**
20
+ * Creates a point on the Timeline at an offset position from this one
21
+ * @param timeOffset
22
+ * @returns Listenable: emits a PointEvent when the point is reached or passed by a Timeline seek
23
+ */
24
+ delta(timeOffset: number): TimelinePoint;
25
+ /**
26
+ * The point's absolute position on the Timeline
27
+ */
28
+ readonly position: number;
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,50 @@
1
+ import { Easer, easers } from "./easing";
2
+ import { RangeProgression } from "./emitters";
3
+ import { TimelinePoint } from "./point";
4
+ export interface TimelineRange extends RangeProgression {
5
+ /**
6
+ * Creates two ranges by seperating one at a given point
7
+ * @param position Point of separation, relative to the range's start - if omitted, the range will be separated halfway
8
+ *
9
+ * Must be greater than 0 and less than the range's duration
10
+ * @returns Tuple of two ranges
11
+ */
12
+ bisect(position?: number): [TimelineRange, TimelineRange];
13
+ /**
14
+ * Creates a series of evenly-spread points across the range, excluding the range's start and end
15
+ * @param count Number of Points to return
16
+ * @returns Array(count) of points
17
+ */
18
+ spread(count: number): TimelinePoint[];
19
+ /**
20
+ * Progresses the Timeline across the range
21
+ * @param easer
22
+ */
23
+ play(easer?: Easer | keyof typeof easers): Promise<void>;
24
+ /**
25
+ * Creates a new range representing a direct expansion of this one
26
+ * @param delta Amount to grow by (in time units)
27
+ * @param anchor Normalised position at which to expand (0 being the start, expanding right, 1 being the end, expanding left, 0.5 expanding evenly)
28
+ * @returns Listenable: this range will emit a progression value (0..1) when a `seek()` passes or intersects it
29
+ */
30
+ grow(delta: number, anchor?: number): TimelineRange;
31
+ /**
32
+ * Creates a new range representing a multiplicative expansion of this one
33
+ * @param factor Size multiplier
34
+ * @param anchor Normalised position at which to expand (0 being the start, expanding right, 1 being the end, expanding left, 0.5 expanding evenly)
35
+ * @returns Listenable: this range will emit a progression value (0..1) when a `seek()` passes or intersects it
36
+ */
37
+ scale(factor: number, anchor?: number): TimelineRange;
38
+ /**
39
+ * Checks if a point is within this range
40
+ * @param point The point to check
41
+ * @returns true if the provided point is within the range
42
+ */
43
+ contains(point: TimelinePoint): boolean;
44
+ /** The point on the Timeline at which this range begins */
45
+ readonly start: TimelinePoint;
46
+ /** The point on the Timeline at which this range ends */
47
+ readonly end: TimelinePoint;
48
+ /** The duration of this range */
49
+ readonly duration: number;
50
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,147 @@
1
+ import { Easer, easers } from "./easing";
2
+ import { TimelinePoint } from "./point";
3
+ import { TimelineRange } from "./range";
4
+ import { Tweenable } from "./tween";
5
+ import { Widen } from "./utils";
6
+ declare const EndAction: {
7
+ readonly pause: 0;
8
+ readonly continue: 1;
9
+ readonly wrap: 2;
10
+ readonly restart: 3;
11
+ };
12
+ /**
13
+ * Creates an autoplaying Timeline and returns a range from it
14
+ * @param duration
15
+ * @returns Object representing a range on a single-use, autoplaying Timeline
16
+ */
17
+ export declare function animate(duration: number): TimelineRange;
18
+ export declare class Timeline {
19
+ /**
20
+ * Multiplies the speed at which `play()` progresses through the Timeline
21
+ *
22
+ * A value of 2 would double progression speed while .25 would slow it to a quarter
23
+ */
24
+ timeScale: number;
25
+ get currentTime(): number;
26
+ set currentTime(v: number);
27
+ get isPlaying(): boolean;
28
+ get end(): TimelinePoint;
29
+ private _currentTime;
30
+ private _endPosition;
31
+ private interval;
32
+ private points;
33
+ private endAction;
34
+ private ranges;
35
+ private currentSortDirection;
36
+ private smoothSeeker;
37
+ private seeking;
38
+ readonly start: TimelinePoint;
39
+ private positionHandlers;
40
+ constructor();
41
+ /**
42
+ * @param autoplay Pass `true` to begin playing at (1000 x this.timeScale) units per second immediately on creation
43
+ */
44
+ constructor(autoplay: boolean);
45
+ /**
46
+ * Creates a Timeline that begins playing immediately at (1000 x this.timeScale) units per second
47
+ * @param autoplayFps Specifies frames per second
48
+ */
49
+ constructor(autoplayFps: number);
50
+ /**
51
+ * @param autoplay If this argument is `true`, the Timeline will begin playing immediately on creation. If the argument is a number, the Timeline will begin playing at the specified frames per second
52
+ * @param endAction Specifies what should happen when the final position is passed by `play()`/`autoplay`
53
+ *
54
+ * `"pause"`: **(default)** the Timeline will pause at its final position
55
+ * `"continue"`: The Timeline will continue progressing beyond its final position
56
+ * `"restart"`: The Timeline will seek back to 0 then forward to account for any overshoot and continue progressing
57
+ * `"wrap"`: The Timeline's position will continue to increase beyond the final position, but Points and Ranges will be activated as if looping
58
+ * `{restartAt: number}`: Like `"restart"` but seeking back to `restartAt` instead of 0
59
+ * `{wrapAt: number}`: Like `"wrap"` but as if restarting at `wrapAt` instead of 0
60
+ */
61
+ constructor(autoplay: boolean | number, endAction: {
62
+ wrapAt: number;
63
+ } | {
64
+ restartAt: number;
65
+ } | keyof typeof EndAction);
66
+ /**
67
+ * @deprecated "loop" endAction will be removed; use "restart" or `{restartAt: 0}` (disambiguates new looping strategies)
68
+ */
69
+ constructor(autoplay: boolean | number, endAction: "loop");
70
+ /**
71
+ * Defines a single point on the Timeline
72
+ *
73
+ * @param position
74
+ * @returns A point on the Timeline as specified
75
+ *
76
+ * Listenable: this point will emit a PointEvent whenever a `seek()` reaches or passes it
77
+ */
78
+ point(position: number): TimelinePoint;
79
+ /**
80
+ * Defines a range on this Timeline
81
+ *
82
+ * @param start The position on this Timeline at which the range starts
83
+ * @param duration Length of the resulting range - if omitted, the range will end at the Timeline's **current** final position
84
+ * @returns A range on the Timeline
85
+ *
86
+ * Listenable: this range will emit a progression value (0..1) when a `seek()` passes or intersects it
87
+ */
88
+ range(start: number | TimelinePoint, duration?: number): TimelineRange;
89
+ /**
90
+ * Creates an observable range from position 0 to the Timeline's **current** final position
91
+ */
92
+ range(): TimelineRange;
93
+ private getWrappedPosition;
94
+ /**
95
+ * Seeks the Timeline to a specified position, triggering in order any point and range subscriptions between its current and new positions
96
+ * @param toPosition
97
+ */
98
+ seek(toPosition: number | TimelinePoint): void;
99
+ /**
100
+ * Smooth-seeks to a specified position
101
+ *
102
+ * Aborts and replaces any on-going smooth-seek process on this Timeline
103
+ * @param toPosition
104
+ * @param duration Duration of the smooth-seek process in milliseconds
105
+ * @param easer Optional easing function for the smooth-seek process
106
+ * @returns A promise, resolved when the smooth-seek process finishes
107
+ */
108
+ seek(toPosition: number | TimelinePoint, duration: number, easer?: Easer | keyof typeof easers): Promise<void>;
109
+ private seekDirect;
110
+ private seekPoints;
111
+ private seekRanges;
112
+ private sortEntries;
113
+ /**
114
+ * Starts progression of the Timeline from its current position at (1000 x this.timeScale) units per second
115
+ */
116
+ play(): void;
117
+ play(fps: number): void;
118
+ pause(): void;
119
+ /**
120
+ * Progresses the Timeline by 1 unit
121
+ * @param delta
122
+ * @deprecated Use timeline.position++
123
+ */
124
+ step(): void;
125
+ /**
126
+ * Progresses the Timeline by a given delta
127
+ * @param delta
128
+ * @deprecated Use timeline.position += n
129
+ */
130
+ step(delta: number): void;
131
+ tween<T extends Tweenable>(start: number | TimelinePoint, duration: number, apply: (v: Widen<T>) => void, from: T, to: T, easer?: Easer): ChainingInterface;
132
+ tween<T extends Tweenable>(start: number | TimelinePoint, end: TimelinePoint, // ease migration for tl.tween(0, tl.end, ...)
133
+ apply: (v: Widen<T>) => void, from: T, to: T, easer?: Easer): ChainingInterface;
134
+ at(position: number | TimelinePoint, action?: () => void, reverse?: boolean | (() => void)): ChainingInterface;
135
+ private createChainingInterface;
136
+ /**
137
+ * @deprecated use `timeline.currentTime`
138
+ */
139
+ get position(): number;
140
+ }
141
+ export interface ChainingInterface {
142
+ thenTween(duration: number, apply: (v: number) => void, from?: number, to?: number, easer?: Easer): ChainingInterface;
143
+ then(action: () => void): ChainingInterface;
144
+ thenWait(duration: number): ChainingInterface;
145
+ readonly end: TimelinePoint;
146
+ }
147
+ export {};