add generic type for SvelteComponentDev props

pull/4577/head
Rongjian Zhang 6 years ago
parent e50ad1dcb6
commit 0ccd029033

@ -98,18 +98,18 @@ export function validate_slots(name, slot, keys) {
} }
type Props = Record<string, any>; type Props = Record<string, any>;
export interface SvelteComponentDev { export interface SvelteComponentDev<P = Props> {
$set(props?: Props): void; $set(props?: P): void;
$on<T = any>(event: string, callback: (event: CustomEvent<T>) => void): () => void; $on<T = any>(event: string, callback: (event: CustomEvent<T>) => void): () => void;
$destroy(): void; $destroy(): void;
[accessor: string]: any; [accessor: string]: any;
} }
export class SvelteComponentDev extends SvelteComponent { export class SvelteComponentDev<P = Props> extends SvelteComponent {
constructor(options: { constructor(options: {
target: Element; target: Element;
anchor?: Element; anchor?: Element;
props?: Props; props?: P;
hydrate?: boolean; hydrate?: boolean;
intro?: boolean; intro?: boolean;
$$inline?: boolean; $$inline?: boolean;

Loading…
Cancel
Save