Skip to content

Commit

Permalink
ran build
Browse files Browse the repository at this point in the history
  • Loading branch information
FoHoOV committed Sep 29, 2024
1 parent ecaabd4 commit 1024ae0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,22 @@ declare module 'svelte' {
? Props
: never;

/**
* Convenience type to get the properties that given component exports.
*
* Example: Typing the `bind:this` for a component named `MyComponent`
* ```
* <script lang="ts">
* import MyComponent from '$lib/component';
* let component: ComponentExports<typeof MyComponent> | undefined = undefined;
* <script>
*
* <MyComponent bind:this={component} />
* ```
*/
export type ComponentExports<TComponent extends Component<any, any>> =
TComponent extends Component<any, infer TExports> ? TExports : never;

/**
* @deprecated This type is obsolete when working with the new `Component` type.
*
Expand Down

0 comments on commit 1024ae0

Please sign in to comment.