0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

[fix] typings for #7863

This commit is contained in:
Simon H 2022-09-28 16:51:45 +02:00 committed by GitHub
parent ee5479d00e
commit c12704c301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,7 +126,7 @@ export function validate_void_dynamic_element(tag: undefined | string) {
type Props = Record<string, any>;
export interface SvelteComponentDev {
$set(props?: Props): void;
$on(event: string, callback: (event: any) => void): () => void;
$on(event: string, callback: ((event: any) => void) | null | undefined): () => void;
$destroy(): void;
[accessor: string]: any;
}
@ -196,7 +196,7 @@ export interface SvelteComponentTyped<
Slots extends Record<string, any> = any // eslint-disable-line @typescript-eslint/no-unused-vars
> {
$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) | null | undefined): () => void;
$destroy(): void;
[accessor: string]: any;
}