@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
49 lines • 1.17 kB
TypeScript
/**
* Utility class for managing connection between listeners to signals
*/
export class SignalBinding {
/**
* Creates a {@link SignalBinding} and links it immediately. Utility method
* @param {Signal} signal
* @param {function} handler
* @param {*} [context]
* @return {SignalBinding}
*/
static bind(signal: Signal, handler: Function, context?: any): SignalBinding;
/**
*
* @param {Signal} signal
* @param {function} handler
* @param {*} [context] will be passed as thisArg to the handler
* @constructor
*/
constructor(signal: Signal, handler: Function, context?: any);
get linked(): boolean;
/**
* Binding signal
* @type {Signal}
*/
signal: Signal;
/**
* Signal handler to be attached to the signal
* @type {Function}
*/
handler: Function;
/**
*
* @type {*}
*/
context: any;
/**
* Attaches handler to the signal
* Idempotent
*/
link(): void;
/**
* Detaches handler from the signal
* Idempotent
*/
unlink(): void;
#private;
}
//# sourceMappingURL=SignalBinding.d.ts.map