NotebookDocument

Represents a notebook which itself is a sequence of code or markup cells. Notebook documents are created from notebook data.

Online Documentation

Properties

Link copied to clipboard
abstract external val cellCount: Int

The number of cells in the notebook.

Link copied to clipboard
abstract external val isClosed: Boolean

true if the notebook has been closed. A closed notebook isn't synchronized anymore and won't be re-used when the same resource is opened again.

Link copied to clipboard
abstract external val isDirty: Boolean

true if there are unpersisted changes.

Link copied to clipboard
abstract external val isUntitled: Boolean

Is this notebook representing an untitled file which has not been saved yet.

Link copied to clipboard
abstract external val metadata: ReadonlyRecord<JsString, *>

Arbitrary metadata for this notebook. Can be anything but must be JSON-stringifyable.

Link copied to clipboard
abstract external val notebookType: String

The type of notebook.

Link copied to clipboard
abstract external val uri: Uri

The associated uri for this notebook.

Link copied to clipboard
abstract external val version: Int

The version number of this notebook (it will strictly increase after each change, including undo/redo).

Functions

Link copied to clipboard
abstract external fun cellAt(index: Int): NotebookCell

Return the cell at the specified index. The index will be adjusted to the notebook.

Link copied to clipboard
abstract external fun getCells(range: NotebookRange = definedExternally): ReadonlyArray<NotebookCell>

Get the cells of this notebook. A subset can be retrieved by providing a range. The range will be adjusted to the notebook.

Link copied to clipboard
abstract external fun save(): PromiseLike<JsBoolean>

Save the document. The saving will be handled by the corresponding serializer.