import { Deferred, ExtensionActivateEvent } from '@opensumi/ide-core-browser';
import { WithEventBus } from '@opensumi/ide-core-common';
import { IFileServiceClient } from '@opensumi/ide-file-service';
import { ERestartPolicy, ExtensionHostType, ExtensionService } from '../common';
import { ActivatedExtension } from '../common/activator';
import { Extension } from './extension';
import { ExtensionDidEnabledEvent } from './types';
export declare class ExtensionServiceImpl extends WithEventBus implements ExtensionService {
    static extraMetadata: {
        languageBundle: string;
    };
    private readonly extensionNodeClient;
    private readonly appConfig;
    private readonly commandRegistry;
    private readonly activationEventService;
    private readonly workspaceService;
    private readonly extensionStorageService;
    private readonly progressService;
    private readonly dialogService;
    private readonly clientApp;
    private readonly logger;
    private readonly messageService;
    private readonly corePreferences;
    private readonly workerExtensionService;
    private readonly nodeExtensionService;
    private readonly viewExtensionService;
    private readonly extensionCommandManager;
    private readonly extensionInstanceManageService;
    private readonly fileSearchService;
    private readonly contributesService;
    private readonly sumiContributesService;
    private readonly preferenceService;
    private readonly extensionStoragePathServer;
    private readonly injector;
    protected fileServiceClient: IFileServiceClient;
    constructor();
    /**
     * 这里的 ready 是区分环境，将 node/worker 区分开使用
     */
    private ready;
    private extensionMetaDataArr;
    private isExtProcessRestarting;
    private isExtProcessWaitingForRestart;
    private pCrashMessageModel;
    private isProgressShowing;
    eagerExtensionsActivated: Deferred<void>;
    private readonly channelHandler;
    /**
     * @internal 提供获取所有运行中的插件的列表数据
     */
    getActivatedExtensions(): Promise<{
        [key in ExtensionHostType]?: ActivatedExtension[];
    }>;
    /**
     * 插件目录
     * 主要为插件的读取目录
     */
    private extensionScanDir;
    /**
     * 补充的插件列表
     * 主要为插件的读取路径
     */
    private extensionCandidatePath;
    protected onActivateExtension(e: ExtensionActivateEvent): Promise<void>;
    /**
     * 插件激活后需更新插件进程数据
     */
    protected onExtensionEnabled(e: ExtensionDidEnabledEvent): Promise<void>;
    /**
     * 插件卸载后需更新插件进程数据
     */
    protected onExtensionUninstalled(): Promise<void>;
    activate(): Promise<void>;
    private setupExtensionNLSConfig;
    /**
     * 初始化插件列表数据
     * 包括插件目录和插件 Candidate
     * 以及 ExtensionMetaData
     */
    private initExtensionMetaData;
    /**
     * 初始化插件实例数据
     */
    private initExtensionInstanceData;
    private doActivate;
    /**
     * 重启插件进程
     */
    restartExtProcess(restartPolicy?: ERestartPolicy): Promise<void>;
    private extProcessRestartPromise;
    private disposeAllOverlayWindow;
    restartProgress: (restartPolicy?: ERestartPolicy) => Promise<void>;
    restartDebounced: import("lodash").DebouncedFunc<() => Promise<void>>;
    private extProcessRestartHandler;
    private getExtProcessPID;
    private startExtProcess;
    private startNodeExtHost;
    private startWorkerExtHost;
    /**
     * 更新插件进程中插件的数据
     */
    private updateExtHostData;
    /**
     * 发送 ActivationEvents
     */
    private fireActivationEventsIfNeed;
    private activateByWorkspaceContains;
    /**
     * 将插件的目录位置和文件位置，通过后端读取并缓存
     * 返回所有插件的 meta data
     */
    private getExtensionsMetaData;
    private runEagerExtensionsContributes;
    /**
     * 激活插件的 Contributes
     */
    runExtensionContributes(): Promise<void>;
    /**
     * 判断是否是 web 插件
     * 这里会多增加一个判断：是否启动了 node-ext-host
     * https://code.visualstudio.com/api/extension-guides/web-extensions#web-extension-enablement
     */
    private whetherWebExtension;
    /**
     * 给 Extension 使用 | 激活插件
     */
    activeExtension(extension: Extension): Promise<void>;
    private resetExtensionInstances;
    /**
     * 每次激活 sumi 插件的时候，都会尝试去激活 sumiContributes 中的 browserView，会导致 browserView 重复注册
     * 因此重启场景下需要先将这部分被激活的插件 dispose 掉
     */
    private disposeSumiViewExtension;
    private rerunSumiViewExtensionContributes;
    disposeExtProcess(): Promise<void>;
    disposeExtensions(): Promise<void>;
    executeExtensionCommand(command: string, args: any[]): Promise<void>;
    private get invalidReloadStrategy();
    $restartExtProcess(): Promise<void>;
    $processNotExist(): Promise<string>;
    showReloadWindow(): Promise<void>;
    $processCrashRestart(): Promise<void>;
}
//# sourceMappingURL=extension.service.d.ts.map