From 02c6d7f72ce2c4e6856b44da51e5800e0dacb283 Mon Sep 17 00:00:00 2001 From: Theodor Steiner Date: Thu, 21 Nov 2024 02:24:13 +0900 Subject: [PATCH] fix: ensure type check passes with jsdoc LegacyComponentType --- packages/svelte/src/legacy/legacy-client.js | 2 +- packages/svelte/types/index.d.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/svelte/src/legacy/legacy-client.js b/packages/svelte/src/legacy/legacy-client.js index 19bdd6b08918..7ca202cf73bf 100644 --- a/packages/svelte/src/legacy/legacy-client.js +++ b/packages/svelte/src/legacy/legacy-client.js @@ -65,7 +65,7 @@ export function asClassComponent(component) { /** * Support using the component as both a class and function during the transition period - * @typedef {{new: (o: ComponentConstructorOptions) => SvelteComponent} & ((...args: Parameters>>) => ReturnType, Record>>)} LegacyComponentType + * @typedef {{new (o: ComponentConstructorOptions): SvelteComponent;(...args: Parameters>>): ReturnType, Record>>;}} LegacyComponentType */ class Svelte4Component { diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index e8ce22b08a11..01119e748572 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -1582,8 +1582,9 @@ declare module 'svelte/legacy' { * Support using the component as both a class and function during the transition period */ export type LegacyComponentType = { - new: (o: ComponentConstructorOptions) => SvelteComponent; - } & ((...args: Parameters>>) => ReturnType, Record>>); + new (o: ComponentConstructorOptions): SvelteComponent; + (...args: Parameters>>): ReturnType, Record>>; + }; /** * Substitute for the `trusted` event modifier * @deprecated