Skip to content

Commit a515a21

Browse files
committed
refactor: reorganize types and add initial experimental router
1 parent 2ab9c32 commit a515a21

File tree

8 files changed

+1451
-333
lines changed

8 files changed

+1451
-333
lines changed

packages/router/src/errors.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import type { MatcherLocationRaw, MatcherLocation } from './types'
2-
import type { RouteLocationRaw, RouteLocationNormalized } from './typed-routes'
2+
import type {
3+
RouteLocationRaw,
4+
RouteLocationNormalized,
5+
RouteLocationNormalizedLoaded,
6+
} from './typed-routes'
37
import { assign } from './utils'
48

59
/**
@@ -199,3 +203,19 @@ function stringifyRoute(to: RouteLocationRaw): string {
199203
}
200204
return JSON.stringify(location, null, 2)
201205
}
206+
/**
207+
* Internal type to define an ErrorHandler
208+
*
209+
* @param error - error thrown
210+
* @param to - location we were navigating to when the error happened
211+
* @param from - location we were navigating from when the error happened
212+
* @internal
213+
*/
214+
215+
export interface _ErrorListener {
216+
(
217+
error: any,
218+
to: RouteLocationNormalized,
219+
from: RouteLocationNormalizedLoaded
220+
): any
221+
}

0 commit comments

Comments
 (0)