Skip to content

BlockSuite API Documentation / @blocksuite/blocks / NotionHtmlAdapter

Class: NotionHtmlAdapter

Extends

Constructors

new NotionHtmlAdapter(undefined)

new NotionHtmlAdapter(): NotionHtmlAdapter

Returns

NotionHtmlAdapter

Inherited from

@blocksuite/store.BaseAdapter.constructor

Properties

configs

protected configs: Map<string, unknown>

Inherited from

@blocksuite/store.BaseAdapter.configs

Source

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

Methods

_hastToDelta()

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

Parameters

ast: HtmlAST

option: Object= undefined

option.pageMap?: Map<string, string>

option.trim?: boolean

Returns

DeltaInsert<object>[]

Source

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


_hastToDeltaSpreaded()

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

Parameters

ast: HtmlAST

option: Object= undefined

option.pageMap?: Map<string, string>

option.trim?: boolean

Returns

DeltaInsert<object>[]

Source

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


_htmlToAst()

private _htmlToAst(notionHtml): Root

Parameters

notionHtml: string

Returns

Root

Source

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


_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:224


applyConfigs()

applyConfigs(configs): void

Parameters

configs: Map<string, unknown>

Returns

void

Inherited from

@blocksuite/store.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

@blocksuite/store.BaseAdapter.fromBlockSnapshot

Source

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


fromPageSnapshot()

fromPageSnapshot(_payload): Promise<FromPageSnapshotResult<string>>

Parameters

_payload: FromPageSnapshotPayload

Returns

Promise<FromPageSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromPageSnapshot

Source

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


fromSliceSnapshot()

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

Parameters

_payload: FromSliceSnapshotPayload

Returns

Promise<FromSliceSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromSliceSnapshot

Source

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


toBlockSnapshot()

toBlockSnapshot(payload): Promise<BlockSnapshot>

Parameters

payload: NotionHtmlToPageSnapshotPayload

Returns

Promise<BlockSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toBlockSnapshot

Source

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


toPageSnapshot()

toPageSnapshot(payload): Promise<PageSnapshot>

Parameters

payload: NotionHtmlToPageSnapshotPayload

Returns

Promise<PageSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toPageSnapshot

Source

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


toSliceSnapshot()

toSliceSnapshot(payload): Promise<null | SliceSnapshot>

Parameters

payload: NotionHtmlToSliceSnapshotPayload

Returns

Promise<null | SliceSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toSliceSnapshot

Source

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


Generated using TypeDoc and typedoc-plugin-markdown.