Skip to content

Commit

Permalink
better types
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Dec 3, 2024
1 parent 4a62a0b commit 373401d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/static/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,7 +34,7 @@ export function initialiseRouter(
component: appComponent,
props: {
initSelectedTab: STATIC_BUILD ? "Options" : undefined
} as Parameters<NonNullable<(typeof appComponent)["setup"]>>["0"]
} as Parameters<NonNullable<IntersectionAppComponent["setup"]>>["0"]
};

const sessionsRoute: RouteRecordRaw = {
Expand Down

0 comments on commit 373401d

Please sign in to comment.