Skip to content

Commit 8740f4b

Browse files
committed
Fix link action TS
1 parent 043c468 commit 8740f4b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/svelte/src/link.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ type ActionParameters = Omit<VisitOptions, 'data'> & {
2121
type SelectedEventKeys = 'start' | 'progress' | 'finish' | 'before' | 'cancel' | 'success' | 'error'
2222
type SelectedGlobalEventsMap = Pick<GlobalEventsMap, SelectedEventKeys>
2323
type ActionAttributes = {
24-
[K in keyof SelectedGlobalEventsMap as `on:${K}`]?: CustomEvent<SelectedGlobalEventsMap[K]['details']>
24+
[K in keyof SelectedGlobalEventsMap as `on:${K}` | `on${K}`]?: (
25+
event: CustomEvent<SelectedGlobalEventsMap[K]['details']>,
26+
) => void
2527
} & {
26-
'on:cancel-token'?: CustomEvent<CancelTokenSource>
28+
'on:cancel-token'?: (event: CustomEvent<CancelTokenSource>) => void
29+
oncanceltoken?: (event: CustomEvent<CancelTokenSource>) => void
2730
}
2831

2932
function link(node: ActionElement, options: ActionParameters = {}): ActionReturn<ActionParameters, ActionAttributes> {

0 commit comments

Comments
 (0)