2020-10-21 20:06:10 +03:00
|
|
|
/**
|
|
|
|
* Defines the constructor of a canvas based room effect
|
|
|
|
*/
|
2020-10-21 18:58:54 +03:00
|
|
|
export interface ICanvasEffectConstructable {
|
2020-10-21 20:06:10 +03:00
|
|
|
/**
|
|
|
|
* @param {{[key:string]:any}} options? Optional animation options
|
|
|
|
* @returns ICanvasEffect Returns a new instance of the canvas effect
|
|
|
|
*/
|
2020-10-21 18:58:54 +03:00
|
|
|
new(options?: { [key: string]: any }): ICanvasEffect
|
|
|
|
}
|
|
|
|
|
2020-10-21 20:06:10 +03:00
|
|
|
/**
|
|
|
|
* Defines the interface of a canvas based room effect
|
|
|
|
*/
|
2020-10-19 22:25:01 +03:00
|
|
|
export default interface ICanvasEffect {
|
2020-10-21 20:06:10 +03:00
|
|
|
/**
|
|
|
|
* @param {HTMLCanvasElement} canvas The canvas instance as the render target of the animation
|
|
|
|
* @param {number} timeout? A timeout that defines the runtime of the animation (defaults to false)
|
|
|
|
*/
|
2020-10-21 15:15:27 +03:00
|
|
|
start: (canvas: HTMLCanvasElement, timeout?: number) => Promise<void>,
|
2020-10-21 20:06:10 +03:00
|
|
|
/**
|
|
|
|
* Stops the current animation
|
|
|
|
*/
|
2020-10-19 22:25:01 +03:00
|
|
|
stop: () => Promise<void>,
|
2020-10-21 20:06:10 +03:00
|
|
|
/**
|
|
|
|
* Returns a value that defines if the animation is currently running
|
|
|
|
*/
|
2020-10-19 22:25:01 +03:00
|
|
|
isRunning: boolean
|
2020-10-21 14:37:36 +03:00
|
|
|
}
|