import { VSBufferReadable, VSBufferReadableStream } from "../../../../base/common/buffer.js"; import { CancellationToken } from "../../../../base/common/cancellation.js"; import { IWorkingCopyIdentifier, IWorkingCopyBackupMeta } from "./workingCopy.js"; import { IResolvedWorkingCopyBackup } from "./workingCopyBackup.js"; export declare const IWorkingCopyBackupService: import("../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; /** * The working copy backup service is the main service to handle backups * for working copies. * Methods allow to persist and resolve working copy backups from the file * system. */ export interface IWorkingCopyBackupService { readonly _serviceBrand: undefined; /** * Finds out if a working copy backup with the given identifier * and optional version exists. * * Note: if the backup service has not been initialized yet, this may return * the wrong result. Always use `resolve()` if you can do a long running * operation. */ hasBackupSync(identifier: IWorkingCopyIdentifier, versionId?: number): boolean; /** * Gets a list of working copy backups for the current workspace. */ getBackups(): Promise; /** * Resolves the working copy backup for the given identifier if that exists. */ resolve(identifier: IWorkingCopyIdentifier): Promise | undefined>; /** * Stores a new working copy backup for the given identifier. */ backup(identifier: IWorkingCopyIdentifier, content?: VSBufferReadable | VSBufferReadableStream, versionId?: number, meta?: IWorkingCopyBackupMeta, token?: CancellationToken): Promise; /** * Discards the working copy backup associated with the identifier if it exists. */ discardBackup(identifier: IWorkingCopyIdentifier, token?: CancellationToken): Promise; /** * Discards all working copy backups. * * The optional set of identifiers in the filter can be * provided to discard all but the provided ones. */ discardBackups(filter?: { except: IWorkingCopyIdentifier[]; }): Promise; }