diff --git a/src/compiler/compile/index.ts b/src/compiler/compile/index.ts index 63f9b5f610c4..30787f8d8863 100644 --- a/src/compiler/compile/index.ts +++ b/src/compiler/compile/index.ts @@ -6,7 +6,7 @@ import render_ssr from './render-ssr/index'; import { CompileOptions, Warning } from '../interfaces'; import Component from './Component'; import fuzzymatch from '../utils/fuzzymatch'; -import { get_name_from_filename } from './utils/get_name_from_filename'; +import get_name_from_filename from './utils/get_name_from_filename'; const valid_options = [ 'format', diff --git a/src/runtime/ambient.ts b/src/runtime/ambient.ts new file mode 100644 index 000000000000..b094056c5959 --- /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 40928da8a0eb..0973b93f1ee7 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -1,3 +1,5 @@ +import './ambient'; + export { onMount, onDestroy,