diff --git a/src/domain/ViewModel.ts b/src/domain/ViewModel.ts index 0bc52f6e..743815ee 100644 --- a/src/domain/ViewModel.ts +++ b/src/domain/ViewModel.ts @@ -29,15 +29,15 @@ import type {ILogger} from "../logging/types"; import type {Navigation} from "./navigation/Navigation"; import type {URLRouter} from "./navigation/URLRouter"; -export type Options = { +type Options = { platform: Platform logger: ILogger - urlCreator: URLRouter - navigation: Navigation + urlCreator: URLRouter + navigation: Navigation emitChange?: (params: any) => void } -export class ViewModel extends EventEmitter<{change: never}> { +export class ViewModel = Options> extends EventEmitter<{change: never}> { private disposables?: Disposables; private _isDisposed = false; private _options: Readonly; @@ -47,7 +47,7 @@ export class ViewModel extends EventEmitter<{change this._options = options; } - childOptions(explicitOptions: T): T & Options { + childOptions(explicitOptions: T): T & Options { return Object.assign({}, this._options, explicitOptions); } @@ -135,11 +135,11 @@ export class ViewModel extends EventEmitter<{change return this.platform.logger; } - get urlCreator(): URLRouter { + get urlCreator(): URLRouter { return this._options.urlCreator; } - get navigation(): Navigation { + get navigation(): Navigation { return this._options.navigation; } }