Skip to content

Commit bcbe163

Browse files
jesperzachdevelopit
authored andcommitted
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.
1 parent d08d782 commit bcbe163

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mitt.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ declare namespace mitt {
99
type WildcardHandler = (type?: string, event?: any) => void;
1010

1111
interface MittStatic {
12-
(all?: {[key: string]: Handler}): Emitter;
12+
(all?: {[key: string]: Array<Handler>}): Emitter;
1313
}
1414

1515
interface Emitter {

0 commit comments

Comments
 (0)