Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
Can be used to create strongly typed Svelte components.
You have component library on npm called component-library, from which you export a component called MyComponent. For Svelte+TypeScript users, you want to provide typings. Therefore you create a index.d.ts:
import { SvelteComponent } from 'svelte'
export class MyComponent extends SvelteComponent<{ foo: string }> {}
import { SvelteComponent } from 'svelte'
export class MyComponent extends SvelteComponent<{ foo: string }> {}
Typing this makes it possible for IDEs like VS Code with the Svelte extension to provide intellisense and to use the component like this in a Svelte file with TypeScript:
<script lang="ts">
import { MyComponent } from 'component-library'
</script>
<MyComponent foo={'bar'} />
<script lang="ts">
import { MyComponent } from 'component-library'
</script>
<MyComponent foo={'bar'} />
• Props extends Record<string, any> = any
• Events extends Record<string, any> = any
• Slots extends Record<string, any> = any
[prop: string]: any
new HydrationBoundary<Props, Events, Slots>(options): HydrationBoundary<Props, Events, Slots>
new HydrationBoundary<Props, Events, Slots>(options): HydrationBoundary<Props, Events, Slots>
• options: ComponentConstructorOptions<Props>
HydrationBoundary<Props, Events, Slots>
SvelteComponent_1<Props, Events>.constructor
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:144
$$: any
$$: any
Do not use, may change at any time
SvelteComponent_1.$$
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:102
$$events_def: Events
$$events_def: Events
For type checking capabilities only. Does not exist at runtime.
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:158
$$prop_def: Props
$$prop_def: Props
For type checking capabilities only. Does not exist at runtime.
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:151
$$set: any
$$set: any
Do not use, may change at any time
SvelteComponent_1.$$set
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:109
$$slot_def: Slots
$$slot_def: Slots
For type checking capabilities only. Does not exist at runtime.
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:165
$capture_state(): void
$capture_state(): void
void
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:167
$destroy(): void
$destroy(): void
void
SvelteComponent_1.$destroy
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:111
$inject_state(): void
$inject_state(): void
void
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:169
$on<K>(type, callback): () => void
$on<K>(type, callback): () => void
• K extends string
• type: K
• callback: undefined | null | (e) => void
Function
void
SvelteComponent_1.$on
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:113
$set(props): void
$set(props): void
• props: Partial<Props>
void
SvelteComponent_1.$set
node_modules/.pnpm/svelte@4.2.18/node_modules/svelte/types/index.d.ts:115