@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
49 lines • 2.39 kB
TypeScript
import { IApplication } from '@c8y/client';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export declare const SupportedApps: {
readonly devicemanagement: "devicemanagement-application-key";
readonly cockpit: "cockpit-application-key";
readonly administration: "administration-application-key";
readonly smartrules: "smartrule-key";
};
export type SupportedAppKey = (typeof SupportedApps)[keyof typeof SupportedApps];
/**
* Service that provides methods to interact with other applications.
* It allows retrieving a specific app by key, checking its availability, verifying if it is not the current application,
* determining if a link to another app should be shown, and navigating to it.
*/
export declare class InterAppService<T extends string = SupportedAppKey> {
private stateService;
private alertService;
private translateService;
/**
* Retrieve application by its key as observable.
* @param key {SupportedAppKey} - Application key.
* @returns Observable of Application
*/
getApp$(key: T): Observable<IApplication | undefined>;
/**
* Checks if current application is the same as the one that key is provided
* @param key {SupportedAppKey} - Application key.
* @returns Observable of boolean; true if current app matches provided key.
*/
isCurrentApp$(key: T): Observable<boolean>;
/**
* Checks if other (other than current) application link should be displayed. It consists of two conditions:
* - app that link leads to exists and is available for current user
* - app link leads to app that is not current app
* @param appKey {SupportedAppKey} - Application key that link leads to.
* @returns Observable of boolean; only true when app that link leads to is available and app link leads to app that is not current app
*/
shouldShowAppLink$(appKey: T): Observable<boolean>;
/**
* Navigates to app by provided app key
* @param appKey {SupportedAppKey} - Application key that links leads to.
* @param path {string} - Additional path in target application.
*/
navigateToApp(appKey: T, path?: string): Promise<void>;
static ɵfac: i0.ɵɵFactoryDeclaration<InterAppService<any>, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<InterAppService<any>>;
}
//# sourceMappingURL=inter-app.service.d.ts.map