Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface NotebookDocument

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

层级

  • NotebookDocument

索引

Properties(8)

Readonly uri

uri: Uri

The associated uri for this notebook.

Note that most notebooks use the file-scheme, which means they are files on disk. However, not all notebooks are saved on disk and therefore the scheme must be checked before trying to access the underlying file or siblings on disk.

see

FileSystemProvider

Readonly notebookType

notebookType: string

The type of notebook.

Readonly version

version: number

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

Readonly isDirty

isDirty: boolean

true if there are unpersisted changes.

Readonly isUntitled

isUntitled: boolean

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

Readonly isClosed

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.

Readonly metadata

metadata: {}

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

Type declaration

  • [key: string]: any

Readonly cellCount

cellCount: number

The number of cells in the notebook.

Methods(3)

cellAt

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

    Parameters

    • index: number

      The index of the cell to retrieve.

    Returns NotebookCell

    A cell.

getCells

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

    Parameters

    Returns NotebookCell[]

    The cells contained by the range or all cells.

save

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

    Returns Thenable<boolean>

    A promise that will resolve to true when the document has been saved. Will return false if the file was not dirty or when save failed.

友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场

Generated by TypeDoc. Maintained by 洛竹