Skip to content

Commit 17d8d1a

Browse files
committed
refactor: move transitionary type to 'svelte/transitionary'
1 parent e7bdd0c commit 17d8d1a

File tree

2 files changed

+245
-102
lines changed

2 files changed

+245
-102
lines changed

packages/svelte/src/ambient.d.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
declare module 'svelte/transitionary' {
2+
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte';
3+
// Support using the component as both a class and function during the transition period
4+
// prettier-ignore
5+
export interface TransitionaryComponentType {
6+
(
7+
...args: Parameters<Component<Record<string, any>>>
8+
): ReturnType<Component<Record<string, any>, Record<string, any>>>
9+
new (o: ComponentConstructorOptions): SvelteComponent
10+
}
11+
}
112
declare module '*.svelte' {
213
// use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
314
// prettier-ignore
4-
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte'
5-
6-
// Support using the component as both a class and function during the transition period
7-
// prettier-ignore
8-
export interface ComponentType {
9-
(
10-
...args: Parameters<Component<Record<string, any>>>
11-
): ReturnType<Component<Record<string, any>, Record<string, any>>>
12-
new (o: ComponentConstructorOptions): SvelteComponent
13-
}
14-
const Comp: ComponentType;
15+
import { SvelteComponent } from 'svelte'
16+
import { TransitionaryComponentType } from 'svelte/transitionary';
17+
const Comp: TransitionaryComponentType;
1518
type Comp = SvelteComponent;
1619
export default Comp;
1720
}

0 commit comments

Comments
 (0)