Skip to content

Commit

Permalink
Svelte5 (Types/Doc) import Component as Type (#11992)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Dudek-AMS and Rich-Harris authored Jun 11, 2024
1 parent 0d51dba commit 84ad208
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/svelte/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class SvelteComponent<
* you export a component called `MyComponent`. For Svelte+TypeScript users,
* you want to provide typings. Therefore you create a `index.d.ts`:
* ```ts
* import { Component } from "svelte";
* import type { Component } from 'svelte';
* export declare const MyComponent: Component<{ foo: string }> {}
* ```
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ declare module 'svelte' {
* you export a component called `MyComponent`. For Svelte+TypeScript users,
* you want to provide typings. Therefore you create a `index.d.ts`:
* ```ts
* import { Component } from "svelte";
* import type { Component } from 'svelte';
* export declare const MyComponent: Component<{ foo: string }> {}
* ```
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
Expand Down

0 comments on commit 84ad208

Please sign in to comment.