From be6bebdf85df11c2b0c4a2d2c2a3354a7f52f701 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 31 Oct 2024 14:55:50 +0100 Subject: [PATCH] fix: switch around conditionals in type language-tools sometimes creates a type which satisfies both conditions, and we want the new one to take precedence. --- packages/svelte/src/index.d.ts | 8 ++++---- packages/svelte/types/index.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/svelte/src/index.d.ts b/packages/svelte/src/index.d.ts index 262337ef0aaf..e67682cfc5a1 100644 --- a/packages/svelte/src/index.d.ts +++ b/packages/svelte/src/index.d.ts @@ -251,10 +251,10 @@ export type ComponentProps> = * ``` */ export type ComponentExports | typeof SvelteComponent> = - TComponent extends typeof SvelteComponent - ? InstanceType - : TComponent extends Component - ? TExports + TComponent extends Component + ? TExports + : TComponent extends typeof SvelteComponent + ? InstanceType : never; /** diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index 7ffa022060e3..8157bd8f862e 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -248,10 +248,10 @@ declare module 'svelte' { * ``` */ export type ComponentExports | typeof SvelteComponent> = - TComponent extends typeof SvelteComponent - ? InstanceType - : TComponent extends Component - ? TExports + TComponent extends Component + ? TExports + : TComponent extends typeof SvelteComponent + ? InstanceType : never; /**