diff --git a/packages/core-api/src/routing/RouteRef.ts b/packages/core-api/src/routing/RouteRef.ts index d218d72fbb..eda16ccc91 100644 --- a/packages/core-api/src/routing/RouteRef.ts +++ b/packages/core-api/src/routing/RouteRef.ts @@ -31,13 +31,14 @@ export type RouteRefConfig = { title: string; }; -class RouteRefBaseBase { +class RouteRefBase { constructor(type: string, id: string) { this.toString = () => `routeRef{type=${type},id=${id}}`; } } -export class RouteRefImpl extends RouteRefBaseBase { +export class RouteRefImpl extends RouteRefBase + implements RouteRef { readonly [routeRefType] = 'absolute'; constructor(private readonly config: RouteRefConfig) { @@ -92,7 +93,7 @@ export function createRouteRef< export class ExternalRouteRefImpl< Params extends AnyParams, Optional extends boolean -> extends RouteRefBaseBase { +> extends RouteRefBase implements ExternalRouteRef { readonly [routeRefType] = 'external'; constructor( diff --git a/packages/core-api/src/routing/types.ts b/packages/core-api/src/routing/types.ts index de6f991ec9..69de5345a5 100644 --- a/packages/core-api/src/routing/types.ts +++ b/packages/core-api/src/routing/types.ts @@ -28,7 +28,7 @@ export const routeRefType: unique symbol = getGlobalSingleton( ); export type RouteRef = { - [routeRefType]: 'absolute'; + readonly [routeRefType]: 'absolute'; params: ParamKeys; @@ -45,7 +45,7 @@ export type ExternalRouteRef< Params extends AnyParams = any, Optional extends boolean = any > = { - [routeRefType]: 'external'; + readonly [routeRefType]: 'external'; params: ParamKeys;