diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index 02677172fac9..32d14571d92e 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -126,7 +126,7 @@ export function validate_void_dynamic_element(tag: undefined | string) { type Props = Record; 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 = any // eslint-disable-line @typescript-eslint/no-unused-vars > { $set(props?: Partial): void; - $on>(type: K, callback: (e: Events[K]) => void): () => void; + $on>(type: K, callback: ((e: Events[K]) => void) | null | undefined): () => void; $destroy(): void; [accessor: string]: any; }