import type { IScope } from 'angular'; import type { Observable } from 'rxjs'; import { ReplaySubject, Subject } from 'rxjs'; import type { ICluster } from '../domain/ICluster'; import type { IDataSourceConfig, IFetchStatus } from './service/applicationDataSource'; import { ApplicationDataSource } from './service/applicationDataSource'; export declare class Application { private applicationName; private scheduler; [k: string]: any; /** * A collection of all available data sources for the given application * @type {Array} */ dataSources: ApplicationDataSource[]; /** * The name of the application */ get name(): string; /** * A list of all accounts currently used within the application. Accounts come from either: * - those explicitly configured on the application (to be removed soon), or * - a dataSource configured with a credentialsField * @type {Array} */ accounts: string[]; /** * A list of all cluster currently used within the application. * @type {Array} */ clusters: ICluster[]; /** * A timestamp indicating the last time the onRefresh method succeeded */ lastRefresh: number; /** * A map where the key is the provider and the value is the default credentials value. * Default values are determined by querying all data sources with a credentialsField. * IFF only one unique value is found, that value is set in the map. Otherwise, the provider is not present in the map * @type {Map} */ defaultCredentials: any; /** * A map where the key is the provider and the value is the default region value. * Default values are determined by querying all data sources with a regionField. * IFF only one unique value is found, that value is set in the map. Otherwise, the provider is not present in the map * @type {Map} */ defaultRegions: any; /** * An arbitrary collection of attributes coming from Front50 * @type {Map} */ attributes: any; /** * Indicates that the application was not found in Front50 * @type {boolean} */ notFound: boolean; /** * Indicates that there was an exception while trying to load or create * the application model. * @type {boolean} */ hasError: boolean; /** * Indicates that the application does not exist and is used as a stub * @type {boolean} */ isStandalone: boolean; /** * If managed delivery is enabled, indicates whether an entire application is in an explicit paused state */ isManagementPaused: boolean; /** * Which data source is the active state * @type {ApplicationDataSource} */ activeState: ApplicationDataSource; private refreshListeners; activeDataSource$: ReplaySubject>; /** @deprecated use activeDataSource$ */ activeStateChangeStream: Subject; private refreshStream; private refreshFailureStream; status$: Observable; private dataLoader; constructor(applicationName: string, scheduler: any, dataSourceConfigs: Array>); private getDerivedApplicationStatus; private addDataSource; /** * Returns a data source based on its key. Data sources can be accessed on the application directly via the key, * e.g. application.serverGroups, but this is the preferred access method, as it allows type inference * @param key */ getDataSource(key: string): ApplicationDataSource; /** * Refreshes all dataSources for the application * @param forceRefresh if true, will trigger a refresh on all data sources, even if the data source is currently * loading * @returns {PromiseLike} a promise that resolves when the application finishes loading, rejecting with an error if * one of the data sources fails to refresh */ refresh(forceRefresh?: boolean): PromiseLike; /** * A promise that resolves immediately if all data sources are ready (i.e. loaded), or once all data sources have * loaded * @returns {PromiseLike} the return value is a promise, but its value is * not useful - it's only useful to watch the promise itself */ ready(): PromiseLike; /** * Used to subscribe to the application's refresh cycle. Will automatically be disposed when the $scope is destroyed. * @param $scope the $scope that will manage the lifecycle of the subscription * If you pass in null for the $scope, you are responsible for unsubscribing when your component unmounts. * @param method the method to call when the refresh completes * @param failureMethod a method to call if the refresh fails * @return a method to call to unsubscribe */ onRefresh($scope: IScope, method: any, failureMethod?: any): () => void; /** * This is really only used by the ApplicationController - it manages the refresh cycle for the overall application * and halts refresh when switching applications or navigating to a non-application view */ enableAutoRefresh(): void; disableAutoRefresh(): void; setActiveState(dataSource?: ApplicationDataSource): void; private applicationLoadError; private applicationLoadSuccess; private setApplicationAccounts; private extractProviderDefault; private setDefaults; subscribeToRefresh(onRefreshCb: () => void): () => void; }