Skip to content

Commit 69d91fc

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

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

dist/index.d.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,6 +2447,10 @@ declare var GPUComputePipeline: {
24472447
new (): never;
24482448
};
24492449

2450+
interface GPUDeviceEventMap {
2451+
uncapturederror: GPUUncapturedErrorEvent;
2452+
}
2453+
24502454
interface GPUDevice
24512455
extends EventTarget,
24522456
GPUObjectBase {
@@ -2631,6 +2635,45 @@ interface GPUDevice
26312635
ev: GPUUncapturedErrorEvent
26322636
) => any)
26332637
| null;
2638+
2639+
addEventListener<
2640+
K extends keyof GPUDeviceEventMap
2641+
>(
2642+
type: K,
2643+
listener: (
2644+
this: GPUDevice,
2645+
ev: GPUDeviceEventMap[K]
2646+
) => any,
2647+
options?:
2648+
| boolean
2649+
| AddEventListenerOptions
2650+
): void;
2651+
addEventListener(
2652+
type: string,
2653+
listener: EventListenerOrEventListenerObject,
2654+
options?:
2655+
| boolean
2656+
| AddEventListenerOptions
2657+
): void;
2658+
removeEventListener<
2659+
K extends keyof GPUDeviceEventMap
2660+
>(
2661+
type: K,
2662+
listener: (
2663+
this: GPUDevice,
2664+
ev: GPUDeviceEventMap[K]
2665+
) => any,
2666+
options?:
2667+
| boolean
2668+
| EventListenerOptions
2669+
): void;
2670+
removeEventListener(
2671+
type: string,
2672+
listener: EventListenerOrEventListenerObject,
2673+
options?:
2674+
| boolean
2675+
| EventListenerOptions
2676+
): void;
26342677
}
26352678

26362679
declare var GPUDevice: {

0 commit comments

Comments
 (0)