import Vue from "vue" ; import Router , { RawLocation } from "vue-router" ; import { ErrorHandler } from "vue-router/types/router" ; Vue . use ( Router ) ; export enum View { Dashboard = "dashboard" , FirstTimeSetup = "first-time-setup" , Login = "login" , List = "list" , Queue = "queue" , Anime = "anime" , Settings = "settings" } export const router = new Router ( { mode : "hash" , base : "/" , routes : [ { path : "/" , name : View . Dashboard , component : ( ) => import ( "./views/dashboard/dashboard.vue" ) , } , { path : "/first-time-setup" , name : View . FirstTimeSetup , component : ( ) => import ( "./views/first-time-setup/first-time-setup.vue" ) , } , { path : "/login" , name : View . Login , component : ( ) => import ( "./views/login/login.vue" ) , } , { path : "/queue" , name : View . Queue , component : ( ) => import ( "./views/queue/queue.vue" ) , } , { path : "/list" , name : View . List , component : ( ) => import ( "./views/list/list.vue" ) , } , { path : "/anime/:id" , name : View . Anime , component : ( ) => import ( "./views/anime/anime.vue" ) , } , { path : "/settings" , name : View . Settings , component : ( ) => import ( "./views/settings/settings.vue" ) , } , ] , } ) ; const routerMethods = [ "push" , "replace" ] as const ; routerMethods . forEach ( ( method ) => { const originalCall = Router . prototype [ method ] ; Router . prototype [ method ] = function ( location , onResolve ? , onReject ? ) { if ( onResolve || onReject ) { return originalCall . call ( this , location , onResolve , onReject ) ; } return ( originalCall . call ( this , location ) as any ) . catch ( ( err ) => err ) ; } ; } ) ;