spiegel-keyman/common/web/input-processor/src/includes/events.ts
Marc Durdin 05a4c33200 chore(web): move common/core/web to common/web
Relates to #5816.

Moves folders under common/core/web to common/web:

* input-processor -> common/web/input-processor
* keyboard-processor -> common/web/keyboard-processor
* tools/recorder -> common/web/recorder
* tools/sentry-manager -> common/web/sentry-manager
* utils -> common/web/utils

Updates scripts and configuration to point to new folders.
2022-05-18 06:01:03 +10:00

20 lines
No EOL
1,001 B
TypeScript

// Implements Node's EventEmitter class and related module components in a near
// browser-compatible way. (Just requires a blank 'module' object on the window.)
///<reference path="../../../../../node_modules/eventemitter3/index.js" />
// Unfortunately, I can't get it to recognize type information properly
// because we can't use require statements. So, a small-scale manual definition.
declare class EventEmitter {
/** Add a listener for a given event */
on(event: string, func: (...args: any[]) => boolean, context?: any);
/** Add a one-time listener for a given event */
once(event: string, func: (...args: any[]) => boolean, context?: any);
removeListener(event: string, func: (...args: any[]) => boolean, context?: any, once?: boolean);
// Defines their alternately-themed aliases.
addListener: typeof EventEmitter.prototype.on;
off: typeof EventEmitter.prototype.removeListener;
// Defines the actual event-raising function.
emit(eventName: string, ...args: any[]);
}