Merge pull request #2990 from mrkishi/component-type

Add ambient types for `*.svelte` files
pull/3030/head
Rich Harris 5 years ago committed by GitHub
commit 98b8ca7c20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,19 @@
declare module '*.svelte' {
type Props = Record<string, any>;
export default class {
constructor(options: {
target: Element;
anchor?: Element;
props?: Props;
hydrate?: boolean;
intro?: boolean;
});
$set(props: Props): void;
$on<T = any>(event: string, callback: (event: CustomEvent<T>) => void): () => void;
$destroy(): void;
[accessor: string]: any;
}
}

@ -1,3 +1,5 @@
import './ambient';
export {
onMount,
onDestroy,

Loading…
Cancel
Save