aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesper Dalgas Zachariassen <[email protected]>2018-09-19 14:44:25 +0200
committerJason Miller <[email protected]>2018-09-19 08:44:25 -0400
commitbcbe1632ca93553d12d793eb45726fda125c8a14 (patch)
tree461a7f7020b0789ac2867918dc7d2660088612ba
parentd08d7821efb479967b7f65bcf43f3187eb97eacf (diff)
Change type of the all property in the constructor (#73)
This commit corrects the type of the `all` property in the `mitt` constructor function, such that it properly reflects a list of `Handler` functions rather than a single `Handler` function. This makes it possible to provide an argument to the `all` property in TypeScript projects without casting the argument to the `any` type and with proper error feedback.
-rw-r--r--mitt.d.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/mitt.d.ts b/mitt.d.ts
index 97d017b..0555a0d 100644
--- a/mitt.d.ts
+++ b/mitt.d.ts
@@ -9,7 +9,7 @@ declare namespace mitt {
type WildcardHandler = (type?: string, event?: any) => void;
interface MittStatic {
- (all?: {[key: string]: Handler}): Emitter;
+ (all?: {[key: string]: Array<Handler>}): Emitter;
}
interface Emitter {