From fd8b5c72b37d996724cf3fe9fa17399e2484272b Mon Sep 17 00:00:00 2001 From: ysaskia Date: Sun, 21 Aug 2022 15:43:42 +0200 Subject: [PATCH 1/4] fix: missing `Constructor` constraint for first `render()` type signature --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 63d1c51..623d6be 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -18,7 +18,7 @@ type Constructor = new (...args: any[]) => T; */ export type RenderResult = { container: HTMLElement - component: C + component: Constructor debug: (el?: HTMLElement | DocumentFragment) => void rerender: (options: SvelteComponentOptions) => void unmount: () => void From 1c4c41afbdc4cce7faf4d63e0085b11e6af11cdb Mon Sep 17 00:00:00 2001 From: ysaskia Date: Sun, 21 Aug 2022 16:04:35 +0200 Subject: [PATCH 2/4] fix: missing Constructor constraint to first render() type signature --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 63d1c51..2220f2e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -30,7 +30,7 @@ export interface RenderOptions { } export function render( - component: C, + component: ComponentProps, componentOptions?: SvelteComponentOptions, renderOptions?: Omit ): RenderResult From 72406b8c6e449c1b55ce5cf9b45471637dac6c05 Mon Sep 17 00:00:00 2001 From: ysaskia Date: Sun, 21 Aug 2022 16:10:07 +0200 Subject: [PATCH 3/4] chore: remove mistaken addition --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 41a30f8..2220f2e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -18,7 +18,7 @@ type Constructor = new (...args: any[]) => T; */ export type RenderResult = { container: HTMLElement - component: Constructor + component: C debug: (el?: HTMLElement | DocumentFragment) => void rerender: (options: SvelteComponentOptions) => void unmount: () => void From f7fd0223da78451ed4e5fa63a920af58e89fac41 Mon Sep 17 00:00:00 2001 From: ysaskia Date: Sun, 21 Aug 2022 16:14:24 +0200 Subject: [PATCH 4/4] chore: remove mistaken type manipulation --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 2220f2e..9b688ed 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -30,7 +30,7 @@ export interface RenderOptions { } export function render( - component: ComponentProps, + component: Constructor, componentOptions?: SvelteComponentOptions, renderOptions?: Omit ): RenderResult