Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tweak event type
1. $on return off funciton
2. wildcard event is CustomEvent now
  • Loading branch information
jasonlyu123 committed Jul 28, 2020
commit b3ff3625a77cde8e9148fb09366ce38a74f01f28
6 changes: 3 additions & 3 deletions packages/svelte2tsx/svelte-shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare module '*.svelte' {
$$prop_def: any;
$$slot_def: any;

$on(event: string, handler: (e: Event) => any): void
$on(event: string, handler: (e: Event) => any): () => void
}
}

Expand Down Expand Up @@ -41,8 +41,8 @@ type SvelteExtractEvent<T> = T extends any[] ? T[number] : T;
type SvelteEventOnEvent<T, K extends keyof T> = (
event: K,
handler: (e: SvelteExtractEvent<T[K]>) => any
) => void;
type SvelteAllEvent = (event: string, handler: (e: Event) => any) => void
) => () => void;
type SvelteAllEvent = (event: string, handler: (e: CustomEvent) => any) => () => void
type SvelteOnEvent<T> = SvelteEventOnEvent<T, keyof T> & SvelteAllEvent

declare var process: NodeJS.Process & { browser: boolean }
Expand Down