Add JSDoc for requestSnapshot

This commit is contained in:
Ray Schamp 2018-09-18 15:54:41 -04:00
parent 550cd7aacf
commit 997062c851

View File

@ -178,7 +178,7 @@ class RenderWebGL extends EventEmitter {
/** @type {function} */
this._exitRegion = null;
/** @type {Array.<function>} */
/** @type {Array.<snapshotCallback>} */
this._snapshotCallbacks = [];
this._svgTextBubble = new SVGTextBubble();
@ -1713,6 +1713,14 @@ class RenderWebGL extends EventEmitter {
return dst;
}
/**
* @callback RenderWebGL#snapshotCallback
* @param {string} dataURI Data URI of the snapshot of the renderer
*/
/**
* @param {snapshotCallback} callback Function called in the next frame with the snapshot data
*/
requestSnapshot (callback) {
this._snapshotCallbacks.push(callback);
}