import { HoistService, InitContext } from '@xh/hoist/core'; import { Timer } from '@xh/hoist/utils/async'; /** * Developer/Admin focused service to provide additional processing and stats related to the * running application, specifically its current HoistModel, HoistService, Store, Cube, and cube * View instances. * * Activating this service will cause it to maintain an observable array of summary data synced * (with a minimal throttle) on each change to the Hoist registry, as well as an array of model * count / memory usage stats, also updated on model changes and periodically in the background. * * When running in a Desktop application, activating this service will trigger the display of the * Hoist Inspector UI - {@link inspectorPanel}. A built-in control to activate/deactivate this * service is provided within the Desktop versionBar component. * * This service may be completely disabled via an optional `xhInspectorConfig` appConfig, although * note that this config does *not* disable the backing registry within XH. Access to Inspector can * also be limited to users with a particular app role, using the same config. */ export declare class InspectorService extends HoistService { xhImpl: boolean; static instance: InspectorService; persistWith: { localStorageKey: string; }; /** * True if Inspector is generally enabled via config. * If enabled but !active, this service won't do any work, but can be activated on demand. */ get enabled(): boolean; /** True to start processing model stats and show the Inspector UI. */ active: boolean; /** Info on current services/models/stores (when active). */ activeInstances: InspectorInstanceData[]; /** Timestamped model counts w/memory usage (when active). */ stats: InspectorStat[]; statsUpdateTimer: Timer; private _syncRun; private _idToSyncRun; constructor(); initAsync(ctx: InitContext): Promise; toggleActive(): void; activate(): void; deactivate(): void; updateStats(): void; clearStats(): void; restoreDefaultsAsync(): Promise; private sync; setActiveInstances(ai: InspectorInstanceData[]): void; _prevModelCount: number; get conf(): any; } interface InspectorInstanceData { className: string; created: number; isHoistModel: boolean; isHoistService: boolean; isStore: boolean; isCube: boolean; isView: boolean; isLinked: boolean; isXhImpl: boolean; hasLoadSupport: boolean; lastLoadCompleted: Date; lastLoadException: any; syncRun: number; } interface InspectorStat { id: number; timestamp: number; modelCount: number; modelCountChange: number; totalJSHeapSize: number; usedJSHeapSize: number; jsHeapSizeLimit: number; syncRun: number; } export {};