diff --git a/.changeset/fair-eagles-wink.md b/.changeset/fair-eagles-wink.md new file mode 100644 index 0000000000..10fbffb736 --- /dev/null +++ b/.changeset/fair-eagles-wink.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: add `gamepadconnected` and `gamepaddisconnected` events \ No newline at end of file diff --git a/packages/svelte/elements.d.ts b/packages/svelte/elements.d.ts index 2161f56da4..93949b59d7 100644 --- a/packages/svelte/elements.d.ts +++ b/packages/svelte/elements.d.ts @@ -53,6 +53,7 @@ export type KeyboardEventHandler = EventHandler = EventHandler; export type TouchEventHandler = EventHandler; export type PointerEventHandler = EventHandler; +export type GamepadEventHandler = EventHandler; export type UIEventHandler = EventHandler; export type WheelEventHandler = EventHandler; export type AnimationEventHandler = EventHandler; @@ -170,6 +171,10 @@ export interface DOMAttributes { 'on:pointerup'?: PointerEventHandler | undefined | null; 'on:lostpointercapture'?: PointerEventHandler | undefined | null; + // Gamepad Events + 'on:gamepadconnected'?: GamepadEventHandler | undefined | null; + 'on:gamepaddisconnected'?: GamepadEventHandler | undefined | null; + // UI Events 'on:scroll'?: UIEventHandler | undefined | null; 'on:resize'?: UIEventHandler | undefined | null; @@ -1454,7 +1459,7 @@ export interface SVGAttributes extends AriaAttributes, DO z?: number | string | undefined | null; zoomAndPan?: string | undefined | null; - // allow any data- attribute + // allow any data- attribute [key: `data-${string}`]: any; }