1 | import { NotificationHandler, RequestHandler, ProgressType, ProgressToken } from 'vscode-jsonrpc';
|
2 | import { uinteger } from 'vscode-languageserver-types';
|
3 | import { MessageDirection, ProtocolRequestType, ProtocolNotificationType } from './messages';
|
4 | export interface WorkDoneProgressBegin {
|
5 | kind: 'begin';
|
6 | /**
|
7 | * Mandatory title of the progress operation. Used to briefly inform about
|
8 | * the kind of operation being performed.
|
9 | *
|
10 | * Examples: "Indexing" or "Linking dependencies".
|
11 | */
|
12 | title: string;
|
13 | /**
|
14 | * Controls if a cancel button should show to allow the user to cancel the
|
15 | * long running operation. Clients that don't support cancellation are allowed
|
16 | * to ignore the setting.
|
17 | */
|
18 | cancellable?: boolean;
|
19 | /**
|
20 | * Optional, more detailed associated progress message. Contains
|
21 | * complementary information to the `title`.
|
22 | *
|
23 | * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
|
24 | * If unset, the previous progress message (if any) is still valid.
|
25 | */
|
26 | message?: string;
|
27 | /**
|
28 | * Optional progress percentage to display (value 100 is considered 100%).
|
29 | * If not provided infinite progress is assumed and clients are allowed
|
30 | * to ignore the `percentage` value in subsequent in report notifications.
|
31 | *
|
32 | * The value should be steadily rising. Clients are free to ignore values
|
33 | * that are not following this rule. The value range is [0, 100].
|
34 | */
|
35 | percentage?: uinteger;
|
36 | }
|
37 | export interface WorkDoneProgressReport {
|
38 | kind: 'report';
|
39 | /**
|
40 | * Controls enablement state of a cancel button.
|
41 | *
|
42 | * Clients that don't support cancellation or don't support controlling the button's
|
43 | * enablement state are allowed to ignore the property.
|
44 | */
|
45 | cancellable?: boolean;
|
46 | /**
|
47 | * Optional, more detailed associated progress message. Contains
|
48 | * complementary information to the `title`.
|
49 | *
|
50 | * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
|
51 | * If unset, the previous progress message (if any) is still valid.
|
52 | */
|
53 | message?: string;
|
54 | /**
|
55 | * Optional progress percentage to display (value 100 is considered 100%).
|
56 | * If not provided infinite progress is assumed and clients are allowed
|
57 | * to ignore the `percentage` value in subsequent in report notifications.
|
58 | *
|
59 | * The value should be steadily rising. Clients are free to ignore values
|
60 | * that are not following this rule. The value range is [0, 100]
|
61 | */
|
62 | percentage?: uinteger;
|
63 | }
|
64 | export interface WorkDoneProgressEnd {
|
65 | kind: 'end';
|
66 | /**
|
67 | * Optional, a final message indicating to for example indicate the outcome
|
68 | * of the operation.
|
69 | */
|
70 | message?: string;
|
71 | }
|
72 | export declare namespace WorkDoneProgress {
|
73 | const type: ProgressType<WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd>;
|
74 | function is(value: ProgressType<any>): value is typeof type;
|
75 | }
|
76 | export interface WorkDoneProgressCreateParams {
|
77 | /**
|
78 | * The token to be used to report progress.
|
79 | */
|
80 | token: ProgressToken;
|
81 | }
|
82 | /**
|
83 | * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
|
84 | * reporting from the server.
|
85 | */
|
86 | export declare namespace WorkDoneProgressCreateRequest {
|
87 | const method: 'window/workDoneProgress/create';
|
88 | const messageDirection: MessageDirection;
|
89 | const type: ProtocolRequestType<WorkDoneProgressCreateParams, void, never, void, void>;
|
90 | type HandlerSignature = RequestHandler<WorkDoneProgressCreateParams, void, void>;
|
91 | }
|
92 | export interface WorkDoneProgressCancelParams {
|
93 | /**
|
94 | * The token to be used to report progress.
|
95 | */
|
96 | token: ProgressToken;
|
97 | }
|
98 | /**
|
99 | * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
|
100 | * initiated on the server side.
|
101 | */
|
102 | export declare namespace WorkDoneProgressCancelNotification {
|
103 | const method: 'window/workDoneProgress/cancel';
|
104 | const messageDirection: MessageDirection;
|
105 | const type: ProtocolNotificationType<WorkDoneProgressCancelParams, void>;
|
106 | type HandlerSignature = NotificationHandler<WorkDoneProgressCancelParams>;
|
107 | }
|