refactor: move transitionary type to 'svelte/transitionary'

pull/14257/head
Theodor Steiner 2 years ago
parent e7bdd0cddb
commit a8728f8394

@ -1,17 +1,20 @@
declare module 'svelte/transitionary' {
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte';
// Support using the component as both a class and function during the transition period
// prettier-ignore
export interface TransitionaryComponentType {
(
...args: Parameters<Component<Record<string, any>>>
): ReturnType<Component<Record<string, any>, Record<string, any>>>
new (o: ComponentConstructorOptions): SvelteComponent
}
}
declare module '*.svelte' {
// use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
// prettier-ignore
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte'
// Support using the component as both a class and function during the transition period
// prettier-ignore
export interface ComponentType {
(
...args: Parameters<Component<Record<string, any>>>
): ReturnType<Component<Record<string, any>, Record<string, any>>>
new (o: ComponentConstructorOptions): SvelteComponent
}
const Comp: ComponentType;
import { SvelteComponent } from 'svelte'
import { TransitionaryComponentType } from 'svelte/transitionary';
const Comp: TransitionaryComponentType;
type Comp = SvelteComponent;
export default Comp;
}

@ -2305,20 +2305,23 @@ declare module 'svelte/types/compiler/interfaces' {
};
export {};
}declare module '*.svelte' {
// use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
// prettier-ignore
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte'
}declare module 'svelte/transitionary' {
import { SvelteComponent, Component, type ComponentConstructorOptions } from 'svelte';
// Support using the component as both a class and function during the transition period
// prettier-ignore
export interface ComponentType {
(
...args: Parameters<Component<Record<string, any>>>
): ReturnType<Component<Record<string, any>, Record<string, any>>>
new (o: ComponentConstructorOptions): SvelteComponent
}
const Comp: ComponentType;
export interface TransitionaryComponentType {
(
...args: Parameters<Component<Record<string, any>>>
): ReturnType<Component<Record<string, any>, Record<string, any>>>
new (o: ComponentConstructorOptions): SvelteComponent
}
}
declare module '*.svelte' {
// use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
// prettier-ignore
import { SvelteComponent } from 'svelte'
import { TransitionaryComponentType } from 'svelte/transitionary';
const Comp: TransitionaryComponentType;
type Comp = SvelteComponent;
export default Comp;
}

Loading…
Cancel
Save