fix: adjust module declaration to work around language tools bug (#12071)

See 026111228b for more info
We can probably remove this after a few weeks
pull/12072/head
Simon H 1 year ago committed by GitHub
parent 29ca451c9e
commit 4ddff6f9d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: adjust module declaration to work around language tools bug

@ -1,12 +1,15 @@
declare module '*.svelte' {
import { SvelteComponent, Component, type ComponentConstructorOptions } from '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
interface ComponentType {
(
...args: Parameters<Component<Record<string, any>>>
): ReturnType<Component<Record<string, any>, Record<string, any>>>;
new (o: ComponentConstructorOptions): SvelteComponent;
): ReturnType<Component<Record<string, any>, Record<string, any>>>
new (o: ComponentConstructorOptions): SvelteComponent
}
const Comp: ComponentType;
type Comp = SvelteComponent;

@ -2634,14 +2634,17 @@ declare module 'svelte/types/compiler/interfaces' {
*/
type Namespace = 'html' | 'svg' | 'mathml' | 'foreign';
}declare module '*.svelte' {
import { SvelteComponent, Component, type ComponentConstructorOptions } from '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
interface ComponentType {
(
...args: Parameters<Component<Record<string, any>>>
): ReturnType<Component<Record<string, any>, Record<string, any>>>;
new (o: ComponentConstructorOptions): SvelteComponent;
): ReturnType<Component<Record<string, any>, Record<string, any>>>
new (o: ComponentConstructorOptions): SvelteComponent
}
const Comp: ComponentType;
type Comp = SvelteComponent;

Loading…
Cancel
Save