-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate
Component
to ComponentExports<typeof Component>
in …
- Loading branch information
1 parent
d93ad3b
commit 4715dfa
Showing
4 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: migrate `Component` to `ComponentExports<typeof Component>` in TS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/svelte/tests/migrate/samples/component-type/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script lang="ts"> | ||
import Component from "./Component.svelte"; | ||
import type ComponentType from "./Component.svelte"; | ||
export let my_comp: Component; | ||
export let my_component_type: ComponentType; | ||
export function enhance(comp: Component, comp_type: ComponentType){ | ||
} | ||
let comp: Component | ComponentType | undefined = undefined; | ||
export const the_comp: Component | ComponentType = comp; | ||
</script> | ||
|
||
<Component bind:this={comp} /> |
22 changes: 22 additions & 0 deletions
22
packages/svelte/tests/migrate/samples/component-type/output.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import Component from "./Component.svelte"; | ||
import type ComponentType from "./Component.svelte"; | ||
interface Props { | ||
my_comp: import('svelte').ComponentExports<typeof Component>; | ||
my_component_type: import('svelte').ComponentExports<typeof ComponentType>; | ||
} | ||
let { my_comp, my_component_type }: Props = $props(); | ||
export function enhance(comp: import('svelte').ComponentExports<typeof Component>, comp_type: import('svelte').ComponentExports<typeof ComponentType>){ | ||
} | ||
let comp: import('svelte').ComponentExports<typeof Component> | import('svelte').ComponentExports<typeof ComponentType> | undefined = $state(undefined); | ||
export const the_comp: import('svelte').ComponentExports<typeof Component> | import('svelte').ComponentExports<typeof ComponentType> = comp; | ||
</script> | ||
|
||
<Component bind:this={comp} /> |