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

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

Indexable

  • [prop: string]: any

Constructors

Accessors

  • get document(): any
  • Getter for document prop.

    Returns any

  • set document(_: any): void
  • Setter for document prop.

    Parameters

    • _: any

    Returns void

  • get keepId(): any
  • Getter for keepId prop.

    Returns any

  • set keepId(_: any): void
  • Setter for keepId prop.

    Parameters

    • _: any

    Returns void

  • get merge(): any
  • Getter for merge prop.

    Returns any

  • set merge(_: any): void
  • Setter for merge prop.

    Parameters

    • _: any

    Returns void

  • get packName(): any
  • Getter for packName prop.

    Returns any

  • set packName(_: any): void
  • Setter for packName prop.

    Parameters

    • _: any

    Returns void

  • get undefined(): any
  • Returns any

  • set undefined(_: any): void
  • accessor

    Parameters

    • _: any

    Returns void

Methods

  • Type Parameters

    • K extends string

    Parameters

    Returns () => void