fix(types): router types fix for vue-router 3.3.3 (#7503)

This commit is contained in:
Kevin Marrec 2020-06-12 15:15:50 +02:00 committed by GitHub
parent 245d32d0dc
commit 752d587ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -5,7 +5,10 @@
* https://router.vuejs.org/api/#router-construction-options * https://router.vuejs.org/api/#router-construction-options
*/ */
import { RouterOptions, RouteConfig } from 'vue-router' import { 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'>> { export interface NuxtRouteConfig extends Pick<RouteConfig, Exclude<keyof RouteConfig, 'children' | 'component'>> {
children?: NuxtRouteConfig[] children?: NuxtRouteConfig[]

View File

@ -1,13 +1,13 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "esnext", "target": "ESNext",
"moduleResolution": "node", "moduleResolution": "Node",
"strict": true, "strict": true,
"noEmit": true, "noEmit": true,
"lib": [ "lib": [
"esnext", "ESNext",
"esnext.asynciterable", "ESNext.AsyncIterable",
"dom" "DOM"
] ]
} }
} }