diff --git a/src/runtime/ambient.ts b/src/runtime/ambient.ts new file mode 100644 index 0000000000..b094056c59 --- /dev/null +++ b/src/runtime/ambient.ts @@ -0,0 +1,19 @@ +declare module '*.svelte' { + type Props = Record; + + export default class { + constructor(options: { + target: Element; + anchor?: Element; + props?: Props; + hydrate?: boolean; + intro?: boolean; + }); + + $set(props: Props): void; + $on(event: string, callback: (event: CustomEvent) => void): () => void; + $destroy(): void; + + [accessor: string]: any; + } +} diff --git a/src/runtime/index.ts b/src/runtime/index.ts index 40928da8a0..0973b93f1e 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -1,3 +1,5 @@ +import './ambient'; + export { onMount, onDestroy,