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 data(): {}
  • Getter for data prop.

    Returns {}

  • set data(_: {}): void
  • Setter for data prop.

    Parameters

    • _: {}

    Returns void

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

    Returns any

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

    Parameters

    • _: any

    Returns void

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

    Returns any

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

    Parameters

    • _: any

    Returns void

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

    Returns any

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

    Parameters

    • _: any

    Returns void

  • get renderSheet(): boolean
  • Getter for renderSheet prop.

    Returns boolean

  • set renderSheet(_: boolean): void
  • Setter for renderSheet prop.

    Parameters

    • _: boolean

    Returns void

  • get requestSubmit(): () => void
  • Getter for requestSubmit prop.

    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