Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fair-eagles-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

feat: add `gamepadconnected` and `gamepaddisconnected` events
7 changes: 6 additions & 1 deletion packages/svelte/elements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type KeyboardEventHandler<T extends EventTarget> = EventHandler<KeyboardE
export type MouseEventHandler<T extends EventTarget> = EventHandler<MouseEvent, T>;
export type TouchEventHandler<T extends EventTarget> = EventHandler<TouchEvent, 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 WheelEventHandler<T extends EventTarget> = EventHandler<WheelEvent, T>;
export type AnimationEventHandler<T extends EventTarget> = EventHandler<AnimationEvent, T>;
Expand Down Expand Up @@ -170,6 +171,10 @@ export interface DOMAttributes<T extends EventTarget> {
'on:pointerup'?: PointerEventHandler<T> | undefined | null;
'on:lostpointercapture'?: PointerEventHandler<T> | undefined | null;

// Gamepad Events
'on:gamepadconnected'?: GamepadEventHandler<T> | undefined | null;
'on:gamepaddisconnected'?: GamepadEventHandler<T> | undefined | null;

// UI Events
'on:scroll'?: UIEventHandler<T> | undefined | null;
'on:resize'?: UIEventHandler<T> | undefined | null;
Expand Down Expand Up @@ -1454,7 +1459,7 @@ export interface SVGAttributes<T extends EventTarget> extends AriaAttributes, DO
z?: number | string | undefined | null;
zoomAndPan?: string | undefined | null;

// allow any data- attribute
Copy link
Contributor Author

@ntsd ntsd Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one found after just auto format

// allow any data- attribute
[key: `data-${string}`]: any;
}

Expand Down