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:72

Properties

job

job: Job

Defined in

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

Accessors

configs

get configs(): Map<string, string>

Returns

Map<string, string>

Defined in

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

Methods

fromBlock()

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

Parameters

model: DraftModel

Returns

Promise<undefined | FromBlockSnapshotResult<AdapterTarget>>

Defined in

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


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:91


fromDoc()

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

Parameters

doc: Doc

Returns

Promise<undefined | FromDocSnapshotResult<AdapterTarget>>

Defined in

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


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:112


fromSlice()

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

Parameters

slice: Slice

Returns

Promise<undefined | FromSliceSnapshotResult<AdapterTarget>>

Defined in

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


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:134


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:140


toBlockSnapshot()

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

Parameters

payload: ToBlockSnapshotPayload<AdapterTarget>

Returns

BlockSnapshot | Promise<BlockSnapshot>

Defined in

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


toDoc()

toDoc(payload): Promise<undefined | Doc>

Parameters

payload: ToDocSnapshotPayload<AdapterTarget>

Returns

Promise<undefined | Doc>

Defined in

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


toDocSnapshot()

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

Parameters

payload: ToDocSnapshotPayload<AdapterTarget>

Returns

DocSnapshot | Promise<DocSnapshot>

Defined in

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


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:177


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:194