BlockSuite API Documentation / @blocksuite/store / BaseAdapter
Class: abstract
BaseAdapter<AdapterTarget>
Extended by
Type parameters
• AdapterTarget = unknown
Constructors
new BaseAdapter()
new BaseAdapter<
AdapterTarget
>(job
):BaseAdapter
<AdapterTarget
>
Parameters
• job: Job
Returns
BaseAdapter
<AdapterTarget
>
Source
packages/framework/store/src/adapter/base.ts:56
Properties
configs
protected
configs:Map
<string
,unknown
>
Source
packages/framework/store/src/adapter/base.ts:52
job
job:
Job
Source
packages/framework/store/src/adapter/base.ts:54
Methods
applyConfigs()
applyConfigs(
configs
):void
Parameters
• configs: Map
<string
, unknown
>
Returns
void
Source
packages/framework/store/src/adapter/base.ts:136
fromBlock()
fromBlock(
mode
):Promise
<FromBlockSnapshotResult
<AdapterTarget
>>
Parameters
• mode: DraftModel
Returns
Promise
<FromBlockSnapshotResult
<AdapterTarget
>>
Source
packages/framework/store/src/adapter/base.ts:99
fromBlockSnapshot()
abstract
fromBlockSnapshot(payload
):FromBlockSnapshotResult
<AdapterTarget
> |Promise
<FromBlockSnapshotResult
<AdapterTarget
>>
Parameters
• payload: FromBlockSnapshotPayload
Returns
FromBlockSnapshotResult
<AdapterTarget
> | Promise
<FromBlockSnapshotResult
<AdapterTarget
>>
Source
packages/framework/store/src/adapter/base.ts:66
fromDoc()
fromDoc(
doc
):Promise
<FromDocSnapshotResult
<AdapterTarget
>>
Parameters
• doc: Doc
Returns
Promise
<FromDocSnapshotResult
<AdapterTarget
>>
Source
packages/framework/store/src/adapter/base.ts:86
fromDocSnapshot()
abstract
fromDocSnapshot(payload
):FromDocSnapshotResult
<AdapterTarget
> |Promise
<FromDocSnapshotResult
<AdapterTarget
>>
Parameters
• payload: FromDocSnapshotPayload
Returns
FromDocSnapshotResult
<AdapterTarget
> | Promise
<FromDocSnapshotResult
<AdapterTarget
>>
Source
packages/framework/store/src/adapter/base.ts:61
fromSlice()
fromSlice(
slice
):Promise
<FromSliceSnapshotResult
<AdapterTarget
>>
Parameters
• slice: Slice
Returns
Promise
<FromSliceSnapshotResult
<AdapterTarget
>>
Source
packages/framework/store/src/adapter/base.ts:117
fromSliceSnapshot()
abstract
fromSliceSnapshot(payload
):FromSliceSnapshotResult
<AdapterTarget
> |Promise
<FromSliceSnapshotResult
<AdapterTarget
>>
Parameters
• payload: FromSliceSnapshotPayload
Returns
FromSliceSnapshotResult
<AdapterTarget
> | Promise
<FromSliceSnapshotResult
<AdapterTarget
>>
Source
packages/framework/store/src/adapter/base.ts:71
toBlock()
toBlock(
payload
,doc
,parent
?,index
?):Promise
<BlockModel
<object
>>
Parameters
• payload: ToBlockSnapshotPayload
<AdapterTarget
>
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<BlockModel
<object
>>
Source
packages/framework/store/src/adapter/base.ts:107
toBlockSnapshot()
abstract
toBlockSnapshot(payload
):BlockSnapshot
|Promise
<BlockSnapshot
>
Parameters
• payload: ToBlockSnapshotPayload
<AdapterTarget
>
Returns
BlockSnapshot
| Promise
<BlockSnapshot
>
Source
packages/framework/store/src/adapter/base.ts:79
toDoc()
toDoc(
payload
):Promise
<Doc
>
Parameters
• payload: ToDocSnapshotPayload
<AdapterTarget
>
Returns
Promise
<Doc
>
Source
packages/framework/store/src/adapter/base.ts:94
toDocSnapshot()
abstract
toDocSnapshot(payload
):DocSnapshot
|Promise
<DocSnapshot
>
Parameters
• payload: ToDocSnapshotPayload
<AdapterTarget
>
Returns
DocSnapshot
| Promise
<DocSnapshot
>
Source
packages/framework/store/src/adapter/base.ts:76
toSlice()
toSlice(
payload
,doc
,parent
?,index
?):Promise
<undefined
|Slice
>
Parameters
• payload: ToSliceSnapshotPayload
<AdapterTarget
>
• doc: Doc
• parent?: string
• index?: number
Returns
Promise
<undefined
| Slice
>
Source
packages/framework/store/src/adapter/base.ts:125
toSliceSnapshot()
abstract
toSliceSnapshot(payload
):null
|SliceSnapshot
|Promise
<null
|SliceSnapshot
>
Parameters
• payload: ToSliceSnapshotPayload
<AdapterTarget
>
Returns
null
| SliceSnapshot
| Promise
<null
| SliceSnapshot
>
Source
packages/framework/store/src/adapter/base.ts:82