2
0

Animation.hx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright (C)2005-2019 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. import js.lib.Promise;
  25. /**
  26. 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.
  27. 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/).
  28. @see <https://developer.mozilla.org/en-US/docs/Web/API/Animation>
  29. **/
  30. @:native("Animation")
  31. extern class Animation extends EventTarget {
  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 : AnimationEffect;
  40. /**
  41. Gets or sets the `AnimationTimeline` associated with this animation.
  42. **/
  43. var timeline : 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. Indicates whether the animation is currently waiting for an asynchronous operation such as initiating playback or pausing a running animation.
  62. **/
  63. var pending(default,null) : Bool;
  64. /**
  65. Returns the current ready Promise for this animation.
  66. **/
  67. var ready(default,null) : Promise<Animation>;
  68. /**
  69. Returns the current finished Promise for this animation.
  70. **/
  71. var finished(default,null) : Promise<Animation>;
  72. /**
  73. Gets and sets the event handler for the `finish` event.
  74. **/
  75. var onfinish : haxe.Constraints.Function;
  76. /**
  77. Gets and sets the event handler for the `cancel` event.
  78. **/
  79. var oncancel : haxe.Constraints.Function;
  80. /** @throws DOMError */
  81. function new( ?effect : AnimationEffect, ?timeline : AnimationTimeline ) : Void;
  82. /**
  83. Clears all `KeyframeEffect` caused by this animation and aborts its playback.
  84. **/
  85. function cancel() : Void;
  86. /**
  87. Seeks either end of an animation, depending on whether the animation is playing or reversing.
  88. @throws DOMError
  89. **/
  90. function finish() : Void;
  91. /**
  92. Starts or resumes playing of an animation, or begins the animation again if it previously finished.
  93. @throws DOMError
  94. **/
  95. function play() : Void;
  96. /**
  97. Suspends playing of an animation.
  98. @throws DOMError
  99. **/
  100. function pause() : Void;
  101. /**
  102. Sets the speed of an animation after first synchronizing its playback position.
  103. **/
  104. function updatePlaybackRate( playbackRate : Float ) : Void;
  105. /**
  106. Reverses playback direction, stopping at the start of the animation. If the animation is finished or unplayed, it will play from end to beginning.
  107. @throws DOMError
  108. **/
  109. function reverse() : Void;
  110. }