From 7bd1cdf4271078c977cc39497cbe545a9de4dd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Crozatier?= <48696601+fcrozatier@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:14:56 +0100 Subject: [PATCH] feat: add content-visibility: auto state change event (#14373) * add contentvisibilityautostatechange event * changeset * Update .changeset/kind-horses-lay.md * Update .changeset/kind-horses-lay.md --------- Co-authored-by: Rich Harris --- .changeset/kind-horses-lay.md | 5 +++++ packages/svelte/elements.d.ts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .changeset/kind-horses-lay.md diff --git a/.changeset/kind-horses-lay.md b/.changeset/kind-horses-lay.md new file mode 100644 index 0000000000..d08bdde6c4 --- /dev/null +++ b/.changeset/kind-horses-lay.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +add `contentvisibilityautostatechange` event to element definitions diff --git a/packages/svelte/elements.d.ts b/packages/svelte/elements.d.ts index 8746b29e25..8b2d388bf8 100644 --- a/packages/svelte/elements.d.ts +++ b/packages/svelte/elements.d.ts @@ -60,6 +60,10 @@ export type AnimationEventHandler = EventHandler = EventHandler; export type MessageEventHandler = EventHandler; export type ToggleEventHandler = EventHandler; +export type ContentVisibilityAutoStateChangeEventHandler = EventHandler< + ContentVisibilityAutoStateChangeEvent, + T +>; export type FullAutoFill = | AutoFill @@ -157,6 +161,20 @@ export interface DOMAttributes { ontoggle?: ToggleEventHandler | undefined | null; ontogglecapture?: ToggleEventHandler | undefined | null; + // Content visibility Events + 'on:contentvisibilityautostatechange'?: + | ContentVisibilityAutoStateChangeEventHandler + | undefined + | null; + oncontentvisibilityautostatechange?: + | ContentVisibilityAutoStateChangeEventHandler + | undefined + | null; + oncontentvisibilityautostatechangecapture?: + | ContentVisibilityAutoStateChangeEventHandler + | undefined + | null; + // Keyboard Events 'on:keydown'?: KeyboardEventHandler | undefined | null; onkeydown?: KeyboardEventHandler | undefined | null;