more strict props

let people type it loose themselves if they want to
pull/5431/head
Simon Holthausen 5 years ago
parent e64a040d9f
commit e9d939f8d8

@ -217,7 +217,7 @@ export class SvelteComponent<
Events extends Record<string, any> = any Events extends Record<string, any> = any
> { > {
$$: T$$; $$: T$$;
$$set?: ($$props: Partial<Props> & Record<string, any>) => void; $$set?: ($$props: Partial<Props>) => void;
$destroy() { $destroy() {
destroy_component(this, 1); destroy_component(this, 1);
@ -234,7 +234,7 @@ export class SvelteComponent<
}; };
} }
$set($$props: Partial<Props> & Record<string, any>) { $set($$props: Partial<Props>) {
if (this.$$set && !is_empty($$props)) { if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true; this.$$.skip_bound = true;
this.$$set($$props); this.$$set($$props);

@ -102,7 +102,7 @@ export interface SvelteComponentDev<
Events extends Record<string, any> = any, Events extends Record<string, any> = any,
Slots extends Record<string, any> = any Slots extends Record<string, any> = any
> { > {
$set(props?: Partial<Props> & Record<string, any>): void; $set(props?: Partial<Props>): void;
$on<K extends Extract<keyof Events, string>>(type: K, callback: (e: Events[K]) => void): () => void; $on<K extends Extract<keyof Events, string>>(type: K, callback: (e: Events[K]) => void): () => void;
$destroy(): void; $destroy(): void;
[accessor: string]: any; [accessor: string]: any;
@ -138,7 +138,7 @@ export class SvelteComponentDev<
constructor(options: { constructor(options: {
target: Element; target: Element;
anchor?: Element; anchor?: Element;
props?: Props & Record<string, any>; props?: Props;
hydrate?: boolean; hydrate?: boolean;
intro?: boolean; intro?: boolean;
$$inline?: boolean; $$inline?: boolean;

Loading…
Cancel
Save