Skip to content

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>

Defined in

packages/framework/store/src/adapter/base.ts:58

Properties

job

job: Job

Defined in

packages/framework/store/src/adapter/base.ts:52

Accessors

configs

get configs(): Map<string, string>

Returns

Map<string, string>

Defined in

packages/framework/store/src/adapter/base.ts:54

Methods

fromBlock()

fromBlock(mode): Promise<undefined | FromBlockSnapshotResult<AdapterTarget>>

Parameters

mode: DraftModel

Returns

Promise<undefined | FromBlockSnapshotResult<AdapterTarget>>

Defined in

packages/framework/store/src/adapter/base.ts:62


fromBlockSnapshot()

abstract fromBlockSnapshot(payload): FromBlockSnapshotResult<AdapterTarget> | Promise<FromBlockSnapshotResult<AdapterTarget>>

Parameters

payload: FromBlockSnapshotPayload

Returns

FromBlockSnapshotResult<AdapterTarget> | Promise<FromBlockSnapshotResult<AdapterTarget>>

Defined in

packages/framework/store/src/adapter/base.ts:77


fromDoc()

fromDoc(doc): Promise<undefined | FromDocSnapshotResult<AdapterTarget>>

Parameters

doc: Doc

Returns

Promise<undefined | FromDocSnapshotResult<AdapterTarget>>

Defined in

packages/framework/store/src/adapter/base.ts:83


fromDocSnapshot()

abstract fromDocSnapshot(payload): FromDocSnapshotResult<AdapterTarget> | Promise<FromDocSnapshotResult<AdapterTarget>>

Parameters

payload: FromDocSnapshotPayload

Returns

FromDocSnapshotResult<AdapterTarget> | Promise<FromDocSnapshotResult<AdapterTarget>>

Defined in

packages/framework/store/src/adapter/base.ts:98


fromSlice()

fromSlice(slice): Promise<undefined | FromSliceSnapshotResult<AdapterTarget>>

Parameters

slice: Slice

Returns

Promise<undefined | FromSliceSnapshotResult<AdapterTarget>>

Defined in

packages/framework/store/src/adapter/base.ts:104


fromSliceSnapshot()

abstract fromSliceSnapshot(payload): FromSliceSnapshotResult<AdapterTarget> | Promise<FromSliceSnapshotResult<AdapterTarget>>

Parameters

payload: FromSliceSnapshotPayload

Returns

FromSliceSnapshotResult<AdapterTarget> | Promise<FromSliceSnapshotResult<AdapterTarget>>

Defined in

packages/framework/store/src/adapter/base.ts:119


toBlock()

toBlock(payload, doc, parent?, index?): Promise<undefined | BlockModel<object, SignaledProps<object>>>

Parameters

payload: ToBlockSnapshotPayload<AdapterTarget>

doc: Doc

parent?: string

index?: number

Returns

Promise<undefined | BlockModel<object, SignaledProps<object>>>

Defined in

packages/framework/store/src/adapter/base.ts:125


toBlockSnapshot()

abstract toBlockSnapshot(payload): BlockSnapshot | Promise<BlockSnapshot>

Parameters

payload: ToBlockSnapshotPayload<AdapterTarget>

Returns

BlockSnapshot | Promise<BlockSnapshot>

Defined in

packages/framework/store/src/adapter/base.ts:142


toDoc()

toDoc(payload): Promise<undefined | Doc>

Parameters

payload: ToDocSnapshotPayload<AdapterTarget>

Returns

Promise<undefined | Doc>

Defined in

packages/framework/store/src/adapter/base.ts:146


toDocSnapshot()

abstract toDocSnapshot(payload): DocSnapshot | Promise<DocSnapshot>

Parameters

payload: ToDocSnapshotPayload<AdapterTarget>

Returns

DocSnapshot | Promise<DocSnapshot>

Defined in

packages/framework/store/src/adapter/base.ts:158


toSlice()

toSlice(payload, doc, parent?, index?): Promise<undefined | Slice>

Parameters

payload: ToSliceSnapshotPayload<AdapterTarget>

doc: Doc

parent?: string

index?: number

Returns

Promise<undefined | Slice>

Defined in

packages/framework/store/src/adapter/base.ts:162


toSliceSnapshot()

abstract toSliceSnapshot(payload): null | SliceSnapshot | Promise<null | SliceSnapshot>

Parameters

payload: ToSliceSnapshotPayload<AdapterTarget>

Returns

null | SliceSnapshot | Promise<null | SliceSnapshot>

Defined in

packages/framework/store/src/adapter/base.ts:179