import { MonitorInfoDetail } from "../../FEA";
export declare type RestartParams = {
    forceRestart?: boolean;
};
declare type Manifest = any;
/**
 * Manages an orderly shutdown of Finsemble
 */
declare class Shutdown {
    timeout: number;
    runningServices: string[];
    hasShutdownGracefully: boolean;
    /**
     * This will contain a function if we're waiting for graceful shutdown to complete. That function
     * will be executed to resolve that wait.
     */
    gracefulShutdownResolver: (() => void) | null;
    constructor(timeout: number);
    /**
     * Returns a promise that resolves to true if the toolbar's claimed space has been released.
     * This is only relevant on MS Windows where assimilation claims operating system space to make
     * room for the toolbar. Sometimes assimilation can be slow to release that space, so we wait until
     * that space is released before we shut down Finsemble (otherwise the space remains claimed even after Finsemble has stopped running).
     *
     * See this.waitForClaimedSpaceRelease() because we don't wait indefinitely.
     *
     * The calculations can be tested by calling this function early, before waitForGracefulShutdown resolves.
     */
    isAllClaimedSpaceIsReleased(): Promise<boolean>;
    /**
     * Returns true if our toolbar isn't "claiming space" on the selected monitor (which only occurs
     * on MS Windows machines).
     */
    isMonitorReleased(monitor: MonitorInfoDetail): boolean;
    waitForClaimedSpaceRelease(): Promise<void>;
    /**
     * Signals that all active services have shut down.
     */
    servicesHaveShutdown(): void;
    /**
     * Sets this.gracefulShutdownResolver to be a Promise resolve for
     * calls to await waitForGracefulShutdown();
     */
    waitForGracefulShutdown(forceRestart?: boolean): Promise<void>;
    /**
     * Shuts down Finsemble except for this main window.
     *
     * If forceRestart is true, then graceful shutdown will be pre-empted after timeout seconds, otherwise
     * it will wait indefinitely (such as for workspace save dialog)
     */
    shutdownEverythingButThisWindow(forceRestart?: boolean): Promise<void>;
    /**
     * Publish a shutdown notification to all of Finsemble and then wait for services to shut down and claimed space to
     * be released before we terminate the application.
     */
    transmitShutdownRequest(): Promise<void>;
    /**
     * Publish a shutdown notification to all of Finsemble and then wait for services to shut down and claimed space to
     * be released before we restart the application.
     *
     * @param {*} [params.forceRestart] If forceRestart parameter is true, then force an immediate restart (but not before claimed space is released).
     */
    transmitRestartRequest(params?: RestartParams): Promise<void>;
}
export declare class ShutdownManager {
    shutdown: Shutdown;
    mostRecentListOfServices: string[];
    constructor(params: {
        manifest: Manifest;
    });
    /**
     * This function is invoked for each completion stage by the bootEngine. Each time, the passed `activeServices` argument
     * contains a more complete list of all active services. This function registers with the dependency manager for shutdown
     * notification, and when all services have shut down it signals Shutdown that it is safe to quit.
     */
    addActiveServicesToDependencyManager(activeServices: string[]): void;
}
export {};
//# sourceMappingURL=shutDownManager.d.ts.map