massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-languageserver-protocol / lib / common / protocol.fileOperations.d.ts
1 import { NotificationHandler, RequestHandler } from 'vscode-jsonrpc';
2 import { WorkspaceEdit } from 'vscode-languageserver-types';
3 import { ProtocolNotificationType, ProtocolRequestType } from './messages';
4 /**
5  * Options for notifications/requests for user operations on files.
6  *
7  * @since 3.16.0
8  */
9 export interface FileOperationOptions {
10     /**
11     * The server is interested in didCreateFiles notifications.
12     */
13     didCreate?: FileOperationRegistrationOptions;
14     /**
15     * The server is interested in willCreateFiles requests.
16     */
17     willCreate?: FileOperationRegistrationOptions;
18     /**
19     * The server is interested in didRenameFiles notifications.
20     */
21     didRename?: FileOperationRegistrationOptions;
22     /**
23     * The server is interested in willRenameFiles requests.
24     */
25     willRename?: FileOperationRegistrationOptions;
26     /**
27     * The server is interested in didDeleteFiles file notifications.
28     */
29     didDelete?: FileOperationRegistrationOptions;
30     /**
31     * The server is interested in willDeleteFiles file requests.
32     */
33     willDelete?: FileOperationRegistrationOptions;
34 }
35 /**
36  * The options to register for file operations.
37  *
38  * @since 3.16.0
39  */
40 export interface FileOperationRegistrationOptions {
41     /**
42      * The actual filters.
43      */
44     filters: FileOperationFilter[];
45 }
46 /**
47  * A pattern kind describing if a glob pattern matches a file a folder or
48  * both.
49  *
50  * @since 3.16.0
51  */
52 export declare namespace FileOperationPatternKind {
53     /**
54      * The pattern matches a file only.
55      */
56     const file: 'file';
57     /**
58      * The pattern matches a folder only.
59      */
60     const folder: 'folder';
61 }
62 export declare type FileOperationPatternKind = 'file' | 'folder';
63 /**
64  * Matching options for the file operation pattern.
65  *
66  * @since 3.16.0
67  */
68 export interface FileOperationPatternOptions {
69     /**
70      * The pattern should be matched ignoring casing.
71      */
72     ignoreCase?: boolean;
73 }
74 /**
75  * A pattern to describe in which file operation requests or notifications
76  * the server is interested in.
77  *
78  * @since 3.16.0
79  */
80 interface FileOperationPattern {
81     /**
82      * The glob pattern to match. Glob patterns can have the following syntax:
83      * - `*` to match one or more characters in a path segment
84      * - `?` to match on one character in a path segment
85      * - `**` to match any number of path segments, including none
86      * - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
87      * - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
88      * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
89      */
90     glob: string;
91     /**
92      * Whether to match files or folders with this pattern.
93      *
94      * Matches both if undefined.
95      */
96     matches?: FileOperationPatternKind;
97     /**
98      * Additional options used during matching.
99      */
100     options?: FileOperationPatternOptions;
101 }
102 /**
103  * A filter to describe in which file operation requests or notifications
104  * the server is interested in.
105  *
106  * @since 3.16.0
107  */
108 export interface FileOperationFilter {
109     /**
110      * A Uri like `file` or `untitled`.
111      */
112     scheme?: string;
113     /**
114      * The actual file operation pattern.
115      */
116     pattern: FileOperationPattern;
117 }
118 /**
119  * Capabilities relating to events from file operations by the user in the client.
120  *
121  * These events do not come from the file system, they come from user operations
122  * like renaming a file in the UI.
123  *
124  * @since 3.16.0
125  */
126 export interface FileOperationClientCapabilities {
127     /**
128      * Whether the client supports dynamic registration for file requests/notifications.
129      */
130     dynamicRegistration?: boolean;
131     /**
132      * The client has support for sending didCreateFiles notifications.
133      */
134     didCreate?: boolean;
135     /**
136      * The client has support for willCreateFiles requests.
137      */
138     willCreate?: boolean;
139     /**
140      * The client has support for sending didRenameFiles notifications.
141      */
142     didRename?: boolean;
143     /**
144      * The client has support for willRenameFiles requests.
145      */
146     willRename?: boolean;
147     /**
148      * The client has support for sending didDeleteFiles notifications.
149      */
150     didDelete?: boolean;
151     /**
152      * The client has support for willDeleteFiles requests.
153      */
154     willDelete?: boolean;
155 }
156 /**
157  * The parameters sent in file create requests/notifications.
158  *
159  * @since 3.16.0
160  */
161 export interface CreateFilesParams {
162     /**
163      * An array of all files/folders created in this operation.
164      */
165     files: FileCreate[];
166 }
167 /**
168  * Represents information on a file/folder create.
169  *
170  * @since 3.16.0
171  */
172 export interface FileCreate {
173     /**
174      * A file:// URI for the location of the file/folder being created.
175      */
176     uri: string;
177 }
178 /**
179  * The parameters sent in file rename requests/notifications.
180  *
181  * @since 3.16.0
182  */
183 export interface RenameFilesParams {
184     /**
185      * An array of all files/folders renamed in this operation. When a folder is renamed, only
186      * the folder will be included, and not its children.
187      */
188     files: FileRename[];
189 }
190 /**
191  * Represents information on a file/folder rename.
192  *
193  * @since 3.16.0
194  */
195 export interface FileRename {
196     /**
197      * A file:// URI for the original location of the file/folder being renamed.
198      */
199     oldUri: string;
200     /**
201      * A file:// URI for the new location of the file/folder being renamed.
202      */
203     newUri: string;
204 }
205 /**
206  * The parameters sent in file delete requests/notifications.
207  *
208  * @since 3.16.0
209  */
210 export interface DeleteFilesParams {
211     /**
212      * An array of all files/folders deleted in this operation.
213      */
214     files: FileDelete[];
215 }
216 /**
217  * Represents information on a file/folder delete.
218  *
219  * @since 3.16.0
220  */
221 export interface FileDelete {
222     /**
223      * A file:// URI for the location of the file/folder being deleted.
224      */
225     uri: string;
226 }
227 /**
228  * The will create files request is sent from the client to the server before files are actually
229  * created as long as the creation is triggered from within the client.
230  *
231  * @since 3.16.0
232  */
233 export declare namespace WillCreateFilesRequest {
234     const method: 'workspace/willCreateFiles';
235     const type: ProtocolRequestType<CreateFilesParams, WorkspaceEdit | null, never, void, FileOperationRegistrationOptions>;
236     type HandlerSignature = RequestHandler<CreateFilesParams, WorkspaceEdit | undefined | null, void>;
237 }
238 /**
239  * The did create files notification is sent from the client to the server when
240  * files were created from within the client.
241  *
242  * @since 3.16.0
243  */
244 export declare namespace DidCreateFilesNotification {
245     const method: 'workspace/didCreateFiles';
246     const type: ProtocolNotificationType<CreateFilesParams, FileOperationRegistrationOptions>;
247     type HandlerSignature = NotificationHandler<CreateFilesParams>;
248 }
249 /**
250  * The will rename files request is sent from the client to the server before files are actually
251  * renamed as long as the rename is triggered from within the client.
252  *
253  * @since 3.16.0
254  */
255 export declare namespace WillRenameFilesRequest {
256     const method: 'workspace/willRenameFiles';
257     const type: ProtocolRequestType<RenameFilesParams, WorkspaceEdit | null, never, void, FileOperationRegistrationOptions>;
258     type HandlerSignature = RequestHandler<RenameFilesParams, WorkspaceEdit | undefined | null, void>;
259 }
260 /**
261  * The did rename files notification is sent from the client to the server when
262  * files were renamed from within the client.
263  *
264  * @since 3.16.0
265  */
266 export declare namespace DidRenameFilesNotification {
267     const method: 'workspace/didRenameFiles';
268     const type: ProtocolNotificationType<RenameFilesParams, FileOperationRegistrationOptions>;
269     type HandlerSignature = NotificationHandler<RenameFilesParams>;
270 }
271 /**
272  * The will delete files request is sent from the client to the server before files are actually
273  * deleted as long as the deletion is triggered from within the client.
274  *
275  * @since 3.16.0
276  */
277 export declare namespace DidDeleteFilesNotification {
278     const method: 'workspace/didDeleteFiles';
279     const type: ProtocolNotificationType<DeleteFilesParams, FileOperationRegistrationOptions>;
280     type HandlerSignature = NotificationHandler<DeleteFilesParams>;
281 }
282 /**
283  * The did delete files notification is sent from the client to the server when
284  * files were deleted from within the client.
285  *
286  * @since 3.16.0
287  */
288 export declare namespace WillDeleteFilesRequest {
289     const method: 'workspace/willDeleteFiles';
290     const type: ProtocolRequestType<DeleteFilesParams, WorkspaceEdit | null, never, void, FileOperationRegistrationOptions>;
291     type HandlerSignature = RequestHandler<DeleteFilesParams, WorkspaceEdit | undefined | null, void>;
292 }
293 export {};