BlockSuite API Documentation / @blocksuite/blocks / NotionHtmlAdapter
Class: NotionHtmlAdapter
Extends
Constructors
new NotionHtmlAdapter()
new NotionHtmlAdapter(
job
):NotionHtmlAdapter
Parameters
• job: Job
Returns
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:46
Properties
configs
protected
configs:Map
<string
,unknown
>
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:44
job
job:
Job
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:45
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:987
_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:864
_htmlToAst()
private
_htmlToAst(notionHtml
):Root
Parameters
• notionHtml: string
Returns
Root
Source
packages/blocks/src/_common/adapters/notion-html.ts:88
_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:92
applyConfigs()
applyConfigs(
configs
):void
Parameters
• configs: Map
<string
, unknown
>
Returns
void
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:59
fromBlock()
fromBlock(
mode
):Promise
<FromBlockSnapshotResult
<string
>>
Parameters
• mode: DraftModel
Returns
Promise
<FromBlockSnapshotResult
<string
>>
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:55
fromBlockSnapshot()
fromBlockSnapshot(
_payload
):Promise
<FromBlockSnapshotResult
<string
>>
Parameters
• _payload: FromBlockSnapshotPayload
Returns
Promise
<FromBlockSnapshotResult
<string
>>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1017
fromDoc()
fromDoc(
doc
):Promise
<FromDocSnapshotResult
<string
>>
Parameters
• doc: Doc
Returns
Promise
<FromDocSnapshotResult
<string
>>
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:53
fromDocSnapshot()
fromDocSnapshot(
_payload
):Promise
<FromDocSnapshotResult
<string
>>
Parameters
• _payload: FromDocSnapshotPayload
Returns
Promise
<FromDocSnapshotResult
<string
>>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1011
fromSlice()
fromSlice(
slice
):Promise
<FromSliceSnapshotResult
<string
>>
Parameters
• slice: Slice
Returns
Promise
<FromSliceSnapshotResult
<string
>>
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:57
fromSliceSnapshot()
fromSliceSnapshot(
_payload
):Promise
<FromSliceSnapshotResult
<string
>>
Parameters
• _payload: FromSliceSnapshotPayload
Returns
Promise
<FromSliceSnapshotResult
<string
>>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1023
toBlock()
toBlock(
payload
,doc
,parent
?,index
?):Promise
<BlockModel
<object
>>
Parameters
• payload: ToBlockSnapshotPayload
<string
>
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<BlockModel
<object
>>
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:56
toBlockSnapshot()
toBlockSnapshot(
payload
):Promise
<BlockSnapshot
>
Parameters
• payload: NotionHtmlToDocSnapshotPayload
Returns
Promise
<BlockSnapshot
>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1096
toDoc()
toDoc(
payload
):Promise
<Doc
>
Parameters
• payload: NotionHtmlToDocSnapshotPayload
Returns
Promise
<Doc
>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1091
toDocSnapshot()
toDocSnapshot(
payload
):Promise
<DocSnapshot
>
Parameters
• payload: NotionHtmlToDocSnapshotPayload
Returns
Promise
<DocSnapshot
>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1029
toSlice()
toSlice(
payload
,doc
,parent
?,index
?):Promise
<undefined
|Slice
>
Parameters
• payload: ToSliceSnapshotPayload
<string
>
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<undefined
| Slice
>
Inherited from
Source
packages/framework/store/dist/adapter/base.d.ts:58
toSliceSnapshot()
toSliceSnapshot(
payload
):Promise
<null
|SliceSnapshot
>
Parameters
• payload: NotionHtmlToSliceSnapshotPayload
Returns
Promise
<null
| SliceSnapshot
>
Overrides
Source
packages/blocks/src/_common/adapters/notion-html.ts:1121