@@ -160,6 +160,7 @@ declare module 'vscode' {
160160 }
161161
162162 export interface NotebookCell {
163+ readonly index : number ;
163164 readonly notebook : NotebookDocument ;
164165 readonly uri : Uri ;
165166 readonly cellKind : CellKind ;
@@ -246,27 +247,16 @@ declare module 'vscode' {
246247
247248 export interface WorkspaceEdit {
248249 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 ;
252253 }
253254
254255 export interface NotebookEditorEdit {
255-
256- replaceNotebookMetadata ( value : NotebookDocumentMetadata ) : void ;
257-
256+ replaceMetadata ( value : NotebookDocumentMetadata ) : void ;
258257 replaceCells ( start : number , end : number , cells : NotebookCellData [ ] ) : void ;
259258 replaceCellOutput ( index : number , outputs : CellOutput [ ] ) : void ;
260259 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 ;
270260 }
271261
272262 export interface NotebookCellRange {
@@ -350,6 +340,16 @@ declare module 'vscode' {
350340 */
351341 asWebviewUri ( localResource : Uri ) : Uri ;
352342
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+ */
353353 edit ( callback : ( editBuilder : NotebookEditorEdit ) => void ) : Thenable < boolean > ;
354354
355355 revealRange ( range : NotebookCellRange , revealType ?: NotebookEditorRevealType ) : void ;
0 commit comments