Skip to content

Commit 84ad208

Browse files
Svelte5 (Types/Doc) import Component as Type (#11992)
* import Component as Type interfaces can only be used as a Type, that way it should be imported as type * fix import type * regenerate types --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 0d51dba commit 84ad208

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/svelte/src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class SvelteComponent<
113113
* you export a component called `MyComponent`. For Svelte+TypeScript users,
114114
* you want to provide typings. Therefore you create a `index.d.ts`:
115115
* ```ts
116-
* import { Component } from "svelte";
116+
* import type { Component } from 'svelte';
117117
* export declare const MyComponent: Component<{ foo: string }> {}
118118
* ```
119119
* Typing this makes it possible for IDEs like VS Code with the Svelte extension

packages/svelte/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ declare module 'svelte' {
110110
* you export a component called `MyComponent`. For Svelte+TypeScript users,
111111
* you want to provide typings. Therefore you create a `index.d.ts`:
112112
* ```ts
113-
* import { Component } from "svelte";
113+
* import type { Component } from 'svelte';
114114
* export declare const MyComponent: Component<{ foo: string }> {}
115115
* ```
116116
* Typing this makes it possible for IDEs like VS Code with the Svelte extension

0 commit comments

Comments
 (0)