Skip to content

Commit 02c6d7f

Browse files
committed
fix: ensure type check passes with jsdoc LegacyComponentType
1 parent ed6d299 commit 02c6d7f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/svelte/src/legacy/legacy-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function asClassComponent(component) {
6565

6666
/**
6767
* Support using the component as both a class and function during the transition period
68-
* @typedef {{new: (o: ComponentConstructorOptions) => SvelteComponent} & ((...args: Parameters<Component<Record<string, any>>>) => ReturnType<Component<Record<string, any>, Record<string, any>>>)} LegacyComponentType
68+
* @typedef {{new (o: ComponentConstructorOptions): SvelteComponent;(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;}} LegacyComponentType
6969
*/
7070

7171
class Svelte4Component {

packages/svelte/types/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,8 +1582,9 @@ declare module 'svelte/legacy' {
15821582
* Support using the component as both a class and function during the transition period
15831583
*/
15841584
export type LegacyComponentType = {
1585-
new: (o: ComponentConstructorOptions) => SvelteComponent;
1586-
} & ((...args: Parameters<Component<Record<string, any>>>) => ReturnType<Component<Record<string, any>, Record<string, any>>>);
1585+
new (o: ComponentConstructorOptions): SvelteComponent;
1586+
(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;
1587+
};
15871588
/**
15881589
* Substitute for the `trusted` event modifier
15891590
* @deprecated

0 commit comments

Comments
 (0)