1 import { NotificationHandler, RequestHandler, ProgressType, ProgressToken } from 'vscode-jsonrpc';
2 import { uinteger } from 'vscode-languageserver-types';
3 import { ProtocolRequestType, ProtocolNotificationType } from './messages';
4 export interface WorkDoneProgressClientCapabilities {
6 * Window specific client capabilities.
10 * Whether client supports server initiated progress using the
11 * `window/workDoneProgress/create` request.
15 workDoneProgress?: boolean;
18 export interface WorkDoneProgressBegin {
21 * Mandatory title of the progress operation. Used to briefly inform about
22 * the kind of operation being performed.
24 * Examples: "Indexing" or "Linking dependencies".
28 * Controls if a cancel button should show to allow the user to cancel the
29 * long running operation. Clients that don't support cancellation are allowed
30 * to ignore the setting.
32 cancellable?: boolean;
34 * Optional, more detailed associated progress message. Contains
35 * complementary information to the `title`.
37 * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
38 * If unset, the previous progress message (if any) is still valid.
42 * Optional progress percentage to display (value 100 is considered 100%).
43 * If not provided infinite progress is assumed and clients are allowed
44 * to ignore the `percentage` value in subsequent in report notifications.
46 * The value should be steadily rising. Clients are free to ignore values
47 * that are not following this rule. The value range is [0, 100].
49 percentage?: uinteger;
51 export interface WorkDoneProgressReport {
54 * Controls enablement state of a cancel button.
56 * Clients that don't support cancellation or don't support controlling the button's
57 * enablement state are allowed to ignore the property.
59 cancellable?: boolean;
61 * Optional, more detailed associated progress message. Contains
62 * complementary information to the `title`.
64 * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
65 * If unset, the previous progress message (if any) is still valid.
69 * Optional progress percentage to display (value 100 is considered 100%).
70 * If not provided infinite progress is assumed and clients are allowed
71 * to ignore the `percentage` value in subsequent in report notifications.
73 * The value should be steadily rising. Clients are free to ignore values
74 * that are not following this rule. The value range is [0, 100]
76 percentage?: uinteger;
78 export interface WorkDoneProgressEnd {
81 * Optional, a final message indicating to for example indicate the outcome
86 export declare namespace WorkDoneProgress {
87 const type: ProgressType<WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd>;
88 function is(value: ProgressType<any>): value is typeof type;
90 export interface WorkDoneProgressCreateParams {
92 * The token to be used to report progress.
97 * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
98 * reporting from the server.
100 export declare namespace WorkDoneProgressCreateRequest {
101 const type: ProtocolRequestType<WorkDoneProgressCreateParams, void, never, void, void>;
102 type HandlerSignature = RequestHandler<WorkDoneProgressCreateParams, void, void>;
104 export interface WorkDoneProgressCancelParams {
106 * The token to be used to report progress.
108 token: ProgressToken;
111 * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
112 * initiated on the server side.
114 export declare namespace WorkDoneProgressCancelNotification {
115 const type: ProtocolNotificationType<WorkDoneProgressCancelParams, void>;
116 type HandlerSignature = NotificationHandler<WorkDoneProgressCancelParams>;