animation.d.ts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. import type { IEasingFunction, EasingFunction } from "./easing";
  2. import { Vector3, Quaternion, Vector2, Matrix } from "../Maths/math.vector";
  3. import { Color3, Color4 } from "../Maths/math.color";
  4. import type { DeepImmutable, Nullable } from "../types";
  5. import type { Scene } from "../scene";
  6. import type { IAnimationKey } from "./animationKey";
  7. import { AnimationRange } from "./animationRange";
  8. import type { AnimationEvent } from "./animationEvent";
  9. import { Node } from "../node";
  10. import type { IAnimatable } from "./animatable.interface";
  11. import { Size } from "../Maths/math.size";
  12. import type { Animatable } from "./animatable";
  13. import type { RuntimeAnimation } from "./runtimeAnimation";
  14. export declare const _staticOffsetValueQuaternion: DeepImmutable<Quaternion>;
  15. export declare const _staticOffsetValueVector3: DeepImmutable<Vector3>;
  16. export declare const _staticOffsetValueVector2: DeepImmutable<Vector2>;
  17. export declare const _staticOffsetValueSize: DeepImmutable<Size>;
  18. export declare const _staticOffsetValueColor3: DeepImmutable<Color3>;
  19. export declare const _staticOffsetValueColor4: DeepImmutable<Color4>;
  20. /**
  21. * Options to be used when creating an additive animation
  22. */
  23. export interface IMakeAnimationAdditiveOptions {
  24. /**
  25. * The frame that the animation should be relative to (if not provided, 0 will be used)
  26. */
  27. referenceFrame?: number;
  28. /**
  29. * The name of the animation range to convert to additive. If not provided, fromFrame / toFrame will be used
  30. * If fromFrame / toFrame are not provided either, the whole animation will be converted to additive
  31. */
  32. range?: string;
  33. /**
  34. * If true, the original animation will be cloned and converted to additive. If false, the original animation will be converted to additive (default is false)
  35. */
  36. cloneOriginalAnimation?: boolean;
  37. /**
  38. * The name of the cloned animation if cloneOriginalAnimation is true. If not provided, use the original animation name
  39. */
  40. clonedAnimationName?: string;
  41. /**
  42. * Together with toFrame, defines the range of the animation to convert to additive. Will only be used if range is not provided
  43. * If range and fromFrame / toFrame are not provided, the whole animation will be converted to additive
  44. */
  45. fromFrame?: number;
  46. /**
  47. * Together with fromFrame, defines the range of the animation to convert to additive.
  48. */
  49. toFrame?: number;
  50. /**
  51. * If true, the key frames will be clipped to the range specified by range or fromFrame / toFrame (default is false)
  52. */
  53. clipKeys?: boolean;
  54. }
  55. /**
  56. * @internal
  57. */
  58. export interface _IAnimationState {
  59. key: number;
  60. repeatCount: number;
  61. workValue?: any;
  62. loopMode?: number;
  63. offsetValue?: any;
  64. highLimitValue?: any;
  65. }
  66. /**
  67. * Class used to store any kind of animation
  68. */
  69. export declare class Animation {
  70. /**Name of the animation */
  71. name: string;
  72. /**Property to animate */
  73. targetProperty: string;
  74. /**The frames per second of the animation */
  75. framePerSecond: number;
  76. /**The data type of the animation */
  77. dataType: number;
  78. /**The loop mode of the animation */
  79. loopMode?: number | undefined;
  80. /**Specifies if blending should be enabled */
  81. enableBlending?: boolean | undefined;
  82. private static _UniqueIdGenerator;
  83. /**
  84. * Use matrix interpolation instead of using direct key value when animating matrices
  85. */
  86. static AllowMatricesInterpolation: boolean;
  87. /**
  88. * When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower
  89. */
  90. static AllowMatrixDecomposeForInterpolation: boolean;
  91. /**
  92. * Gets or sets the unique id of the animation (the uniqueness is solely among other animations)
  93. */
  94. uniqueId: number;
  95. /** Define the Url to load snippets */
  96. static SnippetUrl: string;
  97. /** Snippet ID if the animation was created from the snippet server */
  98. snippetId: string;
  99. /**
  100. * Stores the key frames of the animation
  101. */
  102. private _keys;
  103. /**
  104. * Stores the easing function of the animation
  105. */
  106. private _easingFunction;
  107. /**
  108. * @internal Internal use only
  109. */
  110. _runtimeAnimations: RuntimeAnimation[];
  111. /**
  112. * The set of event that will be linked to this animation
  113. */
  114. private _events;
  115. /**
  116. * Stores an array of target property paths
  117. */
  118. targetPropertyPath: string[];
  119. /**
  120. * Stores the blending speed of the animation
  121. */
  122. blendingSpeed: number;
  123. /**
  124. * Stores the animation ranges for the animation
  125. */
  126. private _ranges;
  127. /**
  128. * @internal Internal use
  129. */
  130. static _PrepareAnimation(name: string, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): Nullable<Animation>;
  131. /**
  132. * Sets up an animation
  133. * @param property The property to animate
  134. * @param animationType The animation type to apply
  135. * @param framePerSecond The frames per second of the animation
  136. * @param easingFunction The easing function used in the animation
  137. * @returns The created animation
  138. */
  139. static CreateAnimation(property: string, animationType: number, framePerSecond: number, easingFunction: EasingFunction): Animation;
  140. /**
  141. * Create and start an animation on a node
  142. * @param name defines the name of the global animation that will be run on all nodes
  143. * @param target defines the target where the animation will take place
  144. * @param targetProperty defines property to animate
  145. * @param framePerSecond defines the number of frame per second yo use
  146. * @param totalFrame defines the number of frames in total
  147. * @param from defines the initial value
  148. * @param to defines the final value
  149. * @param loopMode defines which loop mode you want to use (off by default)
  150. * @param easingFunction defines the easing function to use (linear by default)
  151. * @param onAnimationEnd defines the callback to call when animation end
  152. * @param scene defines the hosting scene
  153. * @returns the animatable created for this animation
  154. */
  155. static CreateAndStartAnimation(name: string, target: any, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void, scene?: Scene): Nullable<Animatable>;
  156. /**
  157. * Create and start an animation on a node and its descendants
  158. * @param name defines the name of the global animation that will be run on all nodes
  159. * @param node defines the root node where the animation will take place
  160. * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used
  161. * @param targetProperty defines property to animate
  162. * @param framePerSecond defines the number of frame per second to use
  163. * @param totalFrame defines the number of frames in total
  164. * @param from defines the initial value
  165. * @param to defines the final value
  166. * @param loopMode defines which loop mode you want to use (off by default)
  167. * @param easingFunction defines the easing function to use (linear by default)
  168. * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)
  169. * @returns the list of animatables created for all nodes
  170. * @example https://www.babylonjs-playground.com/#MH0VLI
  171. */
  172. static CreateAndStartHierarchyAnimation(name: string, node: Node, directDescendantsOnly: boolean, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Nullable<Animatable[]>;
  173. /**
  174. * Creates a new animation, merges it with the existing animations and starts it
  175. * @param name Name of the animation
  176. * @param node Node which contains the scene that begins the animations
  177. * @param targetProperty Specifies which property to animate
  178. * @param framePerSecond The frames per second of the animation
  179. * @param totalFrame The total number of frames
  180. * @param from The frame at the beginning of the animation
  181. * @param to The frame at the end of the animation
  182. * @param loopMode Specifies the loop mode of the animation
  183. * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations
  184. * @param onAnimationEnd Callback to run once the animation is complete
  185. * @returns Nullable animation
  186. */
  187. static CreateMergeAndStartAnimation(name: string, node: Node, targetProperty: string, framePerSecond: number, totalFrame: number, from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Nullable<Animatable>;
  188. /**
  189. * Convert the keyframes of an animation to be relative to a given reference frame.
  190. * @param sourceAnimation defines the Animation containing keyframes to convert
  191. * @param referenceFrame defines the frame that keyframes in the range will be relative to (default: 0)
  192. * @param range defines the name of the AnimationRange belonging to the Animation to convert
  193. * @param cloneOriginal defines whether or not to clone the animation and convert the clone or convert the original animation (default is false)
  194. * @param clonedName defines the name of the resulting cloned Animation if cloneOriginal is true
  195. * @returns a new Animation if cloneOriginal is true or the original Animation if cloneOriginal is false
  196. */
  197. static MakeAnimationAdditive(sourceAnimation: Animation, referenceFrame?: number, range?: string, cloneOriginal?: boolean, clonedName?: string): Animation;
  198. /**
  199. * Convert the keyframes of an animation to be relative to a given reference frame.
  200. * @param sourceAnimation defines the Animation containing keyframes to convert
  201. * @param options defines the options to use when converting ey keyframes
  202. * @returns a new Animation if options.cloneOriginalAnimation is true or the original Animation if options.cloneOriginalAnimation is false
  203. */
  204. static MakeAnimationAdditive(sourceAnimation: Animation, options?: IMakeAnimationAdditiveOptions): Animation;
  205. /**
  206. * Transition property of an host to the target Value
  207. * @param property The property to transition
  208. * @param targetValue The target Value of the property
  209. * @param host The object where the property to animate belongs
  210. * @param scene Scene used to run the animation
  211. * @param frameRate Framerate (in frame/s) to use
  212. * @param transition The transition type we want to use
  213. * @param duration The duration of the animation, in milliseconds
  214. * @param onAnimationEnd Callback trigger at the end of the animation
  215. * @returns Nullable animation
  216. */
  217. static TransitionTo(property: string, targetValue: any, host: any, scene: Scene, frameRate: number, transition: Animation, duration: number, onAnimationEnd?: Nullable<() => void>): Nullable<Animatable>;
  218. /**
  219. * Return the array of runtime animations currently using this animation
  220. */
  221. get runtimeAnimations(): RuntimeAnimation[];
  222. /**
  223. * Specifies if any of the runtime animations are currently running
  224. */
  225. get hasRunningRuntimeAnimations(): boolean;
  226. /**
  227. * Initializes the animation
  228. * @param name Name of the animation
  229. * @param targetProperty Property to animate
  230. * @param framePerSecond The frames per second of the animation
  231. * @param dataType The data type of the animation
  232. * @param loopMode The loop mode of the animation
  233. * @param enableBlending Specifies if blending should be enabled
  234. */
  235. constructor(
  236. /**Name of the animation */
  237. name: string,
  238. /**Property to animate */
  239. targetProperty: string,
  240. /**The frames per second of the animation */
  241. framePerSecond: number,
  242. /**The data type of the animation */
  243. dataType: number,
  244. /**The loop mode of the animation */
  245. loopMode?: number | undefined,
  246. /**Specifies if blending should be enabled */
  247. enableBlending?: boolean | undefined);
  248. /**
  249. * Converts the animation to a string
  250. * @param fullDetails support for multiple levels of logging within scene loading
  251. * @returns String form of the animation
  252. */
  253. toString(fullDetails?: boolean): string;
  254. /**
  255. * Add an event to this animation
  256. * @param event Event to add
  257. */
  258. addEvent(event: AnimationEvent): void;
  259. /**
  260. * Remove all events found at the given frame
  261. * @param frame The frame to remove events from
  262. */
  263. removeEvents(frame: number): void;
  264. /**
  265. * Retrieves all the events from the animation
  266. * @returns Events from the animation
  267. */
  268. getEvents(): AnimationEvent[];
  269. /**
  270. * Creates an animation range
  271. * @param name Name of the animation range
  272. * @param from Starting frame of the animation range
  273. * @param to Ending frame of the animation
  274. */
  275. createRange(name: string, from: number, to: number): void;
  276. /**
  277. * Deletes an animation range by name
  278. * @param name Name of the animation range to delete
  279. * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)
  280. */
  281. deleteRange(name: string, deleteFrames?: boolean): void;
  282. /**
  283. * Gets the animation range by name, or null if not defined
  284. * @param name Name of the animation range
  285. * @returns Nullable animation range
  286. */
  287. getRange(name: string): Nullable<AnimationRange>;
  288. /**
  289. * Gets the key frames from the animation
  290. * @returns The key frames of the animation
  291. */
  292. getKeys(): Array<IAnimationKey>;
  293. /**
  294. * Gets the highest frame of the animation
  295. * @returns Highest frame of the animation
  296. */
  297. getHighestFrame(): number;
  298. /**
  299. * Gets the easing function of the animation
  300. * @returns Easing function of the animation
  301. */
  302. getEasingFunction(): Nullable<IEasingFunction>;
  303. /**
  304. * Sets the easing function of the animation
  305. * @param easingFunction A custom mathematical formula for animation
  306. */
  307. setEasingFunction(easingFunction: Nullable<IEasingFunction>): void;
  308. /**
  309. * Interpolates a scalar linearly
  310. * @param startValue Start value of the animation curve
  311. * @param endValue End value of the animation curve
  312. * @param gradient Scalar amount to interpolate
  313. * @returns Interpolated scalar value
  314. */
  315. floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number;
  316. /**
  317. * Interpolates a scalar cubically
  318. * @param startValue Start value of the animation curve
  319. * @param outTangent End tangent of the animation
  320. * @param endValue End value of the animation curve
  321. * @param inTangent Start tangent of the animation curve
  322. * @param gradient Scalar amount to interpolate
  323. * @returns Interpolated scalar value
  324. */
  325. floatInterpolateFunctionWithTangents(startValue: number, outTangent: number, endValue: number, inTangent: number, gradient: number): number;
  326. /**
  327. * Interpolates a quaternion using a spherical linear interpolation
  328. * @param startValue Start value of the animation curve
  329. * @param endValue End value of the animation curve
  330. * @param gradient Scalar amount to interpolate
  331. * @returns Interpolated quaternion value
  332. */
  333. quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion;
  334. /**
  335. * Interpolates a quaternion cubically
  336. * @param startValue Start value of the animation curve
  337. * @param outTangent End tangent of the animation curve
  338. * @param endValue End value of the animation curve
  339. * @param inTangent Start tangent of the animation curve
  340. * @param gradient Scalar amount to interpolate
  341. * @returns Interpolated quaternion value
  342. */
  343. quaternionInterpolateFunctionWithTangents(startValue: Quaternion, outTangent: Quaternion, endValue: Quaternion, inTangent: Quaternion, gradient: number): Quaternion;
  344. /**
  345. * Interpolates a Vector3 linearly
  346. * @param startValue Start value of the animation curve
  347. * @param endValue End value of the animation curve
  348. * @param gradient Scalar amount to interpolate (value between 0 and 1)
  349. * @returns Interpolated scalar value
  350. */
  351. vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3;
  352. /**
  353. * Interpolates a Vector3 cubically
  354. * @param startValue Start value of the animation curve
  355. * @param outTangent End tangent of the animation
  356. * @param endValue End value of the animation curve
  357. * @param inTangent Start tangent of the animation curve
  358. * @param gradient Scalar amount to interpolate (value between 0 and 1)
  359. * @returns InterpolatedVector3 value
  360. */
  361. vector3InterpolateFunctionWithTangents(startValue: Vector3, outTangent: Vector3, endValue: Vector3, inTangent: Vector3, gradient: number): Vector3;
  362. /**
  363. * Interpolates a Vector2 linearly
  364. * @param startValue Start value of the animation curve
  365. * @param endValue End value of the animation curve
  366. * @param gradient Scalar amount to interpolate (value between 0 and 1)
  367. * @returns Interpolated Vector2 value
  368. */
  369. vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2;
  370. /**
  371. * Interpolates a Vector2 cubically
  372. * @param startValue Start value of the animation curve
  373. * @param outTangent End tangent of the animation
  374. * @param endValue End value of the animation curve
  375. * @param inTangent Start tangent of the animation curve
  376. * @param gradient Scalar amount to interpolate (value between 0 and 1)
  377. * @returns Interpolated Vector2 value
  378. */
  379. vector2InterpolateFunctionWithTangents(startValue: Vector2, outTangent: Vector2, endValue: Vector2, inTangent: Vector2, gradient: number): Vector2;
  380. /**
  381. * Interpolates a size linearly
  382. * @param startValue Start value of the animation curve
  383. * @param endValue End value of the animation curve
  384. * @param gradient Scalar amount to interpolate
  385. * @returns Interpolated Size value
  386. */
  387. sizeInterpolateFunction(startValue: Size, endValue: Size, gradient: number): Size;
  388. /**
  389. * Interpolates a Color3 linearly
  390. * @param startValue Start value of the animation curve
  391. * @param endValue End value of the animation curve
  392. * @param gradient Scalar amount to interpolate
  393. * @returns Interpolated Color3 value
  394. */
  395. color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3;
  396. /**
  397. * Interpolates a Color3 cubically
  398. * @param startValue Start value of the animation curve
  399. * @param outTangent End tangent of the animation
  400. * @param endValue End value of the animation curve
  401. * @param inTangent Start tangent of the animation curve
  402. * @param gradient Scalar amount to interpolate
  403. * @returns interpolated value
  404. */
  405. color3InterpolateFunctionWithTangents(startValue: Color3, outTangent: Color3, endValue: Color3, inTangent: Color3, gradient: number): Color3;
  406. /**
  407. * Interpolates a Color4 linearly
  408. * @param startValue Start value of the animation curve
  409. * @param endValue End value of the animation curve
  410. * @param gradient Scalar amount to interpolate
  411. * @returns Interpolated Color3 value
  412. */
  413. color4InterpolateFunction(startValue: Color4, endValue: Color4, gradient: number): Color4;
  414. /**
  415. * Interpolates a Color4 cubically
  416. * @param startValue Start value of the animation curve
  417. * @param outTangent End tangent of the animation
  418. * @param endValue End value of the animation curve
  419. * @param inTangent Start tangent of the animation curve
  420. * @param gradient Scalar amount to interpolate
  421. * @returns interpolated value
  422. */
  423. color4InterpolateFunctionWithTangents(startValue: Color4, outTangent: Color4, endValue: Color4, inTangent: Color4, gradient: number): Color4;
  424. /**
  425. * @internal Internal use only
  426. */
  427. _getKeyValue(value: any): any;
  428. /**
  429. * Evaluate the animation value at a given frame
  430. * @param currentFrame defines the frame where we want to evaluate the animation
  431. * @returns the animation value
  432. */
  433. evaluate(currentFrame: number): any;
  434. /**
  435. * @internal Internal use only
  436. */
  437. _interpolate(currentFrame: number, state: _IAnimationState, searchClosestKeyOnly?: boolean): any;
  438. /**
  439. * Defines the function to use to interpolate matrices
  440. * @param startValue defines the start matrix
  441. * @param endValue defines the end matrix
  442. * @param gradient defines the gradient between both matrices
  443. * @param result defines an optional target matrix where to store the interpolation
  444. * @returns the interpolated matrix
  445. */
  446. matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number, result?: Matrix): Matrix;
  447. /**
  448. * Makes a copy of the animation
  449. * @returns Cloned animation
  450. */
  451. clone(): Animation;
  452. /**
  453. * Sets the key frames of the animation
  454. * @param values The animation key frames to set
  455. * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)
  456. */
  457. setKeys(values: Array<IAnimationKey>, dontClone?: boolean): void;
  458. /**
  459. * Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame
  460. * @param frame Frame number
  461. * @returns The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key
  462. */
  463. createKeyForFrame(frame: number): number;
  464. /**
  465. * Serializes the animation to an object
  466. * @returns Serialized object
  467. */
  468. serialize(): any;
  469. /**
  470. * Float animation type
  471. */
  472. static readonly ANIMATIONTYPE_FLOAT = 0;
  473. /**
  474. * Vector3 animation type
  475. */
  476. static readonly ANIMATIONTYPE_VECTOR3 = 1;
  477. /**
  478. * Quaternion animation type
  479. */
  480. static readonly ANIMATIONTYPE_QUATERNION = 2;
  481. /**
  482. * Matrix animation type
  483. */
  484. static readonly ANIMATIONTYPE_MATRIX = 3;
  485. /**
  486. * Color3 animation type
  487. */
  488. static readonly ANIMATIONTYPE_COLOR3 = 4;
  489. /**
  490. * Color3 animation type
  491. */
  492. static readonly ANIMATIONTYPE_COLOR4 = 7;
  493. /**
  494. * Vector2 animation type
  495. */
  496. static readonly ANIMATIONTYPE_VECTOR2 = 5;
  497. /**
  498. * Size animation type
  499. */
  500. static readonly ANIMATIONTYPE_SIZE = 6;
  501. /**
  502. * Relative Loop Mode
  503. */
  504. static readonly ANIMATIONLOOPMODE_RELATIVE = 0;
  505. /**
  506. * Cycle Loop Mode
  507. */
  508. static readonly ANIMATIONLOOPMODE_CYCLE = 1;
  509. /**
  510. * Constant Loop Mode
  511. */
  512. static readonly ANIMATIONLOOPMODE_CONSTANT = 2;
  513. /**
  514. * Yoyo Loop Mode
  515. */
  516. static readonly ANIMATIONLOOPMODE_YOYO = 4;
  517. /**
  518. * Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)
  519. */
  520. static readonly ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5;
  521. /**
  522. * @internal
  523. */
  524. static _UniversalLerp(left: any, right: any, amount: number): any;
  525. /**
  526. * Parses an animation object and creates an animation
  527. * @param parsedAnimation Parsed animation object
  528. * @returns Animation object
  529. */
  530. static Parse(parsedAnimation: any): Animation;
  531. /**
  532. * Appends the serialized animations from the source animations
  533. * @param source Source containing the animations
  534. * @param destination Target to store the animations
  535. */
  536. static AppendSerializedAnimations(source: IAnimatable, destination: any): void;
  537. /**
  538. * Creates a new animation or an array of animations from a snippet saved in a remote file
  539. * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)
  540. * @param url defines the url to load from
  541. * @returns a promise that will resolve to the new animation or an array of animations
  542. */
  543. static ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>>;
  544. /**
  545. * Creates an animation or an array of animations from a snippet saved by the Inspector
  546. * @param snippetId defines the snippet to load
  547. * @returns a promise that will resolve to the new animation or a new array of animations
  548. */
  549. static ParseFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>>;
  550. /**
  551. * Creates an animation or an array of animations from a snippet saved by the Inspector
  552. * @deprecated Please use ParseFromSnippetAsync instead
  553. * @param snippetId defines the snippet to load
  554. * @returns a promise that will resolve to the new animation or a new array of animations
  555. */
  556. static CreateFromSnippetAsync: typeof Animation.ParseFromSnippetAsync;
  557. }