Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) relax event handler typings #1502

Merged
merged 1 commit into from
Sep 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/svelte2tsx/svelte-shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare class Svelte2TsxComponent<
* Causes the callback function to be called whenever the component dispatches an event.
* A function is returned that will remove the event listener when called.
*/
$on<K extends keyof Events & string>(event: K, handler: (e: Events[K]) => any): () => void;
$on<K extends keyof Events & string>(event: K, handler: ((e: Events[K]) => any) | null | undefined): () => void;
/**
* Removes a component from the DOM and triggers any `onDestroy` handlers.
*/
Expand Down Expand Up @@ -288,7 +288,7 @@ declare type ATypedSvelteComponent = {
*/
$$slot_def: any;

$on(event: string, handler: (e: any) => any): () => void;
$on(event: string, handler: ((e: any) => any) | null | undefined): () => void;
}
/**
* Ambient type only used for intellisense, DO NOT USE IN YOUR PROJECT
Expand Down