Skip to content

BlockSuite API Documentation / @blocksuite/blocks / HtmlTransformer

Variable: HtmlTransformer

const HtmlTransformer: object

Type declaration

exportDoc()

exportDoc: (doc) => Promise<void>

Exports a doc to HTML format.

Parameters

doc

Doc

The doc to be exported.

Returns

Promise<void>

A Promise that resolves when the export is complete.

importHTMLToDoc()

importHTMLToDoc: (options) => Promise<undefined | string>

Imports HTML content into a new doc within a collection.

Parameters

options

ImportHTMLToDocOptions

The import options.

Returns

Promise<undefined | string>

A Promise that resolves to the ID of the newly created doc, or undefined if import fails.

importHTMLZip()

importHTMLZip: (options) => Promise<string[]>

Imports a zip file containing HTML files and assets into a collection.

Parameters

options

ImportHTMLZipOptions

The import options.

Returns

Promise<string[]>

A Promise that resolves to an array of IDs of the newly created docs.

Defined in

packages/blocks/src/_common/transformers/html.ts:165