AAE-25392 Convert route guards to functional - part three (#10117)

This commit is contained in:
Ehsan Rezaei
2024-08-29 17:26:26 +02:00
committed by GitHub
parent 0433ada548
commit aeee07d82a

View File

@@ -16,23 +16,23 @@
*/ */
import { InjectionToken } from '@angular/core'; import { InjectionToken } from '@angular/core';
import { CanActivate, CanActivateChild } from '@angular/router'; import { CanActivateFn, CanActivateChildFn } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
export interface ShellPreferencesService { export interface ShellPreferencesService {
set(preferenceKey: string, value: any): void; set(preferenceKey: string, value: any): void;
get(preferenceKey: string, defaultValue: string): string; get(preferenceKey: string, defaultValue: string): string;
} }
export interface ShellAppService { export interface ShellAppService {
pageHeading$: Observable<string>; pageHeading$: Observable<string>;
hideSidenavConditions: string[]; hideSidenavConditions: string[];
minimizeSidenavConditions: string[]; minimizeSidenavConditions: string[];
preferencesService: ShellPreferencesService; preferencesService: ShellPreferencesService;
} }
export const SHELL_APP_SERVICE = new InjectionToken<ShellAppService>('SHELL_APP_SERVICE'); export const SHELL_APP_SERVICE = new InjectionToken<ShellAppService>('SHELL_APP_SERVICE');
export const SHELL_AUTH_TOKEN = new InjectionToken<CanActivate & CanActivateChild>('SHELL_AUTH_TOKEN'); export const SHELL_AUTH_TOKEN = new InjectionToken<CanActivateFn | CanActivateChildFn>('SHELL_AUTH_TOKEN');
export const SHELL_NAVBAR_MIN_WIDTH = new InjectionToken<number>('SHELL_NAVBAR_MIN_WIDTH'); export const SHELL_NAVBAR_MIN_WIDTH = new InjectionToken<number>('SHELL_NAVBAR_MIN_WIDTH');
export const SHELL_NAVBAR_MAX_WIDTH = new InjectionToken<number>('SHELL_NAVBAR_MAX_WIDTH'); export const SHELL_NAVBAR_MAX_WIDTH = new InjectionToken<number>('SHELL_NAVBAR_MAX_WIDTH');