Skip to content

Commit

Permalink
exported event types
Browse files Browse the repository at this point in the history
  • Loading branch information
vigenere23 committed Oct 27, 2020
1 parent 7cf1560 commit 380e6d3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ interface RouterEvent<T> {
detail: T
}

/** Event type for conditionsFailed */
export type ConditionsFailedEvent = RouterEvent<RouteDetail>

/** Event type for routeLoading */
export type RouteLoadingEvent = RouterEvent<RouteDetail>

/** Event type for routeLoaded */
export type RouteLoadedEvent = RouterEvent<RouteDetailLoaded>

/**
* Router component
*/
Expand Down Expand Up @@ -190,6 +199,7 @@ export default class Router extends SvelteComponent {
}

$on(event: 'routeEvent', callback: (event: CustomEvent) => void): () => void
$on(event: 'routeLoading' | 'conditionsFailed', callback: (event: RouterEvent<RouteDetail>) => void): () => void
$on(event: 'routeLoaded', callback: (event: RouterEvent<RouteDetailLoaded>) => void): () => void
$on(event: 'conditionsFailed', callback: (event: ConditionsFailedEvent) => void): () => void
$on(event: 'routeLoading', callback: (event: RouteLoadingEvent) => void): () => void
$on(event: 'routeLoaded', callback: (event: RouteLoadedEvent) => void): () => void
}

0 comments on commit 380e6d3

Please sign in to comment.