From 373401d97fcdc88ff28fb844fae1c26803816397 Mon Sep 17 00:00:00 2001 From: Mantra Date: Tue, 3 Dec 2024 18:12:04 +0000 Subject: [PATCH] better types --- app/static/src/router.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/static/src/router.ts b/app/static/src/router.ts index 48dd49bd..40a15f99 100644 --- a/app/static/src/router.ts +++ b/app/static/src/router.ts @@ -5,8 +5,11 @@ import type BasicApp from "./components/basic/BasicApp.vue"; import type FitApp from "./components/fit/FitApp.vue"; import type StochasticApp from "./components/stochastic/StochasticApp.vue"; +type UnionAppComponent = typeof BasicApp | typeof FitApp | typeof StochasticApp +type IntersectionAppComponent = typeof BasicApp & typeof FitApp & typeof StochasticApp + export function initialiseRouter( - appComponent: typeof BasicApp | typeof FitApp | typeof StochasticApp, + appComponent: UnionAppComponent, appName: string, baseUrl: string, appsPath: string @@ -31,7 +34,7 @@ export function initialiseRouter( component: appComponent, props: { initSelectedTab: STATIC_BUILD ? "Options" : undefined - } as Parameters>["0"] + } as Parameters>["0"] }; const sessionsRoute: RouteRecordRaw = {