aboutsummaryrefslogtreecommitdiff
path: root/mitt.d.ts
diff options
context:
space:
mode:
authorDavid Khourshid <[email protected]>2018-09-19 08:36:23 -0400
committerJason Miller <[email protected]>2018-09-19 08:36:23 -0400
commit0f4e8f0d3c0cfe4581edd9e93d3dac0ce994eefb (patch)
treee4e8582b41b0cd78edd07af5255a3ada809b1386 /mitt.d.ts
parent820ac6a172efbbd472e0a802ffad6a882f0cbb27 (diff)
Fixing TypeScript usage. Fixes #60 (#67)
* Fixing TypeScript usage * Removing extraneous formatting
Diffstat (limited to 'mitt.d.ts')
-rw-r--r--mitt.d.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/mitt.d.ts b/mitt.d.ts
index 41ea221..7b3121a 100644
--- a/mitt.d.ts
+++ b/mitt.d.ts
@@ -8,26 +8,26 @@ declare namespace mitt {
type Handler = (event?: any) => void;
interface MittStatic {
- new(all?: {[key: string]: Handler}): Emitter;
+ (all?: {[key: string]: Handler}): Emitter;
}
interface Emitter {
/**
* Register an event handler for the given type.
- *
+ *
* @param {string} type Type of event to listen for, or `"*"` for all events.
* @param {Handler} handler Function to call in response to the given event.
- *
+ *
* @memberOf Mitt
*/
on(type: string, handler: Handler): void;
/**
* Function to call in response to the given event
- *
+ *
* @param {string} type Type of event to unregister `handler` from, or `"*"`
* @param {Handler} handler Handler function to remove.
- *
+ *
* @memberOf Mitt
*/
off(type: string, handler: Handler): void;
@@ -35,10 +35,10 @@ declare namespace mitt {
/**
* Invoke all handlers for the given type.
* If present, `"*"` handlers are invoked prior to type-matched handlers.
- *
+ *
* @param {string} type The event type to invoke
* @param {any} [event] An event object, passed to each handler
- *
+ *
* @memberOf Mitt
*/
emit(type: string, event?: any): void;