Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions javascript/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,11 @@ export interface ISharedCodeCell
outputs: Array<nbformat.IOutput>
): void;

/**
* Clear all outputs from the cell.
*/
clearOutputs(): void;

/**
* Serialize the model to JSON.
*/
Expand Down
13 changes: 13 additions & 0 deletions javascript/src/ycell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,19 @@ export class YCodeCell
);
}

/**
* Clear all outputs from the cell.
*/
clearOutputs(origin: any = null): void {
this.transact(
() => {
this._youtputs.delete(0, this._youtputs.length);
},
false,
origin
);
}

/**
* Serialize the model to JSON.
*/
Expand Down
Loading