Skip to content

BlockSuite API Documentation / @blocksuite/blocks / createEmbedBlockSchema

Function: createEmbedBlockSchema()

createEmbedBlockSchema<Props, Model, Transformer>(__namedParameters): object

Type Parameters

Props extends object

Model extends EmbedBlockModel<Props>

Transformer extends BaseBlockTransformer<EmbedProps<Props>> = BaseBlockTransformer<EmbedProps<Props>>

Parameters

__namedParameters

__namedParameters.name: string

__namedParameters.props?

__namedParameters.toModel

__namedParameters.transformer?

__namedParameters.version: number

Returns

object

model

model: object & object

Type declaration

flavour

flavour: `affine:embed-${string}`

props

props: @blocksuite/store

Type declaration

role

role: "content"

version

version: number

onUpgrade()?

optional onUpgrade: (data, previousVersion, latestVersion) => void

Parameters

data: EmbedProps<Props>

previousVersion: number

latestVersion: number

Returns

void

transformer()?

optional transformer: () => Transformer

Returns

Transformer

version

version: number

Defined in

packages/affine/model/dist/utils/helper.d.ts:9