Skip to content

BlockSuite API Documentation / @blocksuite/blocks / HtmlAdapter

Class: HtmlAdapter

Extends

Constructors

new HtmlAdapter(undefined)

new HtmlAdapter(): HtmlAdapter

Returns

HtmlAdapter

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

_astToHtml()

private _astToHtml(ast): string

Parameters

ast: Root

Returns

string

Source

packages/blocks/src/_common/adapters/html.ts:241


_deltaToHast()

private _deltaToHast(deltas): (Text | Element)[]

Parameters

deltas: DeltaInsert[]

Returns

(Text | Element)[]

Source

packages/blocks/src/_common/adapters/html.ts:1108


_deltaToHigglightHasts()

private _deltaToHigglightHasts(deltas, rawLang): Promise<ElementContent[]>

Parameters

deltas: DeltaInsert[]

rawLang: unknown

Returns

Promise<ElementContent[]>

Source

packages/blocks/src/_common/adapters/html.ts:1051


_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/html.ts:1281


_hastToDeltaSpreaded()

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

Parameters

ast: HtmlAST

option: Object= undefined

option.trim?: boolean

Returns

DeltaInsert<object>[]

Source

packages/blocks/src/_common/adapters/html.ts:1170


_htmlToAst()

private _htmlToAst(html): Root

Parameters

html: string

Returns

Root

Source

packages/blocks/src/_common/adapters/html.ts:245


_traverseHtml()

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

Parameters

html: HtmlAST

snapshot: BlockSnapshot

assets?: AssetsManager

Returns

Promise<BlockSnapshot>

Source

packages/blocks/src/_common/adapters/html.ts:675


_traverseSnapshot()

private _traverseSnapshot(snapshot, html, assets?): Promise<Object>

Parameters

snapshot: BlockSnapshot

html: HtmlAST

assets?: AssetsManager

Returns

Promise<Object>

assetsIds

assetsIds: string[]

ast

ast: Root

Source

packages/blocks/src/_common/adapters/html.ts:249


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/html.ts:78


fromPageSnapshot()

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

Parameters

payload: FromPageSnapshotPayload

Returns

Promise<FromPageSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromPageSnapshot

Source

packages/blocks/src/_common/adapters/html.ts:63


fromSliceSnapshot()

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

Parameters

payload: FromSliceSnapshotPayload

Returns

Promise<FromSliceSnapshotResult<string>>

Overrides

@blocksuite/store.BaseAdapter.fromSliceSnapshot

Source

packages/blocks/src/_common/adapters/html.ts:99


toBlockSnapshot()

toBlockSnapshot(payload): Promise<BlockSnapshot>

Parameters

payload: ToBlockSnapshotPayload<string>

Returns

Promise<BlockSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toBlockSnapshot

Source

packages/blocks/src/_common/adapters/html.ts:183


toPageSnapshot()

toPageSnapshot(payload): Promise<PageSnapshot>

Parameters

payload: ToPageSnapshotPayload<string>

Returns

Promise<PageSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toPageSnapshot

Source

packages/blocks/src/_common/adapters/html.ts:123


toSliceSnapshot()

toSliceSnapshot(payload): Promise<null | SliceSnapshot>

Parameters

payload: HtmlToSliceSnapshotPayload

Returns

Promise<null | SliceSnapshot>

Overrides

@blocksuite/store.BaseAdapter.toSliceSnapshot

Source

packages/blocks/src/_common/adapters/html.ts:206


Generated using TypeDoc and typedoc-plugin-markdown.