From bcbe1632ca93553d12d793eb45726fda125c8a14 Mon Sep 17 00:00:00 2001 From: Jesper Dalgas Zachariassen Date: Wed, 19 Sep 2018 14:44:25 +0200 Subject: 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. --- mitt.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}): Emitter; } interface Emitter { -- cgit v1.2.3