import { IRPCProtocol } from '@opensumi/ide-connection';
import { Event, URI } from '@opensumi/ide-core-common';
import { ExtensionDocumentDataManager, ExtensionNotebookDocumentManager, IExtHostMessage, IExtHostWorkspace, IMainThreadWorkspace, WorkspaceRootsChangeEvent } from '../../../common/vscode';
import { Uri, WorkspaceEdit } from '../../../common/vscode/ext-types';
import { ExtensionIdentifier, IExtensionDescription } from '../../../common/vscode/extension';
import { UriComponents } from '../../../common/vscode/models';
import { WorkspaceFolder } from '../../../common/vscode/models/workspace';
import { IExtHostTasks } from '../../../common/vscode/tasks';
import { ExtHostFileSystem } from './ext.host.file-system';
import { ExtHostFileSystemEvent } from './ext.host.file-system-event';
import { ExtHostPreference } from './ext.host.preference';
import type vscode from 'vscode';
export declare function createWorkspaceApiFactory(extHostWorkspace: ExtHostWorkspace, extHostPreference: ExtHostPreference, extHostDocument: ExtensionDocumentDataManager, extHostNotebook: ExtensionNotebookDocumentManager, extHostFileSystem: ExtHostFileSystem, extHostFileSystemEvent: ExtHostFileSystemEvent, extHostTasks: IExtHostTasks, extension: IExtensionDescription): {
    rootPath: string | undefined;
    name: string | undefined;
    asRelativePath: (pathOrUri: string | Uri, includeWorkspaceFolder?: boolean) => string | undefined;
    updateWorkspaceFolders: (start: number, deleteCount: number | undefined | null, ...workspaceFoldersToAdd: {
        uri: Uri;
        name?: string;
    }[]) => boolean;
    onDidChangeWorkspaceFolders: Event<vscode.WorkspaceFoldersChangeEvent>;
    getWorkspaceFolder: (uri: any, resolveParent: any) => vscode.WorkspaceFolder | undefined;
    workspaceFolders: vscode.WorkspaceFolder[] | undefined;
    getConfiguration: (section: any, resource: any, extensionId: any) => import("../../../common/vscode").WorkspaceConfiguration;
    onDidChangeConfiguration: (listener: any, thisArgs?: any, disposables?: any) => import("@opensumi/ide-core-common").IDisposable;
    readonly isTrusted: boolean;
    requestWorkspaceTrust: (_options?: vscode.WorkspaceTrustRequestOptions) => boolean;
    onDidGrantWorkspaceTrust: Event<any>;
    openTextDocument: (uriOrFileNameOrOptions?: Uri | string | {
        language?: string;
        content?: string;
    }) => Promise<vscode.TextDocument>;
    onDidOpenTextDocument: Event<vscode.TextDocument>;
    onDidCloseTextDocument: Event<vscode.TextDocument>;
    onDidChangeTextDocument: Event<vscode.TextDocumentChangeEvent>;
    onWillSaveTextDocument: Event<vscode.TextDocumentWillSaveEvent>;
    onDidSaveTextDocument: Event<vscode.TextDocument>;
    registerTextDocumentContentProvider: (scheme: string, provider: vscode.TextDocumentContentProvider) => import("@opensumi/ide-core-common").IDisposable;
    registerTaskProvider: (type: any, provider: any) => import("@opensumi/ide-core-common").IDisposable;
    applyEdit: (edit: any, metadata?: vscode.WorkspaceEditMetadata) => Promise<boolean>;
    readonly textDocuments: vscode.TextDocument[];
    registerFileSystemProvider(scheme: any, provider: any, options: any): import("@opensumi/ide-core-common").IDisposable;
    readonly fs: vscode.FileSystem;
    createFileSystemWatcher: (pattern: any, ignoreCreate: any, ignoreChange: any, ignoreDelete: any) => vscode.FileSystemWatcher;
    onDidCreateFiles: (listener: (e: vscode.FileCreateEvent) => any, thisArg?: any, disposables?: vscode.Disposable[]) => import("@opensumi/ide-core-common").IDisposable;
    onDidDeleteFiles: (listener: (e: vscode.FileDeleteEvent) => any, thisArg?: any, disposables?: vscode.Disposable[]) => import("@opensumi/ide-core-common").IDisposable;
    onDidRenameFiles: (listener: (e: vscode.FileRenameEvent) => any, thisArg?: any, disposables?: vscode.Disposable[]) => import("@opensumi/ide-core-common").IDisposable;
    onWillCreateFiles: (listener: (e: vscode.FileWillCreateEvent) => any, thisArg?: any, disposables?: vscode.Disposable[]) => import("@opensumi/ide-core-common").IDisposable;
    onWillDeleteFiles: (listener: (e: vscode.FileWillDeleteEvent) => any, thisArg?: any, disposables?: vscode.Disposable[]) => import("@opensumi/ide-core-common").IDisposable;
    onWillRenameFiles: (listener: (e: vscode.FileWillRenameEvent) => any, thisArg?: any, disposables?: vscode.Disposable[]) => import("@opensumi/ide-core-common").IDisposable;
    onDidRenameFile: Event<{
        oldUri: Uri;
        readonly newUri: Uri;
    }>;
    save: (uri: any) => Promise<URI | undefined>;
    saveAs: (uri: any) => Promise<URI | undefined>;
    saveAll: () => Promise<boolean>;
    findFiles: (include: any, exclude: any, maxResults?: any, token?: any) => Promise<vscode.Uri[]>;
    onDidOpenNotebookDocument: Event<vscode.NotebookDocument>;
    onDidChangeNotebookDocument: Event<vscode.NotebookDocumentChangeEvent>;
    onDidCloseNotebookDocument: Event<vscode.NotebookDocument>;
    onDidSaveNotebookDocument: Event<vscode.NotebookDocument>;
    readonly notebookDocuments: readonly vscode.NotebookDocument[];
    registerTimelineProvider: () => import("@opensumi/ide-core-common").IDisposable;
    registerPortAttributesProvider: () => import("@opensumi/ide-core-common").IDisposable;
    registerEditSessionIdentityProvider: () => import("@opensumi/ide-core-common").IDisposable;
    onWillCreateEditSessionIdentity: () => import("@opensumi/ide-core-common").IDisposable;
};
export declare function toWorkspaceFolder(folder: WorkspaceFolder, workspaceToName?: any): vscode.WorkspaceFolder;
export declare class ExtHostWorkspace implements IExtHostWorkspace {
    private extHostDoc;
    private workspaceFoldersChangedEmitter;
    readonly onDidChangeWorkspaceFolders: Event<vscode.WorkspaceFoldersChangeEvent>;
    protected readonly proxy: IMainThreadWorkspace;
    protected readonly rpcProtocol: IRPCProtocol;
    private folders;
    protected _workspaceFolder: vscode.WorkspaceFolder[];
    private messageService;
    private _onDidRenameFile;
    onDidRenameFile: Event<{
        oldUri: Uri;
        readonly newUri: Uri;
    }>;
    private workspaceToName;
    constructor(rpcProtocol: IRPCProtocol, extHostMessage: IExtHostMessage, extHostDoc: ExtensionDocumentDataManager);
    /**
     * FileStat 转 vscode.WorkspaceFolder
     * @private
     * @param {FileStat} root
     * @param {number} index
     * @returns {vscode.WorkspaceFolder}
     * @memberof ExtHostWorkspace
     */
    private toWorkspaceFolder;
    private deltaFolders;
    private foldersDiff;
    get workspaceFolders(): vscode.WorkspaceFolder[] | undefined;
    get rootPath(): string | undefined;
    get name(): string | undefined;
    getRelativePath(pathOrUri: string | Uri, includeWorkspaceFolder?: boolean): string | undefined;
    updateWorkspaceFolders(start: number, deleteCount: number, ...workspaceFoldersToAdd: {
        uri: Uri;
        name?: string;
    }[]): boolean;
    $onWorkspaceFoldersChanged(event: WorkspaceRootsChangeEvent): void;
    getWorkspaceFolder(uri: Uri, resolveParent?: boolean): vscode.WorkspaceFolder | undefined;
    resolveWorkspaceFolder(): vscode.WorkspaceFolder[] | undefined;
    private hasFolder;
    applyEdit(edit: WorkspaceEdit, metadata?: vscode.WorkspaceEditMetadata): Promise<boolean>;
    save(uri: URI): Promise<URI | undefined>;
    saveAs(uri: URI): Promise<URI | undefined>;
    saveAll(): Promise<boolean>;
    $didRenameFile(oldUri: UriComponents, newUri: UriComponents): Promise<void>;
    findFiles(include: string | vscode.RelativePattern | undefined, exclude: vscode.GlobPattern | null | undefined, maxResults: number | undefined, extensionId: ExtensionIdentifier | null, token?: vscode.CancellationToken): Promise<vscode.Uri[]>;
}
//# sourceMappingURL=ext.host.workspace.d.ts.map