Skip to content

Commit

Permalink
fix: add constraint to inference
Browse files Browse the repository at this point in the history
Else the type is not properly resolved sometimes
Fixes a type issue with Threlte
  • Loading branch information
dummdidumm committed Sep 10, 2024
1 parent 9221ca3 commit fbd3b81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/svelte2tsx/svelte-shims-v4.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ declare function __sveltets_2_ensureComponent<
// @ts-ignore svelte.Component doesn't exist in Svelte 4
T extends ConstructorOfATypedSvelteComponent | (typeof import('svelte') extends { mount: any } ? import('svelte').Component<any, any, any> : never) | null | undefined
// @ts-ignore svelte.Component doesn't exist in Svelte 4
>(type: T): NonNullable<T extends ConstructorOfATypedSvelteComponent ? T : typeof import('svelte') extends { mount: any } ? T extends import('svelte').Component<infer Props> ? typeof import('svelte').SvelteComponent<Props, Props['$$events'], Props['$$slots']> : T : T>;
>(type: T): NonNullable<T extends ConstructorOfATypedSvelteComponent ? T : typeof import('svelte') extends { mount: any } ? T extends import('svelte').Component<infer Props extends Record<string, any>> ? typeof import('svelte').SvelteComponent<Props, Props['$$events'], Props['$$slots']> : T : T>;
declare function __sveltets_2_ensureArray<T extends ArrayLike<unknown> | Iterable<unknown>>(array: T): T extends ArrayLike<infer U> ? U[] : T extends Iterable<infer U> ? Iterable<U> : any[];

type __sveltets_2_PropsWithChildren<Props, Slots> = Props &
Expand Down

0 comments on commit fbd3b81

Please sign in to comment.