Skip to content

Commit b9454c7

Browse files
committed
Add Event Types
this makes addEventListener on GPUDevice have the right type information.
1 parent 8faeb6d commit b9454c7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

dist/main.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import './index.d.ts';
2+
3+
declare global {
4+
5+
interface GPUDeviceEventMap {
6+
"uncapturederror": GPUUncapturedErrorEvent;
7+
}
8+
9+
interface GPUDevice {
10+
addEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
11+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
12+
removeEventListener<K extends keyof GPUDeviceEventMap>(type: K, listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
13+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
14+
}
15+
16+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"bugs": "https://github.com/gpuweb/types/issues",
66
"version": "0.1.53",
77
"main": "",
8-
"types": "dist/index.d.ts",
8+
"types": "dist/main.d.ts",
99
"license": "BSD-3-Clause",
1010
"files": [
1111
"dist/**/*"

0 commit comments

Comments
 (0)