1 | import { CancellationToken, ProgressToken, ProgressType, WorkDoneProgressParams, PartialResultParams } from 'vscode-languageserver-protocol';
|
2 | import type { Feature, _RemoteWindow } from './server';
|
3 | export interface ProgressContext {
|
4 | sendProgress<P>(type: ProgressType<P>, token: ProgressToken, value: P): void;
|
5 | }
|
6 | export interface WorkDoneProgressReporter {
|
7 | begin(title: string, percentage?: number, message?: string, cancellable?: boolean): void;
|
8 | report(percentage: number): void;
|
9 | report(message: string): void;
|
10 | report(percentage: number, message: string): void;
|
11 | done(): void;
|
12 | }
|
13 | export interface WorkDoneProgressServerReporter extends WorkDoneProgressReporter {
|
14 | readonly token: CancellationToken;
|
15 | }
|
16 | export interface WindowProgress {
|
17 | attachWorkDoneProgress(token: ProgressToken | undefined): WorkDoneProgressReporter;
|
18 | createWorkDoneProgress(): Promise<WorkDoneProgressServerReporter>;
|
19 | }
|
20 | export declare function attachWorkDone(connection: ProgressContext, params: WorkDoneProgressParams | undefined): WorkDoneProgressReporter;
|
21 | export declare const ProgressFeature: Feature<_RemoteWindow, WindowProgress>;
|
22 | export interface ResultProgressReporter<R> {
|
23 | report(data: R): void;
|
24 | }
|
25 | export declare function attachPartialResult<R>(connection: ProgressContext, params: PartialResultParams): ResultProgressReporter<R> | undefined;
|