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
wrap
wrap:
boolean
=false
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
• data.wrap: boolean
= false
• previousVersion: number
• latestVersion: number
Returns
void
transformer()?
optional
transformer: () =>BaseBlockTransformer
<object
>
Returns
BaseBlockTransformer
<object
>
language
language:
string
=FALLBACK_LANG
text
text:
Text
wrap
wrap:
boolean
=false
version
version:
number
Source
packages/blocks/src/code-block/code-model.ts:6