Skip to content

Commit

Permalink
feat: add content-visibility: auto state change event (#14373)
Browse files Browse the repository at this point in the history
* add contentvisibilityautostatechange event

* changeset

* Update .changeset/kind-horses-lay.md

* Update .changeset/kind-horses-lay.md

---------

Co-authored-by: Rich Harris <hello@rich-harris.dev>
  • Loading branch information
fcrozatier and Rich-Harris authored Nov 20, 2024
1 parent 4dfa0e3 commit 7bd1cdf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-horses-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

add `contentvisibilityautostatechange` event to element definitions
18 changes: 18 additions & 0 deletions packages/svelte/elements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export type AnimationEventHandler<T extends EventTarget> = EventHandler<Animatio
export type TransitionEventHandler<T extends EventTarget> = EventHandler<TransitionEvent, T>;
export type MessageEventHandler<T extends EventTarget> = EventHandler<MessageEvent, T>;
export type ToggleEventHandler<T extends EventTarget> = EventHandler<ToggleEvent, T>;
export type ContentVisibilityAutoStateChangeEventHandler<T extends EventTarget> = EventHandler<
ContentVisibilityAutoStateChangeEvent,
T
>;

export type FullAutoFill =
| AutoFill
Expand Down Expand Up @@ -157,6 +161,20 @@ export interface DOMAttributes<T extends EventTarget> {
ontoggle?: ToggleEventHandler<T> | undefined | null;
ontogglecapture?: ToggleEventHandler<T> | undefined | null;

// Content visibility Events
'on:contentvisibilityautostatechange'?:
| ContentVisibilityAutoStateChangeEventHandler<T>
| undefined
| null;
oncontentvisibilityautostatechange?:
| ContentVisibilityAutoStateChangeEventHandler<T>
| undefined
| null;
oncontentvisibilityautostatechangecapture?:
| ContentVisibilityAutoStateChangeEventHandler<T>
| undefined
| null;

// Keyboard Events
'on:keydown'?: KeyboardEventHandler<T> | undefined | null;
onkeydown?: KeyboardEventHandler<T> | undefined | null;
Expand Down

0 comments on commit 7bd1cdf

Please sign in to comment.