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

role

role: "root" | "hub" | "content"

Type declaration

children

children: never[] = []

parent

parent: string[]

role

role: "content" = 'content'

version

version: number = 1

onUpgrade?

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

Parameters

data: Object

data.language: string= FALLBACK_LANG

data.text: Text= undefined

previousVersion: number

latestVersion: number

Returns

void

transformer?

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


Generated using TypeDoc and typedoc-plugin-markdown.