import type { AppConfig } from "./AppConfig"; import type { AppContainer } from "./AppContainer"; import type { Layout } from "./layout"; /** * Provides information about the current application, such as the current state * and layout. * * Components and services should generally avoid programming against this * unless they provide application-wide services such as exporting state, * changing layout, etc. */ export interface AppContext { /** * The original application config used to initialize the application. * Modifying this will have no effect on the current application state. */ readonly appConfig: string | AppConfig; /** * The live state of the application, which contains all models and settings * used by components and services. */ readonly appState: AppContainer; /** * The currently loaded layout. */ readonly layout: Layout; /** * If Web is embedded in an HTML page. Behaviors, including map controls, * are impacted by this setting. */ readonly isEmbedded?: boolean; /** * The root HTML element where the application is rendered. */ readonly hostElement?: HTMLElement; /** * Whether the application was launched in debug mode. */ debugMode: boolean; /** * Various application parameters, normally populated from the urls query * string parameters. */ applicationParams: ReadonlyMap; /** * Creates and initializes a new AppContainer with given appConfig and * optional baseUrl. All models and services registered in the Application * will get registered in the new AppContainer that's returned. * * @param appConfig The app config for the new AppContainer. * @param baseUrl An optional base URL for the new AppContainer. */ createAppState(appConfig: string | AppConfig, baseUrl?: string): Promise; /** * Shuts down the application gracefully. This will invoke destroy callbacks * on all loaded services and components, and unmount the layout from the * DOM. * * NB: Once this promise is resolved, no further methods should be invoked * on any object in this application. */ shutdown(): Promise; }