diff options
| author | Jesper Dalgas Zachariassen <[email protected]> | 2018-09-19 14:44:25 +0200 |
|---|---|---|
| committer | Jason Miller <[email protected]> | 2018-09-19 08:44:25 -0400 |
| commit | bcbe1632ca93553d12d793eb45726fda125c8a14 (patch) | |
| tree | 461a7f7020b0789ac2867918dc7d2660088612ba | |
| parent | d08d7821efb479967b7f65bcf43f3187eb97eacf (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.ts | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 { |
