Animation.hx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (C)2005-2017 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\Animation.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `Animation` interface of the Web Animations API represents a single animation player and provides playback controls and a timeline for an animation node or source.
  26. Documentation [Animation](https://developer.mozilla.org/en-US/docs/Web/API/Animation) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Animation$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/Animation>
  28. **/
  29. @:native("Animation")
  30. extern class Animation extends EventTarget
  31. {
  32. /**
  33. Gets and sets the `String` used to identify the animation.
  34. **/
  35. var id : String;
  36. /**
  37. Gets and sets the `AnimationEffectReadOnly` associated with this animation. This will usually be a `KeyframeEffect` object.
  38. **/
  39. var effect(default,null) : AnimationEffectReadOnly;
  40. /**
  41. Gets or sets the `AnimationTimeline` associated with this animation.
  42. **/
  43. var timeline(default,null) : AnimationTimeline;
  44. /**
  45. Gets or sets the scheduled time when an animation's playback should begin.
  46. **/
  47. var startTime : Float;
  48. /**
  49. The current time value of the animation in milliseconds, whether running or paused. If the animation lacks a `AnimationTimeline`, is inactive or hasn't been played yet, its value is `null`.
  50. **/
  51. var currentTime : Float;
  52. /**
  53. Gets or sets the playback rate of the animation.
  54. **/
  55. var playbackRate : Float;
  56. /**
  57. Returns an enumerated value describing the playback state of an animation.
  58. **/
  59. var playState(default,null) : AnimationPlayState;
  60. /**
  61. Returns the current ready Promise for this animation.
  62. **/
  63. var ready(default,null) : Promise<Animation>;
  64. /**
  65. Returns the current finished Promise for this animation.
  66. **/
  67. var finished(default,null) : Promise<Animation>;
  68. /**
  69. Gets and sets the event handler for the `finish` event.
  70. **/
  71. var onfinish : haxe.Constraints.Function;
  72. /**
  73. Gets and sets the event handler for the `cancel` event.
  74. **/
  75. var oncancel : haxe.Constraints.Function;
  76. /** @throws DOMError */
  77. function new( ?effect : KeyframeEffectReadOnly, ?timeline : AnimationTimeline ) : Void;
  78. /**
  79. Clears all `KeyframeEffect` caused by this animation and aborts its playback.
  80. **/
  81. function cancel() : Void;
  82. /** @throws DOMError */
  83. /**
  84. Seeks either end of an animation, depending on whether the animation is playing or reversing.
  85. **/
  86. function finish() : Void;
  87. /** @throws DOMError */
  88. /**
  89. Starts or resumes playing of an animation, or begins the animation again if it previously finished.
  90. **/
  91. function play() : Void;
  92. /** @throws DOMError */
  93. /**
  94. Suspends playing of an animation.
  95. **/
  96. function pause() : Void;
  97. /** @throws DOMError */
  98. /**
  99. Reverses playback direction, stopping at the start of the animation. If the animation is finished or unplayed, it will play from end to beginning.
  100. **/
  101. function reverse() : Void;
  102. }