diff --git a/package.json b/package.json index 3601cd8..192560d 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "types": "svelte-check", "types:legacy": "svelte-check --tsconfig tsconfig.legacy.json", "validate": "npm-run-all test:vitest:* test:jest types build", - "build": "tsc -p tsconfig.build.json", + "build": "tsc -p tsconfig.build.json && cp src/component-types.d.ts types", "contributors:add": "all-contributors add", "contributors:generate": "all-contributors generate", "preview-release": "./scripts/preview-release" diff --git a/src/component-types.d.ts b/src/component-types.d.ts index a349597..9df84c2 100644 --- a/src/component-types.d.ts +++ b/src/component-types.d.ts @@ -1,11 +1,14 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type * as Svelte from 'svelte' -// eslint-disable-next-line @typescript-eslint/no-explicit-any type IS_MODERN_SVELTE = any extends Svelte.Component ? false : true /** A compiled, imported Svelte component. */ -export type Component
= IS_MODERN_SVELTE extends true - ? Svelte.Component
| Svelte.SvelteComponent
+export type Component<
+ P extends Record | Svelte.SvelteComponent
: Svelte.SvelteComponent
/**
@@ -19,7 +22,7 @@ export type ComponentType