feat: add GamepadEventHandler type (#9861)

Add GamepadEventHandler type for window.addEventListener `gamepadconnected` and `gamepaddisconnected`
pull/9882/head
Jirawat Boonkumnerd 1 year ago committed by GitHub
parent cb529fc666
commit acf73104b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
feat: add `gamepadconnected` and `gamepaddisconnected` events

@ -53,6 +53,7 @@ export type KeyboardEventHandler<T extends EventTarget> = EventHandler<KeyboardE
export type MouseEventHandler<T extends EventTarget> = EventHandler<MouseEvent, T>; export type MouseEventHandler<T extends EventTarget> = EventHandler<MouseEvent, T>;
export type TouchEventHandler<T extends EventTarget> = EventHandler<TouchEvent, T>; export type TouchEventHandler<T extends EventTarget> = EventHandler<TouchEvent, T>;
export type PointerEventHandler<T extends EventTarget> = EventHandler<PointerEvent, T>; export type PointerEventHandler<T extends EventTarget> = EventHandler<PointerEvent, T>;
export type GamepadEventHandler<T extends EventTarget> = EventHandler<GamepadEvent, T>;
export type UIEventHandler<T extends EventTarget> = EventHandler<UIEvent, T>; export type UIEventHandler<T extends EventTarget> = EventHandler<UIEvent, T>;
export type WheelEventHandler<T extends EventTarget> = EventHandler<WheelEvent, T>; export type WheelEventHandler<T extends EventTarget> = EventHandler<WheelEvent, T>;
export type AnimationEventHandler<T extends EventTarget> = EventHandler<AnimationEvent, T>; export type AnimationEventHandler<T extends EventTarget> = EventHandler<AnimationEvent, T>;
@ -336,6 +337,12 @@ export interface DOMAttributes<T extends EventTarget> {
onlostpointercapture?: PointerEventHandler<T> | undefined | null; onlostpointercapture?: PointerEventHandler<T> | undefined | null;
onlostpointercapturecapture?: PointerEventHandler<T> | undefined | null; onlostpointercapturecapture?: PointerEventHandler<T> | undefined | null;
// Gamepad Events
'on:gamepadconnected'?: GamepadEventHandler<T> | undefined | null;
ongamepadconnected?: GamepadEventHandler<T> | undefined | null;
'on:gamepaddisconnected'?: GamepadEventHandler<T> | undefined | null;
ongamepaddisconnected?: GamepadEventHandler<T> | undefined | null;
// UI Events // UI Events
'on:scroll'?: UIEventHandler<T> | undefined | null; 'on:scroll'?: UIEventHandler<T> | undefined | null;
onscroll?: UIEventHandler<T> | undefined | null; onscroll?: UIEventHandler<T> | undefined | null;

Loading…
Cancel
Save