/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { Event } from '@sussudio/base/common/event.mjs';
import { Disposable } from '@sussudio/base/common/lifecycle.mjs';
import { ILogService } from '../../log/common/log.mjs';
export declare const ISharedProcessLifecycleService: import('../../instantiation/common/instantiation.mjs').ServiceIdentifier<ISharedProcessLifecycleService>;
export interface ISharedProcessLifecycleService {
	readonly _serviceBrand: undefined;
	/**
	 * An event that fires after after no window has vetoed the shutdown sequence. At
	 * this point listeners are ensured that the application will quit without veto.
	 */
	readonly onWillShutdown: Event<ShutdownEvent>;
}
export interface ShutdownEvent {
	/**
	 * Allows to join the shutdown. The promise can be a long running operation but it
	 * will block the application from closing.
	 */
	join(promise: Promise<void>): void;
}
export declare class SharedProcessLifecycleService extends Disposable implements ISharedProcessLifecycleService {
	private readonly logService;
	readonly _serviceBrand: undefined;
	private pendingWillShutdownPromise;
	private readonly _onWillShutdown;
	readonly onWillShutdown: Event<ShutdownEvent>;
	constructor(logService: ILogService);
	fireOnWillShutdown(): Promise<void>;
}
