Skip to content

BlockSuite API Documentation / @blocksuite/blocks / NotionHtmlAdapter

Class: NotionHtmlAdapter

Extends

Constructors

new NotionHtmlAdapter()

new NotionHtmlAdapter(): NotionHtmlAdapter

Returns

NotionHtmlAdapter

Inherited from

BaseAdapter.constructor

Properties

configs

protected configs: Map<string, unknown>

Inherited from

BaseAdapter.configs

Source

packages/framework/store/dist/adapter/base.d.ts:41

Methods

_hastToDelta()

private _hastToDelta(ast, option): DeltaInsert<object>[]

Parameters

ast: HtmlAST

option= undefined

option.pageMap?: Map<string, string>

option.trim?: boolean

Returns

DeltaInsert<object>[]

Source

packages/blocks/src/_common/adapters/notion-html.ts:1101


_hastToDeltaSpreaded()

private _hastToDeltaSpreaded(ast, option): DeltaInsert<object>[]

Parameters

ast: HtmlAST

option= undefined

option.pageMap?: Map<string, string>

option.trim?: boolean

Returns

DeltaInsert<object>[]

Source

packages/blocks/src/_common/adapters/notion-html.ts:978


_htmlToAst()

private _htmlToAst(notionHtml): Root

Parameters

notionHtml: string

Returns

Root

Source

packages/blocks/src/_common/adapters/notion-html.ts:223


_traverseNotionHtml()

private _traverseNotionHtml(html, snapshot, assets?, pageMap?): Promise<BlockSnapshot>

Parameters

html: HtmlAST

snapshot: BlockSnapshot

assets?: AssetsManager

pageMap?: Map<string, string>

Returns

Promise<BlockSnapshot>

Source

packages/blocks/src/_common/adapters/notion-html.ts:227


applyConfigs()

applyConfigs(configs): void

Parameters

configs: Map<string, unknown>

Returns

void

Inherited from

BaseAdapter.applyConfigs

Source

packages/framework/store/dist/adapter/base.d.ts:48


fromBlockSnapshot()

fromBlockSnapshot(_payload): Promise<FromBlockSnapshotResult<string>>

Parameters

_payload: FromBlockSnapshotPayload

Returns

Promise<FromBlockSnapshotResult<string>>

Overrides

BaseAdapter.fromBlockSnapshot

Source

packages/blocks/src/_common/adapters/notion-html.ts:93


fromDocSnapshot()

fromDocSnapshot(_payload): Promise<FromDocSnapshotResult<string>>

Parameters

_payload: FromDocSnapshotPayload

Returns

Promise<FromDocSnapshotResult<string>>

Overrides

BaseAdapter.fromDocSnapshot

Source

packages/blocks/src/_common/adapters/notion-html.ts:88


fromSliceSnapshot()

fromSliceSnapshot(_payload): Promise<FromSliceSnapshotResult<string>>

Parameters

_payload: FromSliceSnapshotPayload

Returns

Promise<FromSliceSnapshotResult<string>>

Overrides

BaseAdapter.fromSliceSnapshot

Source

packages/blocks/src/_common/adapters/notion-html.ts:98


toBlockSnapshot()

toBlockSnapshot(payload): Promise<BlockSnapshot>

Parameters

payload: NotionHtmlToDocSnapshotPayload

Returns

Promise<BlockSnapshot>

Overrides

BaseAdapter.toBlockSnapshot

Source

packages/blocks/src/_common/adapters/notion-html.ts:164


toDocSnapshot()

toDocSnapshot(payload): Promise<DocSnapshot>

Parameters

payload: NotionHtmlToDocSnapshotPayload

Returns

Promise<DocSnapshot>

Overrides

BaseAdapter.toDocSnapshot

Source

packages/blocks/src/_common/adapters/notion-html.ts:103


toSliceSnapshot()

toSliceSnapshot(payload): Promise<null | SliceSnapshot>

Parameters

payload: NotionHtmlToSliceSnapshotPayload

Returns

Promise<null | SliceSnapshot>

Overrides

BaseAdapter.toSliceSnapshot

Source

packages/blocks/src/_common/adapters/notion-html.ts:188