| 1 | /* |
| 2 | * Copyright 2011 Closure Compiler Authors |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | /** |
| 17 | * @fileoverview Definitions for timing control for script base animations. The |
| 18 | * whole file has been fully type annotated. |
| 19 | * |
| 20 | * @see http://www.w3.org/TR/animation-timing/ |
| 21 | * @see http://webstuff.nfshost.com/anim-timing/Overview.html |
| 22 | * @externs |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * @param {function(number)} callback |
| 27 | * @param {Element=} opt_element In early versions of this API, the callback |
| 28 | * was invoked only if the element was visible. |
| 29 | * @return {number} |
| 30 | */ |
| 31 | function requestAnimationFrame(callback, opt_element) {}; |
| 32 | |
| 33 | /** |
| 34 | * @param {number} handle |
| 35 | */ |
| 36 | function cancelRequestAnimationFrame(handle) {}; |
| 37 | |
| 38 | /** |
| 39 | * @param {function(number)} callback |
| 40 | * @param {Element=} opt_element |
| 41 | * @return {number} |
| 42 | */ |
| 43 | function webkitRequestAnimationFrame(callback, opt_element) {}; |
| 44 | |
| 45 | /** |
| 46 | * @param {number} handle |
| 47 | */ |
| 48 | function webkitCancelRequestAnimationFrame(handle) {}; |
| 49 | |
| 50 | /** |
| 51 | * @param {number} handle |
| 52 | */ |
| 53 | function webkitCancelAnimationFrame(handle) {}; |
| 54 | |
| 55 | /** |
| 56 | * @param {?function(number)} callback It's legitimate to pass a null |
| 57 | * callback and listen on the MozBeforePaint event instead. |
| 58 | * @param {Element=} opt_element |
| 59 | * @return {number} |
| 60 | */ |
| 61 | function mozRequestAnimationFrame(callback, opt_element) {}; |
| 62 | |
| 63 | /** |
| 64 | * @param {number} handle |
| 65 | */ |
| 66 | function mozCancelRequestAnimationFrame(handle) {}; |
| 67 | |
| 68 | /** |
| 69 | * @param {number} handle |
| 70 | */ |
| 71 | function mozCancelAnimationFrame(handle) {}; |
| 72 | |
| 73 | /** |
| 74 | * @param {function(number)} callback |
| 75 | * @param {Element=} opt_element |
| 76 | * @return {number} |
| 77 | */ |
| 78 | function msRequestAnimationFrame(callback, opt_element) {}; |
| 79 | |
| 80 | /** |
| 81 | * @param {number} handle |
| 82 | */ |
| 83 | function msCancelRequestAnimationFrame(handle) {}; |
| 84 | |
| 85 | /** |
| 86 | * @param {number} handle |
| 87 | */ |
| 88 | function msCancelAnimationFrame(handle) {}; |
| 89 | |
| 90 | /** |
| 91 | * @param {function(number)} callback |
| 92 | * @param {Element=} opt_element |
| 93 | * @return {number} |
| 94 | */ |
| 95 | function oRequestAnimationFrame(callback, opt_element) {}; |
| 96 | |
| 97 | /** |
| 98 | * @param {number} handle |
| 99 | */ |
| 100 | function oCancelRequestAnimationFrame(handle) {}; |
| 101 | |
| 102 | /** |
| 103 | * @param {number} handle |
| 104 | */ |
| 105 | function oCancelAnimationFrame(handle) {}; |
| 106 | |
| 107 | /** |
| 108 | * @param {function(number)} callback |
| 109 | * @param {Element=} opt_element |
| 110 | * @return {number} |
| 111 | */ |
| 112 | Window.prototype.requestAnimationFrame = function(callback, opt_element) {}; |
| 113 | |
| 114 | /** |
| 115 | * @param {number} handle |
| 116 | */ |
| 117 | Window.prototype.cancelRequestAnimationFrame = function(handle) {}; |
| 118 | |
| 119 | /** |
| 120 | * @param {number} handle |
| 121 | */ |
| 122 | Window.prototype.cancelAnimationFrame = function(handle) {}; |
| 123 | |
| 124 | /** |
| 125 | * @param {function(number)} callback |
| 126 | * @param {Element=} opt_element |
| 127 | * @return {number} |
| 128 | */ |
| 129 | Window.prototype.webkitRequestAnimationFrame = function(callback, opt_element) {}; |
| 130 | |
| 131 | /** |
| 132 | * @param {number} handle |
| 133 | */ |
| 134 | Window.prototype.webkitCancelRequestAnimationFrame = function(handle) {}; |
| 135 | |
| 136 | /** |
| 137 | * @param {number} handle |
| 138 | */ |
| 139 | Window.prototype.webkitCancelAnimationFrame = function(handle) {}; |
| 140 | |
| 141 | /** |
| 142 | * @param {?function(number)} callback It's legitimate to pass a null |
| 143 | * callback and listen on the MozBeforePaint event instead. |
| 144 | * @param {Element=} opt_element |
| 145 | * @return {number} |
| 146 | */ |
| 147 | Window.prototype.mozRequestAnimationFrame = function(callback, opt_element) {}; |
| 148 | |
| 149 | /** |
| 150 | * @param {number} handle |
| 151 | */ |
| 152 | Window.prototype.mozCancelRequestAnimationFrame = function(handle) {}; |
| 153 | |
| 154 | /** |
| 155 | * @param {number} handle |
| 156 | */ |
| 157 | Window.prototype.mozCancelAnimationFrame = function(handle) {}; |
| 158 | |
| 159 | /** |
| 160 | * @param {function(number)} callback |
| 161 | * @param {Element=} opt_element |
| 162 | * @return {number} |
| 163 | */ |
| 164 | Window.prototype.msRequestAnimationFrame = function(callback, opt_element) {}; |
| 165 | |
| 166 | /** |
| 167 | * @param {number} handle |
| 168 | */ |
| 169 | Window.prototype.msCancelRequestAnimationFrame = function(handle) {}; |
| 170 | |
| 171 | /** |
| 172 | * @param {number} handle |
| 173 | */ |
| 174 | Window.prototype.msCancelAnimationFrame = function(handle) {}; |
| 175 | |
| 176 | /** |
| 177 | * @param {function(number)} callback |
| 178 | * @param {Element=} opt_element |
| 179 | * @return {number} |
| 180 | */ |
| 181 | Window.prototype.oRequestAnimationFrame = function(callback, opt_element) {}; |
| 182 | |
| 183 | /** |
| 184 | * @param {number} handle |
| 185 | */ |
| 186 | Window.prototype.oCancelRequestAnimationFrame = function(handle) {}; |
| 187 | |
| 188 | /** |
| 189 | * @param {number} handle |
| 190 | */ |
| 191 | Window.prototype.oCancelAnimationFrame = function(handle) {}; |