Base class for Svelte components with some minor dev-enhancements. Used when dev=true.

Can be used to create strongly typed Svelte components.

Example:

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}> {}

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'} />

Type Parameters

  • Props extends Record<string, any> = any

  • Events extends Record<string, any> = any

  • Slots extends Record<string, any> = any

Hierarchy

  • SvelteComponent_1<Props, Events>
    • Account

Indexable

[prop: string]: any

Constructors

  • Type Parameters

    • Props extends Record<string, any> = any

    • Events extends Record<string, any> = any

    • Slots extends Record<string, any> = any

    Parameters

    • options: ComponentConstructorOptions<Props>

    Returns Account<Props, Events, Slots>

Properties

$$: any

PRIVATE API

Do not use, may change at any time

$$events_def: Events

For type checking capabilities only. Does not exist at runtime.

DO NOT USE!

$$prop_def: Props

For type checking capabilities only. Does not exist at runtime.

DO NOT USE!

$$set: any

PRIVATE API

Do not use, may change at any time

$$slot_def: Slots

For type checking capabilities only. Does not exist at runtime.

DO NOT USE!

Methods

  • Returns void

  • Returns void

  • Returns void

  • Type Parameters

    • K extends string

    Parameters

    • type: K
    • callback: undefined | null | ((e) => void)

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • props: Partial<Props>

    Returns void

Generated using TypeDoc