The notebook serializer enables the editor to open notebook files.

At its core the editor only knows a {@link NotebookData notebook data structure} but not how that data structure is written to a file, nor how it is read from a file. The notebook serializer bridges this gap by deserializing bytes into notebook data and vice versa.

Fields

serializeNotebook(data:NotebookData, token:CancellationToken):EitherType<Uint8Array, Thenable<Uint8Array>>

Serialize notebook data into file contents.

Parameters:

data

A notebook data structure.

token

A cancellation token.

Returns:

An array of bytes or a thenable that resolves to such.

deserializeNotebook(content:Uint8Array, token:CancellationToken):EitherType<NotebookData, Thenable<NotebookData>>

Deserialize contents of a notebook file into the notebook data structure.

Parameters:

content

Contents of a notebook file.

token

A cancellation token.

Returns:

Notebook data or a thenable that resolves to such.