Skip to content

Commit

Permalink
fix: ensure type check passes with jsdoc LegacyComponentType
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo-Steiner committed Nov 20, 2024
1 parent ed6d299 commit 02c6d7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/svelte/src/legacy/legacy-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Component<Record<string, any>>>) => ReturnType<Component<Record<string, any>, Record<string, any>>>)} LegacyComponentType
* @typedef {{new (o: ComponentConstructorOptions): SvelteComponent;(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;}} LegacyComponentType
*/

class Svelte4Component {
Expand Down
5 changes: 3 additions & 2 deletions packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Component<Record<string, any>>>) => ReturnType<Component<Record<string, any>, Record<string, any>>>);
new (o: ComponentConstructorOptions): SvelteComponent;
(...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;
};
/**
* Substitute for the `trusted` event modifier
* @deprecated
Expand Down

0 comments on commit 02c6d7f

Please sign in to comment.