From 9300347e9bd2b73dd667d9ff42a6ff32b423761c Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 22 Feb 2022 22:23:52 +0530 Subject: [PATCH] Give defaultt type --- src/domain/ViewModel.ts | 3 ++- src/domain/navigation/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/domain/ViewModel.ts b/src/domain/ViewModel.ts index 743815ee..5bec39e8 100644 --- a/src/domain/ViewModel.ts +++ b/src/domain/ViewModel.ts @@ -27,6 +27,7 @@ import type {Platform} from "../platform/web/Platform"; import type {Clock} from "../platform/web/dom/Clock"; import type {ILogger} from "../logging/types"; import type {Navigation} from "./navigation/Navigation"; +import type {SegmentType} from "./navigation/index"; import type {URLRouter} from "./navigation/URLRouter"; type Options = { @@ -37,7 +38,7 @@ type Options = { emitChange?: (params: any) => void } -export class ViewModel = Options> extends EventEmitter<{change: never}> { +export class ViewModel = Options> extends EventEmitter<{change: never}> { private disposables?: Disposables; private _isDisposed = false; private _options: Readonly; diff --git a/src/domain/navigation/index.ts b/src/domain/navigation/index.ts index b8652f18..f739b668 100644 --- a/src/domain/navigation/index.ts +++ b/src/domain/navigation/index.ts @@ -18,7 +18,7 @@ import {Navigation, Segment} from "./Navigation"; import {URLRouter} from "./URLRouter"; import type {Path, OptionalValue} from "./Navigation"; -type SegmentType = { +export type SegmentType = { "login": true; "session": string; "sso": string; @@ -124,7 +124,7 @@ export function addPanelIfNeeded(navigation: Navigation, defaultSessionId?: string): Segment[] { - // substr(1) to take of initial / + // substring(1) to take of initial / const parts = urlPath.substring(1).split("/"); const iterator = parts[Symbol.iterator](); const segments: Segment[] = [];