From 380e6d3e3b6be8c8ebc01796fe7b715b74fa8135 Mon Sep 17 00:00:00 2001 From: vigenere23 Date: Tue, 27 Oct 2020 13:38:33 -0400 Subject: [PATCH] exported event types --- Router.d.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Router.d.ts b/Router.d.ts index 842f9bc..aefe7e2 100644 --- a/Router.d.ts +++ b/Router.d.ts @@ -156,6 +156,15 @@ interface RouterEvent { detail: T } +/** Event type for conditionsFailed */ +export type ConditionsFailedEvent = RouterEvent + +/** Event type for routeLoading */ +export type RouteLoadingEvent = RouterEvent + +/** Event type for routeLoaded */ +export type RouteLoadedEvent = RouterEvent + /** * Router component */ @@ -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) => void): () => void - $on(event: 'routeLoaded', callback: (event: RouterEvent) => 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 }