-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
router.d.ts
28 lines (23 loc) · 1003 Bytes
/
router.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* NuxtOptionsRouter
* Documentation: https://nuxtjs.org/api/configuration-router
* https://router.vuejs.org/api/#router-construction-options
*/
import type { RouterOptions, RouteConfig as _RouteConfig } from 'vue-router'
type UnionToIntersection<T> = (T extends any ? (k: T) => void : never) extends ((k: infer U) => void) ? U : never
type RouteConfig = UnionToIntersection<_RouteConfig>
export interface NuxtRouteConfig extends Pick<RouteConfig, Exclude<keyof RouteConfig, 'children' | 'component'>> {
children?: NuxtRouteConfig[]
chunkName?: string
chunkNames?: Record<string, string>
component?: RouteConfig['component'] | string
}
export interface NuxtOptionsRouter extends RouterOptions {
routeNameSplitter?: string
extendRoutes?(routes: NuxtRouteConfig[], resolve: (...pathSegments: string[]) => string): void
linkPrefetchedClass?: string
middleware?: string | string[]
prefetchLinks?: boolean
prefetchPayloads?: boolean
trailingSlash?: boolean
}