From f9ba528265e8bf756732107d3c7957a6a78d1850 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Tue, 28 Nov 2023 23:00:40 +0100 Subject: [PATCH] fix: add children to element typings (#9679) * fix: add children to element typings Add this here so that libraries doing `props$()` don't need a separate interface fixes #https://github.com/sveltejs/language-tools/issues/2218 * typo --- .changeset/kind-eagles-join.md | 5 +++++ packages/svelte/elements.d.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/kind-eagles-join.md diff --git a/.changeset/kind-eagles-join.md b/.changeset/kind-eagles-join.md new file mode 100644 index 0000000000..827511c300 --- /dev/null +++ b/.changeset/kind-eagles-join.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: add children to element typings diff --git a/packages/svelte/elements.d.ts b/packages/svelte/elements.d.ts index db32222c6b..4c3bef74f2 100644 --- a/packages/svelte/elements.d.ts +++ b/packages/svelte/elements.d.ts @@ -64,6 +64,10 @@ export type MessageEventHandler = EventHandler { + // Implicit children prop every element has + // Add this here so that libraries doing `$props()` don't need a separate interface + children?: import('svelte').Snippet; + // Clipboard Events 'on:copy'?: ClipboardEventHandler | undefined | null; oncopy?: ClipboardEventHandler | undefined | null;