Skip to content

BlockSuite API Documentation / @blocksuite/affine-block-surface / SurfaceBlockTransformer

Class: SurfaceBlockTransformer

Extends

Constructors

new SurfaceBlockTransformer()

new SurfaceBlockTransformer(): SurfaceBlockTransformer

Returns

SurfaceBlockTransformer

Inherited from

BaseBlockTransformer.constructor

Properties

_internal

protected _internal: InternalPrimitives

Inherited from

BaseBlockTransformer._internal

Defined in

packages/framework/store/dist/transformer/base.d.ts:22

Methods

_propsFromSnapshot()

protected _propsFromSnapshot(propsJson): SurfaceBlockProps

Parameters

propsJson

Record<string, unknown>

Returns

SurfaceBlockProps

Inherited from

BaseBlockTransformer._propsFromSnapshot

Defined in

packages/framework/store/dist/transformer/base.d.ts:23


_propsToSnapshot()

protected _propsToSnapshot(model): object

Parameters

model

DraftModel

Returns

object

Inherited from

BaseBlockTransformer._propsToSnapshot

Defined in

packages/framework/store/dist/transformer/base.d.ts:24


elementFromJSON()

elementFromJSON(element): YMap<unknown>

Parameters

element

Record<string, unknown>

Returns

YMap<unknown>

Defined in

packages/affine/block-surface/src/surface-transformer.ts:58


fromSnapshot()

fromSnapshot(payload): Promise<SnapshotNode<SurfaceBlockProps>>

Parameters

payload

FromSnapshotPayload

Returns

Promise<SnapshotNode<SurfaceBlockProps>>

Overrides

BaseBlockTransformer.fromSnapshot

Defined in

packages/affine/block-surface/src/surface-transformer.ts:67


toSnapshot()

toSnapshot(payload): BlockSnapshotLeaf

Parameters

payload

ToSnapshotPayload<SurfaceBlockProps>

Returns

BlockSnapshotLeaf

Overrides

BaseBlockTransformer.toSnapshot

Defined in

packages/affine/block-surface/src/surface-transformer.ts:92