import { type IDeprecatedObservable } from "@vertigis/arcgis-extensions/support/Observable"; import { LogLevel } from "@vertigis/arcgis-extensions/utilities/log"; import type { WatchCallback } from "@vertigis/arcgis-extensions/utilities/watch"; import type { AppConfig } from "./AppConfig"; import { AppContainer } from "./AppContainer"; import type { LibraryRegistry } from "./config"; import type { Layout } from "./layout"; import type { Action } from "./messaging"; import type { ModelProperties } from "./models"; import { InjectionContainer } from "./services"; import type { UIService } from "./ui"; /** * A URL to an App config document. */ export type AppConfigUrl = string; /** * A URL to a layout XML document. */ export type LayoutUrl = string; /** * A layout XML document. */ export type LayoutXml = string; /** * A library provides the building blocks used by an application, such as * components, services, models, commands, etc. Each library has an entry point * which is responsible for registering all of the things that it provides. */ export type Library = (registry: LibraryRegistry) => void; /** * Application authentication options. */ export interface AuthenticationOptions extends ModelProperties { /** * The initial IdentityManager authentication state used to initialize * VertiGIS Web. This comes from either directly calling toJSON on the * IdentityManager or from the stored result of the onStateChanged callback. * (See * https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON). */ initialState?: unknown; /** * Callback used to be notified of authentication state changes. */ onStateChanged?: (state: unknown) => void; } /** * Options used to initialize {@link Application}. */ export interface ApplicationOptions { /** * The VertiGIS Studio App configuration to load. Can either be an AppConfig * object or a URL to an App JSON file. */ appConfig?: AppConfigUrl | AppConfig; /** * This determines how relative URLs within the App are interpreted. Not * needed if appConfig is a URL. */ appConfigBaseUrl?: string; /** * The layout to use when none are defined in the App and "layout" isn't * specified. Can either be layout XML or a URL to a layout document. */ defaultLayout?: LayoutUrl | LayoutXml; /** * Optionally specify if the app should be run in debug mode. This will * effect various application settings such as log verbosity and caching * schemes. */ debugMode?: boolean; /** * Optionally specify the log verbosity to use for logging. */ logLevel?: LogLevel; /** * Optionally specify the HTML host element, this will be where the * application will render its content. */ hostElement?: HTMLElement; /** * If the viewer is embedded in an HTML page. Behaviors, including map * controls, are impacted by this setting. */ isEmbedded?: boolean; /** * The layout to use. Can either be layout XML or a URL to a layout * document. If specified, it will override any layouts defined in the App. */ layout?: LayoutUrl | LayoutXml; /** * Additional configuration libraries that will be registered with the * application. */ libraries?: Library[]; /** * The locale to use. If not explicitly specified, it will be detected * automatically. */ locale?: string; /** * Optionally an Action to be run at startup. */ startUpAction?: Action; /** * Optional application parameters, normally populated from the urls query * string parameters. */ applicationParams?: [string | number, string][]; } declare const Application_base: (new () => import("@vertigis/arcgis-extensions/support/observableUtils").ObservableMixin) & (abstract new (...args: any[]) => import("@vertigis/arcgis-extensions/support/observableUtils").ObservableMixin); /** * The root class in the framework. Each instance represents a separate running * application. */ export declare class Application extends Application_base implements IDeprecatedObservable { /** * The options used to initialize the application. */ readonly options: ApplicationOptions; /** * The dependency injection container used by the application. Callers can * manually add or update services prior to initializing the application. */ readonly injectionContainer: InjectionContainer; ui: UIService; private readonly _messages; private readonly _libraries; private _appState; private readonly _appContext; private _authenticationService; private _licensingService; private _isInitialized; private _isDestroyed; private _initializePromise; private _destroyPromise; private _registry; constructor(options?: ApplicationOptions); /** * Determines whether the application is initialized. */ get isInitialized(): boolean; get isDestroyed(): boolean; /** * An AppContainer representing the current state of the application. */ get appState(): AppContainer; /** * Initializes the application. */ initialize(): Promise; destroy(): Promise; /** * Creates and initializes a new AppContainer with given appConfig and * optional baseUrl. All models and services registered in this 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; /** * @deprecated * @inheritdoc */ set(propertyPath: string, value: T): this; /** * @deprecated * @inheritdoc */ set(properties: HashMap): this; /** * @deprecated * @inheritdoc */ get(propertyPath: string): T; /** * @deprecated * @inheritdoc */ get(propertyPath: string): unknown; /** * @deprecated * @inheritdoc */ watch(path: string | string[], callback: WatchCallback, sync?: boolean): IHandle; /** * @deprecated * @inheritdoc */ notifyChange(propertyKey: keyof this): void; /** * @deprecated * @inheritdoc */ _watchProperty(propertyKey: keyof this, subpath: string, callback: WatchCallback, sync: boolean): IHandle; /** * Invoked by {@link initialize} to perform initialization. */ protected _onInitialize(): Promise; protected _onDestroy(): Promise; /** * Chooses a layout from the app state. * * @param appState The app state possibly containing layouts. */ protected _getLayoutFromApp(appState: AppContainer): Promise; /** * Checks application and user security: * * 1. The logged in user is associated with the applications licensed * organization. * 2. The application is hosted in a portal associated with the licensees * organization. */ private _checkApplicationSecurity; private _initializeApplicationHooks; private _initializeCustomLibraries; private _selectInitialLayout; private _ensureNotDestroyed; private _registerAppStateFactories; private _registerAppStateFactory; private _resolveUpgrades; private _createUpgrader; } export {};