Skip to content

BlockSuite API Documentation / @blocksuite/blocks / CodeBlockSchema

Variable: CodeBlockSchema

const CodeBlockSchema: Object

Type declaration

model

model: Object & Object

Type declaration

flavour

flavour: "affine:code"

props

props: PropsGetter<Object>

Type declaration
language

language: string = FALLBACK_LANG

text

text: Text

Type declaration

children

children: never[] = []

parent

parent: string[]

role

role: "content" = 'content'

version

version: number = 1

onUpgrade?

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

Parameters

data

data.language: string= FALLBACK_LANG

data.text: Text= undefined

previousVersion: number

latestVersion: number

Returns

void

transformer?

optional transformer: () => BaseBlockTransformer<Object>

Returns

BaseBlockTransformer<Object>

language

language: string = FALLBACK_LANG

text

text: Text

version

version: number

Source

packages/blocks/src/code-block/code-model.ts:6