happy-dom
Advanced tools
Comparing version 0.6.4 to 0.7.0
@@ -42,2 +42,17 @@ /// <reference types="node" /> | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @override | ||
* @param {function} callback Callback. | ||
* @returns {NodeJS.Timeout} Timeout ID. | ||
*/ | ||
requestAnimationFrame(callback: (timestamp: number) => void): NodeJS.Timeout; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @override | ||
* @param {NodeJS.Timeout} id Timeout ID. | ||
*/ | ||
cancelAnimationFrame(id: any): void; | ||
/** | ||
* Provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network. | ||
@@ -44,0 +59,0 @@ * |
@@ -125,2 +125,21 @@ "use strict"; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @override | ||
* @param {function} callback Callback. | ||
* @returns {NodeJS.Timeout} Timeout ID. | ||
*/ | ||
AsyncWindow.prototype.requestAnimationFrame = function (callback) { | ||
return this.setTimeout(function () { callback(2); }, 0); | ||
}; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @override | ||
* @param {NodeJS.Timeout} id Timeout ID. | ||
*/ | ||
AsyncWindow.prototype.cancelAnimationFrame = function (id) { | ||
this.clearTimeout(id); | ||
}; | ||
/** | ||
* Provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network. | ||
@@ -127,0 +146,0 @@ * |
@@ -96,2 +96,15 @@ /// <reference types="node" /> | ||
dispose(): void; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @param {function} callback Callback. | ||
* @returns {NodeJS.Timeout} Timeout ID. | ||
*/ | ||
requestAnimationFrame(callback: (timestamp?: number) => void): NodeJS.Timeout; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @param {NodeJS.Timeout} id Timeout ID. | ||
*/ | ||
cancelAnimationFrame(id: any): void; | ||
} |
@@ -116,2 +116,19 @@ "use strict"; | ||
Window.prototype.dispose = function () { }; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @param {function} callback Callback. | ||
* @returns {NodeJS.Timeout} Timeout ID. | ||
*/ | ||
Window.prototype.requestAnimationFrame = function (callback) { | ||
return setTimeout(callback, 0); | ||
}; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @param {NodeJS.Timeout} id Timeout ID. | ||
*/ | ||
Window.prototype.cancelAnimationFrame = function (id) { | ||
clearTimeout(id); | ||
}; | ||
return Window; | ||
@@ -118,0 +135,0 @@ }(EventTarget_1.default)); |
{ | ||
"name": "happy-dom", | ||
"version": "0.6.4", | ||
"version": "0.7.0", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "homepage": "https://github.com/capricorn86/happy-dom#readme", | ||
"watch": "tsc -w --preserveWatchOutput", | ||
"prepublish": "npm run compile && npm test", | ||
"prepublishOnly": "npm run compile && npm test", | ||
"lint": "eslint --max-warnings 0 --fix './src/**/*.ts'", | ||
@@ -29,0 +29,0 @@ "test": "jest", |
@@ -221,2 +221,3 @@ # Happy DOM | ||
| ------- | ---------- | ---------------- | | ||
| 0.7.0 | 2019-11-21 | Thanks to [@AdeAttwood](https://github.com/AdeAttwood) we now have support for requestAnimationFrame() and cancelAnimationFrame(). (#9). | ||
| 0.6.0 | 2019-10-28 | Thanks to [@mat3e](https://github.com/mat3e) we now have support for hasAttributes(). The "attributes" property has also been changed. It is now returning an object instead of array. (#13). | ||
@@ -223,0 +224,0 @@ | 0.5.0 | 2019-10-21 | Adds support for click(), focus() and blur(). (#8) | |
@@ -76,2 +76,23 @@ import NodeFetch from 'node-fetch'; | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @override | ||
* @param {function} callback Callback. | ||
* @returns {NodeJS.Timeout} Timeout ID. | ||
*/ | ||
public requestAnimationFrame(callback: (timestamp: number) => void): NodeJS.Timeout { | ||
return this.setTimeout(() => { callback(2); }, 0); | ||
} | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @override | ||
* @param {NodeJS.Timeout} id Timeout ID. | ||
*/ | ||
public cancelAnimationFrame(id): void { | ||
this.clearTimeout(id); | ||
} | ||
/** | ||
* Provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network. | ||
@@ -78,0 +99,0 @@ * |
@@ -108,2 +108,21 @@ import CustomElementRegistry from './custom-element/CustomElementRegistry'; | ||
public dispose(): void {} | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @param {function} callback Callback. | ||
* @returns {NodeJS.Timeout} Timeout ID. | ||
*/ | ||
public requestAnimationFrame(callback: (timestamp?: number) => void): NodeJS.Timeout { | ||
return setTimeout(callback, 0); | ||
} | ||
/** | ||
* Mock animation frames with timeouts. | ||
* | ||
* @param {NodeJS.Timeout} id Timeout ID. | ||
*/ | ||
public cancelAnimationFrame(id): void { | ||
clearTimeout(id); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
264
474067
259
12106