Browse Source

feat(lib): improve route type safety

pull/4870/head
KenTandrian 4 weeks ago
parent
commit
c05c8e6667
  1. 10
      libs/common/src/lib/routes.ts

10
libs/common/src/lib/routes.ts

@ -1,5 +1,13 @@
import '@angular/localize/init'; import '@angular/localize/init';
export interface IRoute {
excludeFromAssistant?: boolean;
path: string;
routerLink: string[];
subRoutes?: Record<string, IRoute>;
title: string;
}
export const routes = { export const routes = {
access: 'access', access: 'access',
account: 'account', account: 'account',
@ -44,7 +52,7 @@ export const routes = {
termsOfService: $localize`:kebab-case:terms-of-service` termsOfService: $localize`:kebab-case:terms-of-service`
}; };
export const internalRoutes = { export const internalRoutes: Record<string, IRoute> = {
accounts: { accounts: {
path: 'accounts', path: 'accounts',
routerLink: ['/accounts'], routerLink: ['/accounts'],

Loading…
Cancel
Save