@esotericsoftware/spine-core 4.1.25 → 4.1.28

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.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/Animation.d.ts +382 -0
  3. package/dist/Animation.js +2052 -0
  4. package/dist/AnimationState.d.ts +398 -0
  5. package/dist/AnimationState.js +1096 -0
  6. package/dist/AnimationStateData.d.ts +51 -0
  7. package/dist/AnimationStateData.js +70 -0
  8. package/dist/AssetManagerBase.d.ts +75 -0
  9. package/dist/AssetManagerBase.js +320 -0
  10. package/dist/AtlasAttachmentLoader.d.ts +53 -0
  11. package/dist/AtlasAttachmentLoader.js +92 -0
  12. package/dist/Bone.d.ts +138 -0
  13. package/dist/Bone.js +336 -0
  14. package/dist/BoneData.d.ts +72 -0
  15. package/dist/BoneData.js +80 -0
  16. package/dist/ConstraintData.d.ts +35 -0
  17. package/dist/ConstraintData.js +37 -0
  18. package/dist/Event.d.ts +44 -0
  19. package/dist/Event.js +48 -0
  20. package/dist/EventData.d.ts +41 -0
  21. package/dist/EventData.js +43 -0
  22. package/dist/IkConstraint.d.ts +64 -0
  23. package/dist/IkConstraint.js +303 -0
  24. package/dist/IkConstraintData.d.ts +56 -0
  25. package/dist/IkConstraintData.js +63 -0
  26. package/dist/PathConstraint.d.ts +71 -0
  27. package/dist/PathConstraint.js +476 -0
  28. package/dist/PathConstraintData.d.ts +82 -0
  29. package/dist/PathConstraintData.js +91 -0
  30. package/dist/Skeleton.d.ts +163 -0
  31. package/dist/Skeleton.js +588 -0
  32. package/dist/SkeletonBinary.d.ts +68 -0
  33. package/dist/SkeletonBinary.js +1172 -0
  34. package/dist/SkeletonBounds.d.ts +77 -0
  35. package/dist/SkeletonBounds.js +219 -0
  36. package/dist/SkeletonClipping.d.ts +50 -0
  37. package/dist/SkeletonClipping.js +326 -0
  38. package/dist/SkeletonData.d.ts +114 -0
  39. package/dist/SkeletonData.js +190 -0
  40. package/dist/SkeletonJson.d.ts +53 -0
  41. package/dist/SkeletonJson.js +1027 -0
  42. package/dist/Skin.d.ts +71 -0
  43. package/dist/Skin.js +201 -0
  44. package/dist/Slot.d.ts +69 -0
  45. package/dist/Slot.js +93 -0
  46. package/dist/SlotData.d.ts +57 -0
  47. package/dist/SlotData.js +64 -0
  48. package/dist/Texture.d.ts +69 -0
  49. package/dist/Texture.js +73 -0
  50. package/dist/TextureAtlas.d.ts +68 -0
  51. package/dist/TextureAtlas.js +267 -0
  52. package/dist/TransformConstraint.d.ts +60 -0
  53. package/dist/TransformConstraint.js +247 -0
  54. package/dist/TransformConstraintData.d.ts +62 -0
  55. package/dist/TransformConstraintData.js +69 -0
  56. package/dist/Triangulator.d.ts +43 -0
  57. package/dist/Triangulator.js +244 -0
  58. package/dist/Updatable.d.ts +37 -0
  59. package/dist/Updatable.js +30 -0
  60. package/dist/Utils.d.ts +168 -0
  61. package/dist/Utils.js +404 -0
  62. package/dist/attachments/Attachment.d.ts +72 -0
  63. package/dist/attachments/Attachment.js +147 -0
  64. package/dist/attachments/AttachmentLoader.d.ts +54 -0
  65. package/dist/attachments/AttachmentLoader.js +30 -0
  66. package/dist/attachments/BoundingBoxAttachment.d.ts +40 -0
  67. package/dist/attachments/BoundingBoxAttachment.js +48 -0
  68. package/dist/attachments/ClippingAttachment.d.ts +42 -0
  69. package/dist/attachments/ClippingAttachment.js +51 -0
  70. package/dist/attachments/HasTextureRegion.d.ts +44 -0
  71. package/dist/attachments/HasTextureRegion.js +30 -0
  72. package/dist/attachments/MeshAttachment.d.ts +79 -0
  73. package/dist/attachments/MeshAttachment.js +188 -0
  74. package/dist/attachments/PathAttachment.d.ts +47 -0
  75. package/dist/attachments/PathAttachment.js +59 -0
  76. package/dist/attachments/PointAttachment.d.ts +48 -0
  77. package/dist/attachments/PointAttachment.js +66 -0
  78. package/dist/attachments/RegionAttachment.d.ts +110 -0
  79. package/dist/attachments/RegionAttachment.js +213 -0
  80. package/dist/attachments/Sequence.d.ts +55 -0
  81. package/dist/attachments/Sequence.js +91 -0
  82. package/dist/attachments/index.d.ts +8 -0
  83. package/dist/attachments/index.js +9 -0
  84. package/dist/iife/spine-core.js +10708 -0
  85. package/dist/iife/spine-core.js.map +7 -0
  86. package/dist/iife/spine-core.min.js +2 -0
  87. package/dist/index.d.ts +39 -0
  88. package/dist/index.js +40 -0
  89. package/dist/polyfills.d.ts +29 -0
  90. package/dist/polyfills.js +39 -0
  91. package/package.json +1 -1
@@ -0,0 +1,398 @@
1
+ /******************************************************************************
2
+ * Spine Runtimes License Agreement
3
+ * Last updated September 24, 2021. Replaces all prior versions.
4
+ *
5
+ * Copyright (c) 2013-2021, Esoteric Software LLC
6
+ *
7
+ * Integration of the Spine Runtimes into software or otherwise creating
8
+ * derivative works of the Spine Runtimes is permitted under the terms and
9
+ * conditions of Section 2 of the Spine Editor License Agreement:
10
+ * http://esotericsoftware.com/spine-editor-license
11
+ *
12
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
13
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
14
+ * "Products"), provided that each user of the Products must obtain their own
15
+ * Spine Editor license and redistribution of the Products in any form must
16
+ * include this license and copyright notice.
17
+ *
18
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
19
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
24
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *****************************************************************************/
29
+ import { Animation, MixBlend, AttachmentTimeline, RotateTimeline } from "./Animation";
30
+ import { AnimationStateData } from "./AnimationStateData";
31
+ import { Skeleton } from "./Skeleton";
32
+ import { Slot } from "./Slot";
33
+ import { StringSet, Pool } from "./Utils";
34
+ import { Event } from "./Event";
35
+ /** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies
36
+ * multiple animations on top of each other (layering).
37
+ *
38
+ * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */
39
+ export declare class AnimationState {
40
+ static _emptyAnimation: Animation;
41
+ private static emptyAnimation;
42
+ /** The AnimationStateData to look up mix durations. */
43
+ data: AnimationStateData;
44
+ /** The list of tracks that currently have animations, which may contain null entries. */
45
+ tracks: (TrackEntry | null)[];
46
+ /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower
47
+ * or faster. Defaults to 1.
48
+ *
49
+ * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */
50
+ timeScale: number;
51
+ unkeyedState: number;
52
+ events: Event[];
53
+ listeners: AnimationStateListener[];
54
+ queue: EventQueue;
55
+ propertyIDs: StringSet;
56
+ animationsChanged: boolean;
57
+ trackEntryPool: Pool<TrackEntry>;
58
+ constructor(data: AnimationStateData);
59
+ /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */
60
+ update(delta: number): void;
61
+ /** Returns true when all mixing from entries are complete. */
62
+ updateMixingFrom(to: TrackEntry, delta: number): boolean;
63
+ /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the
64
+ * animation state can be applied to multiple skeletons to pose them identically.
65
+ * @returns True if any animations were applied. */
66
+ apply(skeleton: Skeleton): boolean;
67
+ applyMixingFrom(to: TrackEntry, skeleton: Skeleton, blend: MixBlend): number;
68
+ applyAttachmentTimeline(timeline: AttachmentTimeline, skeleton: Skeleton, time: number, blend: MixBlend, attachments: boolean): void;
69
+ setAttachment(skeleton: Skeleton, slot: Slot, attachmentName: string | null, attachments: boolean): void;
70
+ applyRotateTimeline(timeline: RotateTimeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
71
+ queueEvents(entry: TrackEntry, animationTime: number): void;
72
+ /** Removes all animations from all tracks, leaving skeletons in their current pose.
73
+ *
74
+ * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,
75
+ * rather than leaving them in their current pose. */
76
+ clearTracks(): void;
77
+ /** Removes all animations from the track, leaving skeletons in their current pose.
78
+ *
79
+ * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,
80
+ * rather than leaving them in their current pose. */
81
+ clearTrack(trackIndex: number): void;
82
+ setCurrent(index: number, current: TrackEntry, interrupt: boolean): void;
83
+ /** Sets an animation by name.
84
+ *
85
+ * See {@link #setAnimationWith()}. */
86
+ setAnimation(trackIndex: number, animationName: string, loop?: boolean): TrackEntry;
87
+ /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never
88
+ * applied to a skeleton, it is replaced (not mixed from).
89
+ * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
90
+ * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.
91
+ * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept
92
+ * after the {@link AnimationStateListener#dispose()} event occurs. */
93
+ setAnimationWith(trackIndex: number, animation: Animation, loop?: boolean): TrackEntry;
94
+ /** Queues an animation by name.
95
+ *
96
+ * See {@link #addAnimationWith()}. */
97
+ addAnimation(trackIndex: number, animationName: string, loop?: boolean, delay?: number): TrackEntry;
98
+ /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is
99
+ * equivalent to calling {@link #setAnimationWith()}.
100
+ * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry
101
+ * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix
102
+ * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the
103
+ * previous entry is looping, its next loop completion is used instead of its duration.
104
+ * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept
105
+ * after the {@link AnimationStateListener#dispose()} event occurs. */
106
+ addAnimationWith(trackIndex: number, animation: Animation, loop?: boolean, delay?: number): TrackEntry;
107
+ /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's
108
+ * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.
109
+ *
110
+ * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},
111
+ * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes
112
+ * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation
113
+ * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of
114
+ * 0 still mixes out over one frame.
115
+ *
116
+ * Mixing in is done by first setting an empty animation, then adding an animation using
117
+ * {@link #addAnimation()} and on the returned track entry, set the
118
+ * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and
119
+ * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the
120
+ * setup pose value if no lower tracks key the property to the value keyed in the new animation. */
121
+ setEmptyAnimation(trackIndex: number, mixDuration?: number): TrackEntry;
122
+ /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's
123
+ * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling
124
+ * {@link #setEmptyAnimation()}.
125
+ *
126
+ * See {@link #setEmptyAnimation()}.
127
+ * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry
128
+ * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or
129
+ * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next
130
+ * loop completion is used instead of its duration.
131
+ * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
132
+ * after the {@link AnimationStateListener#dispose()} event occurs. */
133
+ addEmptyAnimation(trackIndex: number, mixDuration?: number, delay?: number): TrackEntry;
134
+ /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix
135
+ * duration. */
136
+ setEmptyAnimations(mixDuration?: number): void;
137
+ expandToIndex(index: number): TrackEntry | null;
138
+ /** @param last May be null. */
139
+ trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry | null): TrackEntry;
140
+ /** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
141
+ clearNext(entry: TrackEntry): void;
142
+ _animationsChanged(): void;
143
+ computeHold(entry: TrackEntry): void;
144
+ /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */
145
+ getCurrent(trackIndex: number): TrackEntry | null;
146
+ /** Adds a listener to receive events for all track entries. */
147
+ addListener(listener: AnimationStateListener): void;
148
+ /** Removes the listener added with {@link #addListener()}. */
149
+ removeListener(listener: AnimationStateListener): void;
150
+ /** Removes all listeners added with {@link #addListener()}. */
151
+ clearListeners(): void;
152
+ /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an
153
+ * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery
154
+ * are not wanted because new animations are being set. */
155
+ clearListenerNotifications(): void;
156
+ }
157
+ /** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.
158
+ *
159
+ * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */
160
+ export declare class TrackEntry {
161
+ /** The animation to apply for this track entry. */
162
+ animation: Animation | null;
163
+ previous: TrackEntry | null;
164
+ /** The animation queued to start after this animation, or null. `next` makes up a linked list. */
165
+ next: TrackEntry | null;
166
+ /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no
167
+ * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */
168
+ mixingFrom: TrackEntry | null;
169
+ /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is
170
+ * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */
171
+ mixingTo: TrackEntry | null;
172
+ /** The listener for events generated by this track entry, or null.
173
+ *
174
+ * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation
175
+ * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */
176
+ listener: AnimationStateListener | null;
177
+ /** The index of the track where this track entry is either current or queued.
178
+ *
179
+ * See {@link AnimationState#getCurrent()}. */
180
+ trackIndex: number;
181
+ /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
182
+ * duration. */
183
+ loop: boolean;
184
+ /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead
185
+ * of being mixed out.
186
+ *
187
+ * When mixing between animations that key the same property, if a lower track also keys that property then the value will
188
+ * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
189
+ * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation
190
+ * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
191
+ * keys the property, only when a higher track also keys the property.
192
+ *
193
+ * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the
194
+ * previous animation. */
195
+ holdPrevious: boolean;
196
+ reverse: boolean;
197
+ shortestRotation: boolean;
198
+ /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the
199
+ * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event
200
+ * timelines are not applied while this animation is being mixed out. */
201
+ eventThreshold: number;
202
+ /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the
203
+ * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to
204
+ * 0, so attachment timelines are not applied while this animation is being mixed out. */
205
+ attachmentThreshold: number;
206
+ /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the
207
+ * `drawOrderThreshold`, draw order timelines are applied while this animation is being mixed out. Defaults to 0,
208
+ * so draw order timelines are not applied while this animation is being mixed out. */
209
+ drawOrderThreshold: number;
210
+ /** Seconds when this animation starts, both initially and after looping. Defaults to 0.
211
+ *
212
+ * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same
213
+ * value to prevent timeline keys before the start time from triggering. */
214
+ animationStart: number;
215
+ /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
216
+ * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */
217
+ animationEnd: number;
218
+ /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
219
+ * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and
220
+ * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation
221
+ * is applied. */
222
+ animationLast: number;
223
+ nextAnimationLast: number;
224
+ /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`
225
+ * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from
226
+ * the start of the previous animation to when this track entry will become the current track entry (ie when the previous
227
+ * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).
228
+ *
229
+ * {@link #timeScale} affects the delay. */
230
+ delay: number;
231
+ /** Current time in seconds this track entry has been the current track entry. The track time determines
232
+ * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting
233
+ * looping. */
234
+ trackTime: number;
235
+ trackLast: number;
236
+ nextTrackLast: number;
237
+ /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float
238
+ * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time
239
+ * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the
240
+ * properties keyed by the animation are set to the setup pose and the track is cleared.
241
+ *
242
+ * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation
243
+ * abruptly cease being applied. */
244
+ trackEnd: number;
245
+ /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or
246
+ * faster. Defaults to 1.
247
+ *
248
+ * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to
249
+ * match the animation speed.
250
+ *
251
+ * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the
252
+ * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If
253
+ * the time scale is not 1, the delay may need to be adjusted.
254
+ *
255
+ * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */
256
+ timeScale: number;
257
+ /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults
258
+ * to 1, which overwrites the skeleton's current pose with this animation.
259
+ *
260
+ * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to
261
+ * use alpha on track 0 if the skeleton pose is from the last frame render. */
262
+ alpha: number;
263
+ /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be
264
+ * slightly more than `mixDuration` when the mix is complete. */
265
+ mixTime: number;
266
+ /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData
267
+ * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).
268
+ *
269
+ * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the
270
+ * properties it was animating.
271
+ *
272
+ * The `mixDuration` can be set manually rather than use the value from
273
+ * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new
274
+ * track entry only before {@link AnimationState#update(float)} is first called.
275
+ *
276
+ * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the
277
+ * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set
278
+ * afterward. */
279
+ mixDuration: number;
280
+ interruptAlpha: number;
281
+ totalAlpha: number;
282
+ /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which
283
+ * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to
284
+ * the values from the lower tracks.
285
+ *
286
+ * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first
287
+ * called. */
288
+ mixBlend: MixBlend;
289
+ timelineMode: number[];
290
+ timelineHoldMix: TrackEntry[];
291
+ timelinesRotation: number[];
292
+ reset(): void;
293
+ /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}
294
+ * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the
295
+ * `animationStart` time. */
296
+ getAnimationTime(): number;
297
+ setAnimationLast(animationLast: number): void;
298
+ /** Returns true if at least one loop has been completed.
299
+ *
300
+ * See {@link AnimationStateListener#complete()}. */
301
+ isComplete(): boolean;
302
+ /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
303
+ * long way around when using {@link #alpha} and starting animations on other tracks.
304
+ *
305
+ * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:
306
+ * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long
307
+ * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the
308
+ * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */
309
+ resetRotationDirections(): void;
310
+ getTrackComplete(): number;
311
+ }
312
+ export declare class EventQueue {
313
+ objects: Array<any>;
314
+ drainDisabled: boolean;
315
+ animState: AnimationState;
316
+ constructor(animState: AnimationState);
317
+ start(entry: TrackEntry): void;
318
+ interrupt(entry: TrackEntry): void;
319
+ end(entry: TrackEntry): void;
320
+ dispose(entry: TrackEntry): void;
321
+ complete(entry: TrackEntry): void;
322
+ event(entry: TrackEntry, event: Event): void;
323
+ drain(): void;
324
+ clear(): void;
325
+ }
326
+ export declare enum EventType {
327
+ start = 0,
328
+ interrupt = 1,
329
+ end = 2,
330
+ dispose = 3,
331
+ complete = 4,
332
+ event = 5
333
+ }
334
+ /** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving
335
+ * events.
336
+ *
337
+ * See TrackEntry {@link TrackEntry#listener} and AnimationState
338
+ * {@link AnimationState#addListener()}. */
339
+ export interface AnimationStateListener {
340
+ /** Invoked when this entry has been set as the current entry. */
341
+ start?: (entry: TrackEntry) => void;
342
+ /** Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for
343
+ * mixing. */
344
+ interrupt?: (entry: TrackEntry) => void;
345
+ /** Invoked when this entry is no longer the current entry and will never be applied again. */
346
+ end?: (entry: TrackEntry) => void;
347
+ /** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.
348
+ * References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */
349
+ dispose?: (entry: TrackEntry) => void;
350
+ /** Invoked every time this entry's animation completes a loop. */
351
+ complete?: (entry: TrackEntry) => void;
352
+ /** Invoked when this entry's animation triggers an event. */
353
+ event?: (entry: TrackEntry, event: Event) => void;
354
+ }
355
+ export declare abstract class AnimationStateAdapter implements AnimationStateListener {
356
+ start(entry: TrackEntry): void;
357
+ interrupt(entry: TrackEntry): void;
358
+ end(entry: TrackEntry): void;
359
+ dispose(entry: TrackEntry): void;
360
+ complete(entry: TrackEntry): void;
361
+ event(entry: TrackEntry, event: Event): void;
362
+ }
363
+ /** 1. A previously applied timeline has set this property.
364
+ *
365
+ * Result: Mix from the current pose to the timeline pose. */
366
+ export declare const SUBSEQUENT = 0;
367
+ /** 1. This is the first timeline to set this property.
368
+ * 2. The next track entry applied after this one does not have a timeline to set this property.
369
+ *
370
+ * Result: Mix from the setup pose to the timeline pose. */
371
+ export declare const FIRST = 1;
372
+ /** 1) A previously applied timeline has set this property.<br>
373
+ * 2) The next track entry to be applied does have a timeline to set this property.<br>
374
+ * 3) The next track entry after that one does not have a timeline to set this property.<br>
375
+ * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading
376
+ * animations that key the same property. A subsequent timeline will set this property using a mix. */
377
+ export declare const HOLD_SUBSEQUENT = 2;
378
+ /** 1) This is the first timeline to set this property.<br>
379
+ * 2) The next track entry to be applied does have a timeline to set this property.<br>
380
+ * 3) The next track entry after that one does not have a timeline to set this property.<br>
381
+ * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading animations
382
+ * that key the same property. A subsequent timeline will set this property using a mix. */
383
+ export declare const HOLD_FIRST = 3;
384
+ /** 1. This is the first timeline to set this property.
385
+ * 2. The next track entry to be applied does have a timeline to set this property.
386
+ * 3. The next track entry after that one does have a timeline to set this property.
387
+ * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.
388
+ *
389
+ * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than
390
+ * 2 track entries in a row have a timeline that sets the same property.
391
+ *
392
+ * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid
393
+ * "dipping" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A
394
+ * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into
395
+ * place. */
396
+ export declare const HOLD_MIX = 4;
397
+ export declare const SETUP = 1;
398
+ export declare const CURRENT = 2;