Skip to content

Commit bc69ef4

Browse files
FrogTheFrogmysticatea
authored andcommitted
🐛 attribute listeners are nullable (#19)
1 parent f1b44f6 commit bc69ef4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface AddEventListenerOptions extends EventListenerOptions {
122122
once?: boolean;
123123
}
124124

125-
export type EventTargetListener = ((event: Event) => any) | { handleEvent(event: Event): void };
125+
export type EventTargetListener = ((event: Event) => void) | { handleEvent(event: Event): void };
126126

127127
export interface PartialEvent extends Partial<Event> {
128128
type: string;
@@ -163,7 +163,7 @@ export interface EventTarget {
163163
}
164164

165165
type EventAttributes<T extends string> = {
166-
[K in T]: (ev: Event) => any;
166+
[K in T]: ((ev: Event) => void) | null;
167167
};
168168

169169
type EventTargetConstructor = {

tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
"noEmit": true,
55
"strict": true
66
},
7-
"exclude": ["test/types.ts"]
8-
}
7+
"files": [
8+
"test/types.ts"
9+
],
10+
"exclude": [
11+
"node_modules"
12+
]
13+
}

0 commit comments

Comments
 (0)