From 3f9a246144139795a25993ef81f5b3547217d402 Mon Sep 17 00:00:00 2001 From: "S. Elliott Johnson" Date: Sun, 14 Jan 2024 18:10:12 -0700 Subject: [PATCH] fix: typegen --- packages/svelte/types/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index cdcf1e66a9..5cec96541e 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -313,6 +313,8 @@ declare module 'svelte' { type NotFunction = T extends Function ? never : T; // Utility type for ensuring backwards compatibility on a type level: If there's a default slot, add 'children' to the props if it doesn't exist there already + // if you're curious why this is here and not declared as an unexported type from `public.d.ts`, try putting it there + // and see what happens in the output `index.d.ts` -- it breaks, presumably because of a TypeScript compiler bug. type PropsWithChildren = Props & (Props extends { children?: any } ? {} @@ -1848,6 +1850,8 @@ declare module 'svelte/legacy' { }; }; // Utility type for ensuring backwards compatibility on a type level: If there's a default slot, add 'children' to the props if it doesn't exist there already + // if you're curious why this is here and not declared as an unexported type from `public.d.ts`, try putting it there + // and see what happens in the output `index.d.ts` -- it breaks, presumably because of a TypeScript compiler bug. type PropsWithChildren = Props & (Props extends { children?: any } ? {}