import { IAction } from '../../../base/common/actions.js'; import { INotificationSource, NotificationPriority } from '../../notification/common/notification.js'; export declare const IProgressService: import("../../instantiation/common/instantiation.js").ServiceIdentifier; /** * A progress service that can be used to report progress to various locations of the UI. */ export interface IProgressService { readonly _serviceBrand: undefined; withProgress(options: IProgressOptions | IProgressDialogOptions | IProgressNotificationOptions | IProgressWindowOptions | IProgressCompositeOptions, task: (progress: IProgress) => Promise, onDidCancel?: (choice?: number) => void): Promise; } export interface IProgressIndicator { /** * Show progress customized with the provided flags. */ show(infinite: true, delay?: number): IProgressRunner; show(total: number, delay?: number): IProgressRunner; /** * Indicate progress for the duration of the provided promise. Progress will stop in * any case of promise completion, error or cancellation. */ showWhile(promise: Promise, delay?: number): Promise; } export declare enum ProgressLocation { Explorer = 1, Scm = 3, Extensions = 5, Window = 10, Notification = 15, Dialog = 20 } export interface IProgressOptions { readonly location: ProgressLocation | string; readonly title?: string; readonly source?: string | INotificationSource; readonly total?: number; readonly cancellable?: boolean | string; readonly buttons?: string[]; } export interface IProgressNotificationOptions extends IProgressOptions { readonly location: ProgressLocation.Notification; readonly primaryActions?: readonly IAction[]; readonly secondaryActions?: readonly IAction[]; readonly delay?: number; readonly priority?: NotificationPriority; readonly type?: 'loading' | 'syncing'; } export interface IProgressDialogOptions extends IProgressOptions { readonly delay?: number; readonly detail?: string; readonly sticky?: boolean; } export interface IProgressWindowOptions extends IProgressOptions { readonly location: ProgressLocation.Window; readonly command?: string; readonly type?: 'loading' | 'syncing'; } export interface IProgressCompositeOptions extends IProgressOptions { readonly location: ProgressLocation.Explorer | ProgressLocation.Extensions | ProgressLocation.Scm | string; readonly delay?: number; } export interface IProgressStep { message?: string; increment?: number; total?: number; } export interface IProgressRunner { total(value: number): void; worked(value: number): void; done(): void; } export declare const emptyProgressRunner: Readonly; export interface IProgress { report(item: T): void; } export declare class Progress implements IProgress { private callback; static readonly None: Readonly>; private _value?; get value(): T | undefined; constructor(callback: (data: T) => unknown); report(item: T): void; } export declare const IEditorProgressService: import("../../instantiation/common/instantiation.js").ServiceIdentifier; /** * A progress service that will report progress local to the editor triggered from. */ export interface IEditorProgressService extends IProgressIndicator { readonly _serviceBrand: undefined; }