Skip to content

Commit a8728f8

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

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
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
}

packages/svelte/types/index.d.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,20 +2305,23 @@ declare module 'svelte/types/compiler/interfaces' {
23052305
};
23062306

23072307
export {};
2308-
}declare module '*.svelte' {
2309-
// use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
2310-
// prettier-ignore
2311-
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte'
2312-
2308+
}declare module 'svelte/transitionary' {
2309+
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte';
23132310
// Support using the component as both a class and function during the transition period
23142311
// prettier-ignore
2315-
export interface ComponentType {
2316-
(
2317-
...args: Parameters<Component<Record<string, any>>>
2318-
): ReturnType<Component<Record<string, any>, Record<string, any>>>
2319-
new (o: ComponentConstructorOptions): SvelteComponent
2320-
}
2321-
const Comp: ComponentType;
2312+
export interface TransitionaryComponentType {
2313+
(
2314+
...args: Parameters<Component<Record<string, any>>>
2315+
): ReturnType<Component<Record<string, any>, Record<string, any>>>
2316+
new (o: ComponentConstructorOptions): SvelteComponent
2317+
}
2318+
}
2319+
declare module '*.svelte' {
2320+
// use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
2321+
// prettier-ignore
2322+
import { SvelteComponent } from 'svelte'
2323+
import { TransitionaryComponentType } from 'svelte/transitionary';
2324+
const Comp: TransitionaryComponentType;
23222325
type Comp = SvelteComponent;
23232326
export default Comp;
23242327
}

0 commit comments

Comments
 (0)