@@ -160,6 +160,7 @@ declare module 'vscode' {
160
160
}
161
161
162
162
export interface NotebookCell {
163
+ readonly index : number ;
163
164
readonly notebook : NotebookDocument ;
164
165
readonly uri : Uri ;
165
166
readonly cellKind : CellKind ;
@@ -246,27 +247,16 @@ declare module 'vscode' {
246
247
247
248
export interface WorkspaceEdit {
248
249
replaceNotebookMetadata ( uri : Uri , value : NotebookDocumentMetadata ) : void ;
249
- replaceCells ( uri : Uri , start : number , end : number , cells : NotebookCellData [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
250
- replaceCellOutput ( uri : Uri , index : number , outputs : CellOutput [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
251
- replaceCellMetadata ( uri : Uri , index : number , cellMetadata : NotebookCellMetadata , metadata ?: WorkspaceEditEntryMetadata ) : void ;
250
+ replaceNotebookCells ( uri : Uri , start : number , end : number , cells : NotebookCellData [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
251
+ replaceNotebookCellOutput ( uri : Uri , index : number , outputs : CellOutput [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
252
+ replaceNotebookCellMetadata ( uri : Uri , index : number , cellMetadata : NotebookCellMetadata , metadata ?: WorkspaceEditEntryMetadata ) : void ;
252
253
}
253
254
254
255
export interface NotebookEditorEdit {
255
-
256
- replaceNotebookMetadata ( value : NotebookDocumentMetadata ) : void ;
257
-
256
+ replaceMetadata ( value : NotebookDocumentMetadata ) : void ;
258
257
replaceCells ( start : number , end : number , cells : NotebookCellData [ ] ) : void ;
259
258
replaceCellOutput ( index : number , outputs : CellOutput [ ] ) : void ;
260
259
replaceCellMetadata ( index : number , metadata : NotebookCellMetadata ) : void ;
261
-
262
- /** @deprecated */
263
- replaceOutput ( index : number , outputs : CellOutput [ ] ) : void ;
264
- /** @deprecated */
265
- replaceMetadata ( index : number , metadata : NotebookCellMetadata ) : void ;
266
- /** @deprecated */
267
- insert ( index : number , content : string | string [ ] , language : string , type : CellKind , outputs : CellOutput [ ] , metadata : NotebookCellMetadata | undefined ) : void ;
268
- /** @deprecated */
269
- delete ( index : number ) : void ;
270
260
}
271
261
272
262
export interface NotebookCellRange {
@@ -350,6 +340,16 @@ declare module 'vscode' {
350
340
*/
351
341
asWebviewUri ( localResource : Uri ) : Uri ;
352
342
343
+ /**
344
+ * Perform an edit on the notebook associated with this notebook editor.
345
+ *
346
+ * The given callback-function is invoked with an [edit-builder](#NotebookEditorEdit) which must
347
+ * be used to make edits. Note that the edit-builder is only valid while the
348
+ * callback executes.
349
+ *
350
+ * @param callback A function which can create edits using an [edit-builder](#NotebookEditorEdit).
351
+ * @return A promise that resolves with a value indicating if the edits could be applied.
352
+ */
353
353
edit ( callback : ( editBuilder : NotebookEditorEdit ) => void ) : Thenable < boolean > ;
354
354
355
355
revealRange ( range : NotebookCellRange , revealType ?: NotebookEditorRevealType ) : void ;
0 commit comments