-
Notifications
You must be signed in to change notification settings - Fork 6
/
vscode.proposed.notebookWorkspaceEdit.d.ts
85 lines (71 loc) · 2.82 KB
/
vscode.proposed.notebookWorkspaceEdit.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/106744
/**
* A notebook edit represents edits that should be applied to the contents of a notebook.
*/
export class NotebookEdit {
/**
* Utility to create a edit that replaces cells in a notebook.
*
* @param range The range of cells to replace
* @param newCells The new notebook cells.
*/
static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit;
/**
* Utility to create an edit that replaces cells in a notebook.
*
* @param index The index to insert cells at.
* @param newCells The new notebook cells.
*/
static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit;
/**
* Utility to create an edit that deletes cells in a notebook.
*
* @param range The range of cells to delete.
*/
static deleteCells(range: NotebookRange): NotebookEdit;
/**
* Utility to create an edit that update a cell's metadata.
*
* @param index The index of the cell to update.
* @param newCellMetadata The new metadata for the cell.
*/
static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit;
/**
* Utility to create an edit that updates the notebook's metadata.
*
* @param newNotebookMetadata The new metadata for the notebook.
*/
static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit;
/**
* Range of the cells being edited. May be empty.
*/
range: NotebookRange;
/**
* New cells being inserted. May be empty.
*/
newCells: NotebookCellData[];
/**
* Optional new metadata for the cells.
*/
newCellMetadata?: { [key: string]: any };
/**
* Optional new metadata for the notebook.
*/
newNotebookMetadata?: { [key: string]: any };
constructor(range: NotebookRange, newCells: NotebookCellData[]);
}
export interface WorkspaceEdit {
/**
* Set (and replace) edits for a resource.
*
* @param uri A resource identifier.
* @param edits An array of text or notebook edits.
*/
set(uri: Uri, edits: TextEdit[] | NotebookEdit[]): void;
}
}