/// import { AppStateBase, IProject, INotification, IDashboard, IWidget, IDatasource, ISidebarOptions, IDialog, InfoOptions, Loader, IMenu } from '@csnext/cs-core'; import { Logger, DatasourceManager, LayoutManager, DashboardManager } from '../'; import VueRouter from 'vue-router'; import VueI18n from 'vue-i18n'; import { KeyboardManager } from './keyboard-manager'; /** AppState is a singleton class used for project defintion, keeping track of available dashboard managers and datasource handlers. It also includes a generic EventBus and logger instance */ export declare class AppState extends AppStateBase { static DIALOG: string; static DIALOG_ADDED: string; static DIALOG_CLOSED: string; static RIGHTSIDEBAR: string; static RIGHTSIDEBAR_REMOVED: string; static RIGHTSIDEBAR_ADDED: string; static DASHBOARD_MAIN: string; static DASHBOARD_CHANGED: string; static APP_STATE: string; static SOCKET: string; static SOCKET_CONNECTED: string; static SOCKET_DISCONNECTED: string; static SOCKET_RECONNECTING: string; static YES: string; static NO: string; static INFO_WIDGET: string; static INFO_WIDGET_ADDED: string; static INFO_WIDGET_CLEARED: string; static NOTIFICATION: string; static NOTIFICATION_ADDED: string; static NOTIFICATION_CLEARED: string; /** used for singleton */ private static pInstance; /** Get singleton instance of appstate */ static get Instance(): AppState; datasourceManager: DatasourceManager; layoutManager: LayoutManager; dashboardManager: DashboardManager; loader: Loader; activeInfoWidget?: IWidget; /** gets server url */ serverUrl(url?: string): string; socket?: SocketIOClient.Socket; /** Manages active project */ /** Logger */ logger: Logger; /** Vue router instance */ router?: VueRouter; /** Vue i18n instance */ i18n?: VueI18n; /** manages keyboard shortcuts */ keyboard: KeyboardManager; private constructor(); initSocket(): void; get isMobile(): boolean; get isFloatingHeader(): boolean; get isBottomNavigation(): boolean; copyToClipboard(str: string): void; initApp(element?: string, project?: IProject): void; /** Initialize the project state, dashboard managers and data summaries handlers */ init(project?: IProject): void; addDashboard(dashboard: IDashboard): IDashboard; addDatasource(datasource: IDatasource): T; addMenu(menu: IMenu): void; removeMenu(menuId: string): void; get visibleSidebars(): { [key: string]: IDashboard; } | undefined; addSidebar(id: string, sidebar: IDashboard, dashboard?: IDashboard): void; removeSidebar(id: string): void; updateBreadCrumbs(d?: IDashboard, main?: boolean): void; updateDatasource(id: string, value: any): Promise | undefined; /** loads specific datasource in memory. Returns selected datasource as a promise */ loadDatasource(source: IDatasource | string): Promise; openInfo(options: InfoOptions | string): void; addInfoWidget(widget: IWidget): void; clearInfoWidget(): void; TriggerNotification: (notification: INotification) => void; /** Triggers notification */ triggerNotification(notification: INotification): void; clearNotifications(): void; closeDialog(): void; triggerDialog(dialog: IDialog): Promise; triggerYesNoQuestionDialog(title: string, text: string): Promise; triggerQuestionDialog(title: string, text: string, actions: string[]): Promise; /** if rightsidebar exists, clear component and close */ clearRightSidebar(): void; closeRightSidebar(): boolean; closeRightSidebarKey(id: string): boolean; closeInfo(): void; /** If a rightsidebar exists, it will remove a specific widget */ closeRightSidebarWidget(id: string): boolean; openRightSidebarKey(key: string): void; openRightSidebar(dashboard?: IDashboard): void; toggleRightSidebar(key?: string): void; /** If a rightsidebar exists, it will replaces all rightsidebar content with this specific widget */ openRightSidebarWidget(widget: IWidget, options?: ISidebarOptions, key?: string, replace?: boolean): void; toggleRightSidebarWidget(widget: IWidget, options?: ISidebarOptions): void; Translate(textKey: string, values?: { [key: string]: any; }): string; findWidget(id: string, dashboard?: IDashboard): IWidget | undefined; /** initializes given dashboards */ private initializeDashboards; }