import { IWorkspaceFolder } from './workspace'; import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri'; import { Event } from '@vscode-alt/monaco-editor/esm/vs/base/common/event'; import { IWorkspaceIdentifier } from '../generated-model'; // src/vs/platform/workspace/common/workspaces.ts /** * A single folder workspace identifier is just the path to the folder. */ export type ISingleFolderWorkspaceIdentifier = URI; // export interface IWorkspaceIdentifier { // id: string; // configPath: URI; // } export interface IStoredWorkspace { folders: IStoredWorkspaceFolder[]; } export interface IWorkspaceSavedEvent { workspace: IWorkspaceIdentifier; oldConfigPath: string; } export interface IRawFileWorkspaceFolder { path: string; name?: string; } export interface IRawUriWorkspaceFolder { uri: string; name?: string; } export type IStoredWorkspaceFolder = IRawFileWorkspaceFolder | IRawUriWorkspaceFolder; export interface IResolvedWorkspace extends IWorkspaceIdentifier { folders: IWorkspaceFolder[]; remoteAuthority?: string; } export interface IStoredWorkspace { folders: IStoredWorkspaceFolder[]; remoteAuthority?: string; } export interface IWorkspaceSavedEvent { workspace: IWorkspaceIdentifier; oldConfigPath: string; } export interface IWorkspaceFolderCreationData { uri: URI; name?: string; } export interface IUntitledWorkspaceInfo { workspace: IWorkspaceIdentifier; remoteAuthority?: string; } export interface IWorkspacesMainService extends IWorkspacesService { onUntitledWorkspaceDeleted: Event; createUntitledWorkspaceSync(folders?: IWorkspaceFolderCreationData[]): IWorkspaceIdentifier; resolveLocalWorkspaceSync(path: URI): IResolvedWorkspace | null; isUntitledWorkspace(workspace: IWorkspaceIdentifier): boolean; deleteUntitledWorkspaceSync(workspace: IWorkspaceIdentifier): void; getUntitledWorkspacesSync(): IUntitledWorkspaceInfo[]; } export interface IWorkspacesService { // _serviceBrand: any; createUntitledWorkspace(folders?: IWorkspaceFolderCreationData[], remoteAuthority?: string): Promise; deleteUntitledWorkspace(workspace: IWorkspaceIdentifier): Promise; getWorkspaceIdentifier(workspacePath: URI): Promise; } export type IMultiFolderWorkspaceInitializationPayload = IWorkspaceIdentifier; export interface ISingleFolderWorkspaceInitializationPayload { id: string; folder: ISingleFolderWorkspaceIdentifier; } export interface IEmptyWorkspaceInitializationPayload { id: string; } export type IWorkspaceInitializationPayload = IMultiFolderWorkspaceInitializationPayload | ISingleFolderWorkspaceInitializationPayload | IEmptyWorkspaceInitializationPayload;