BlockSuite API Documentation / @blocksuite/affine-model
@blocksuite/affine-model
Enumerations
ColorScheme
Enumeration Members
Dark
Dark:
"dark"
Light
Light:
"light"
ConnectorEndpoint
Enumeration Members
Front
Front:
"Front"
Rear
Rear:
"Rear"
ConnectorLabelOffsetAnchor
Enumeration Members
Bottom
Bottom:
"bottom"
Center
Center:
"center"
Top
Top:
"top"
ConnectorMode
Enumeration Members
Curve
Curve:
2
Orthogonal
Orthogonal:
1
Straight
Straight:
0
FontFamily
Enumeration Members
BebasNeue
BebasNeue:
"blocksuite:surface:BebasNeue"
Inter
Inter:
"blocksuite:surface:Inter"
Kalam
Kalam:
"blocksuite:surface:Kalam"
Lora
Lora:
"blocksuite:surface:Lora"
OrelegaOne
OrelegaOne:
"blocksuite:surface:OrelegaOne"
Poppins
Poppins:
"blocksuite:surface:Poppins"
Satoshi
Satoshi:
"blocksuite:surface:Satoshi"
FontStyle
Enumeration Members
Italic
Italic:
"italic"
Normal
Normal:
"normal"
FontWeight
Enumeration Members
Bold
Bold:
"700"
Light
Light:
"300"
Medium
Medium:
"500"
Regular
Regular:
"400"
SemiBold
SemiBold:
"600"
LayoutType
Enumeration Members
BALANCE
BALANCE:
2
LEFT
LEFT:
1
RIGHT
RIGHT:
0
LineColor
Use DefaultTheme.StrokeColorShortMap instead.
Deprecated
Enumeration Members
Black
Black:
"--affine-palette-line-black"
Blue
Blue:
"--affine-palette-line-blue"
Green
Green:
"--affine-palette-line-green"
Grey
Grey:
"--affine-palette-line-grey"
Magenta
Magenta:
"--affine-palette-line-magenta"
Orange
Orange:
"--affine-palette-line-orange"
Purple
Purple:
"--affine-palette-line-purple"
Red
Red:
"--affine-palette-line-red"
Teal
Teal:
"--affine-palette-line-teal"
White
White:
"--affine-palette-line-white"
Yellow
Yellow:
"--affine-palette-line-yellow"
LineWidth
Enumeration Members
Eight
Eight:
8
Four
Four:
4
Six
Six:
6
Ten
Ten:
10
Twelve
Twelve:
12
Two
Two:
2
MindmapStyle
Enumeration Members
FOUR
FOUR:
4
ONE
ONE:
1
THREE
THREE:
3
TWO
TWO:
2
NoteCorners
Enumeration Members
Huge
Huge:
32
Large
Large:
24
Medium
Medium:
16
None
None:
0
Small
Small:
8
NoteDisplayMode
Enumeration Members
DocAndEdgeless
DocAndEdgeless:
"both"
DocOnly
DocOnly:
"doc"
EdgelessOnly
EdgelessOnly:
"edgeless"
NoteShadow
Enumeration Members
Box
Box:
"--affine-note-shadow-box"
Film
Film:
"--affine-note-shadow-film"
Float
Float:
"--affine-note-shadow-float"
None
None:
""
Paper
Paper:
"--affine-note-shadow-paper"
Sticker
Sticker:
"--affine-note-shadow-sticker"
PointStyle
Enumeration Members
Arrow
Arrow:
"Arrow"
Circle
Circle:
"Circle"
Diamond
Diamond:
"Diamond"
None
None:
"None"
Triangle
Triangle:
"Triangle"
ShapeStyle
Enumeration Members
General
General:
"General"
Scribbled
Scribbled:
"Scribbled"
ShapeTextFontSize
Enumeration Members
LARGE
LARGE:
28
MEDIUM
MEDIUM:
20
SMALL
SMALL:
12
XLARGE
XLARGE:
36
ShapeType
Enumeration Members
Diamond
Diamond:
"diamond"
Ellipse
Ellipse:
"ellipse"
Rect
Rect:
"rect"
Triangle
Triangle:
"triangle"
StrokeStyle
Enumeration Members
Dash
Dash:
"dash"
None
None:
"none"
Solid
Solid:
"solid"
TextAlign
Enumeration Members
Center
Center:
"center"
Left
Left:
"left"
Right
Right:
"right"
TextResizing
Enumeration Members
AUTO_HEIGHT
AUTO_HEIGHT:
1
AUTO_WIDTH_AND_HEIGHT
AUTO_WIDTH_AND_HEIGHT:
0
TextVerticalAlign
Enumeration Members
Bottom
Bottom:
"bottom"
Center
Center:
"center"
Top
Top:
"top"
Classes
AttachmentBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
Implements
Constructors
Properties
Accessors
Methods
AttachmentBlockTransformer
Extends
Constructors
Properties
Methods
fromSnapshot()
fromSnapshot(
payload):Promise<SnapshotNode<AttachmentBlockProps>>
Parameters
payload
Returns
Promise<SnapshotNode<AttachmentBlockProps>>
Overrides
BaseBlockTransformer.fromSnapshot
toSnapshot()
toSnapshot(
snapshot):BlockSnapshotLeaf
Parameters
snapshot
ToSnapshotPayload<AttachmentBlockProps>
Returns
Overrides
BaseBlockTransformer.toSnapshot
BookmarkBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
Implements
Constructors
Properties
Accessors
Methods
BrushElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
Accessors
color
commands
Get Signature
get commands():
string
The SVG path commands for the brush.
Returns
string
connectable
Get Signature
get connectable():
boolean
Returns
boolean
Overrides
GfxPrimitiveElementModel.connectable
lineWidth
points
rotate
Overrides
GfxPrimitiveElementModel.rotate
type
Get Signature
get type():
string
Returns
string
Overrides
xywh
Overrides
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
bounds
Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
getLineIntersections()
getLineIntersections(
start,end):PointLocation[] |null
Parameters
start
IVec
end
IVec
Returns
PointLocation[] | null
Overrides
GfxPrimitiveElementModel.getLineIntersections
getNearestPoint()
getNearestPoint(
point):IVec
Parameters
point
IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
getRelativePointLocation()
getRelativePointLocation(
position):PointLocation
Parameters
position
IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
includesPoint()
includesPoint(
px,py,options?):boolean
Parameters
px
number
py
number
options?
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
CalloutBlockModel
Extends
Constructors
Properties
Accessors
Methods
CodeBlockModel
Extends
BlockModel<CodeBlockProps>
Constructors
Properties
Accessors
Methods
ConnectorElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
forceFullRender
forceFullRender:
boolean=true
Connectors should always render, even during zoom.
updatingPath
updatingPath:
boolean=false
Accessors
absolutePath
connectable
Get Signature
get connectable():
false
Returns
false
Overrides
GfxPrimitiveElementModel.connectable
connected
Get Signature
get connected():
boolean
Returns
boolean
elementBound
Get Signature
get elementBound():
Bound
The bound of the element after rotation. The bound without rotation should be created by Bound.deserialize(this.xywh).
Returns
Bound
The bound of the element without considering the response extension.
Overrides
GfxPrimitiveElementModel.elementBound
frontEndpointStyle
labelConstraints
Defines the size constraints of the label.
labelDisplay
Control display and hide.
labelEditing
Local control display and hide, mainly used in editing scenarios.
labelOffset
The offset property specifies the label along the connector path.
labelStyle
Defines the style of the label.
labelXYWH
Returns a XYWH array providing information about the size of a label and its position relative to the viewport.
mode
path
rearEndpointStyle
rotate
Overrides
GfxPrimitiveElementModel.rotate
rough
roughness
source
stroke
strokeStyle
strokeWidth
target
text
The content of the label.
type
Get Signature
get type():
string
Returns
string
Overrides
xywh
Overrides
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
bounds
Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
getLineIntersections()
getLineIntersections(
start,end):PointLocation[] |null
Parameters
start
IVec
end
IVec
Returns
PointLocation[] | null
Overrides
GfxPrimitiveElementModel.getLineIntersections
getNearestPoint()
getNearestPoint(
point):IVec
Calculate the closest point on the curve via a point.
Parameters
point
IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
getOffsetDistanceByPoint()
getOffsetDistanceByPoint(
point,bounds?):number
Calculating the computed distance along a path via a point.
The point is relative to the viewport.
Parameters
point
IVec
bounds?
Bound
Returns
number
getPointByOffsetDistance()
getPointByOffsetDistance(
offsetDistance,bounds?):IVec
Calculating the computed point along a path via a offset distance.
Returns a point relative to the viewport.
Parameters
offsetDistance
number = 0.5
bounds?
Bound
Returns
IVec
getRelativePointLocation()
getRelativePointLocation(
point):PointLocation
Parameters
point
IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
hasLabel()
hasLabel():
boolean
Returns
boolean
includesPoint()
includesPoint(
x,y,options?):boolean
Parameters
x
number
y
number
options?
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
labelIncludesPoint()
labelIncludesPoint(
point):boolean
Parameters
point
IVec
Returns
boolean
moveTo()
moveTo(
bound):void
Parameters
bound
Bound
Returns
void
resize()
resize(
originalPath,matrix):object
Parameters
originalPath
PointLocation[]
matrix
DOMMatrix
Returns
object
source?
optionalsource:Connection
target?
optionaltarget:Connection
resizePath()
resizePath(
originalPath,matrix):PointLocation[]
Parameters
originalPath
PointLocation[]
matrix
DOMMatrix
Returns
PointLocation[]
serialize()
serialize():
SerializedConnectorElement
Returns
Overrides
GfxPrimitiveElementModel.serialize
propsToY()
staticpropsToY(props):ConnectorElementProps
Parameters
props
Returns
DatabaseBlockModel
Extends
Constructors
Properties
Accessors
Methods
DividerBlockModel
Extends
BlockModel<Props>
Constructors
Properties
Accessors
Methods
EdgelessTextBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
GfxBlockElementModel<EdgelessTextProps,this>
Implements
Constructors
Properties
Accessors
color
Get Signature
get color():
string| {normal:string; } | {dark:string;light:string; }
Returns
string | { normal: string; } | { dark: string; light: string; }
Set Signature
set color(
color):void
Parameters
color
string | { normal: string; } | { dark: string; light: string; }
Returns
void
Methods
EmbedFigmaModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
Methods
EmbedGithubModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
Methods
EmbedHtmlModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
Methods
EmbedIframeBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
Implements
Constructors
Properties
Accessors
Methods
EmbedLinkedDocModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
Methods
EmbedLoomModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
Methods
EmbedSyncedDocModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
isFolded
Get Signature
get isFolded():
boolean
Returns
boolean
Methods
EmbedYoutubeModel
The graphic block model that can be rendered in the graphics mode. All the graphic block model should extend this class. You can use GfxCompatibleBlockModel to convert a BlockModel to a subclass that extends it.
Extends
Constructors
Properties
Accessors
Methods
FrameBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
Implements
Constructors
Properties
[gfxGroupCompatibleSymbol]
[gfxGroupCompatibleSymbol]:
true
Implementation of
GfxGroupCompatibleInterface.[gfxGroupCompatibleSymbol]
Accessors
childElements
Get Signature
get childElements():
GfxModel[]
All child element models of this container. Note that the childElements may not contains all the children in childIds, because some children may not be loaded.
Returns
GfxModel[]
All child element models of this container. Note that the childElements may not contains all the children in childIds, because some children may not be loaded.
Implementation of
GfxGroupCompatibleInterface.childElements
childIds
Get Signature
get childIds():
string[]
All child ids of this container.
Returns
string[]
All child ids of this container.
Implementation of
GfxGroupCompatibleInterface.childIds
descendantElements
Get Signature
get descendantElements():
GfxModel[]
Returns
GfxModel[]
Implementation of
GfxGroupCompatibleInterface.descendantElements
Methods
addChild()
addChild(
element):void
Parameters
element
Returns
void
Implementation of
GfxGroupCompatibleInterface.addChild
addChildren()
addChildren(
elements):void
Parameters
elements
GfxModel[]
Returns
void
containsBound()
containsBound(
bound):boolean
Parameters
bound
Bound
Returns
boolean
Implementation of
GfxElementGeometry.containsBound
Overrides
GfxBlockElementModel.containsBound
hasChild()
hasChild(
element):boolean
Parameters
element
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.hasChild
hasDescendant()
hasDescendant(
element):boolean
Parameters
element
Returns
boolean
Implementation of
GfxGroupCompatibleInterface.hasDescendant
includesPoint()
includesPoint(
x,y,_):boolean
Parameters
x
number
y
number
_
Returns
boolean
Implementation of
GfxElementGeometry.includesPoint
Overrides
GfxBlockElementModel.includesPoint
intersectsBound()
intersectsBound(
selectedBound):boolean
Parameters
selectedBound
Bound
Returns
boolean
Implementation of
GfxElementGeometry.intersectsBound
Overrides
GfxBlockElementModel.intersectsBound
removeChild()
removeChild(
element):void
Parameters
element
Returns
void
Implementation of
GfxGroupCompatibleInterface.removeChild
removeChildren()
removeChildren(
elements):void
Parameters
elements
GfxModel[]
Returns
void
GroupElementModel
GfxGroupCompatibleElement is a model that can contain other models. It just like a group that in common graphic software.
Extends
GfxGroupLikeElementModel<GroupElementProps>
Constructors
Properties
Accessors
children
Overrides
GfxGroupLikeElementModel.children
rotate
Get Signature
get rotate():
number
Returns
number
Set Signature
set rotate(
_):void
Parameters
_
number
Returns
void
Overrides
GfxGroupLikeElementModel.rotate
showTitle
title
type
Get Signature
get type():
string
Returns
string
Overrides
GfxGroupLikeElementModel.type
Methods
addChild()
addChild(
element):void
Parameters
element
Returns
void
Overrides
GfxGroupLikeElementModel.addChild
addChildren()
addChildren(
elements):void
Parameters
elements
GfxModel[]
Returns
void
containsBound()
containsBound(
bound):boolean
Parameters
bound
Bound
Returns
boolean
Overrides
GfxGroupLikeElementModel.containsBound
getLineIntersections()
getLineIntersections(
start,end):PointLocation[] |null
Parameters
start
IVec
end
IVec
Returns
PointLocation[] | null
Overrides
GfxGroupLikeElementModel.getLineIntersections
lock()
lock():
void
Returns
void
Overrides
GfxGroupLikeElementModel.lock
removeChild()
removeChild(
element):void
Remove the child from the group
Parameters
element
Returns
void
Overrides
GfxGroupLikeElementModel.removeChild
removeChildren()
removeChildren(
elements):void
Parameters
elements
GfxModel[]
Returns
void
serialize()
serialize():
SerializedGroupElement
Returns
Overrides
GfxGroupLikeElementModel.serialize
unlock()
unlock():
void
Returns
void
Overrides
GfxGroupLikeElementModel.unlock
propsToY()
staticpropsToY(props):GroupElementProps
Parameters
props
Record<string, unknown>
Returns
GroupElementProps
HighlighterElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
Accessors
color
commands
Get Signature
get commands():
string
The SVG path commands for the brush.
Returns
string
connectable
Get Signature
get connectable():
boolean
Returns
boolean
Overrides
GfxPrimitiveElementModel.connectable
lineWidth
points
rotate
Overrides
GfxPrimitiveElementModel.rotate
type
Get Signature
get type():
string
Returns
string
Overrides
xywh
Overrides
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
bounds
Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
getLineIntersections()
getLineIntersections(
start,end):PointLocation[] |null
Parameters
start
IVec
end
IVec
Returns
PointLocation[] | null
Overrides
GfxPrimitiveElementModel.getLineIntersections
getNearestPoint()
getNearestPoint(
point):IVec
Parameters
point
IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
getRelativePointLocation()
getRelativePointLocation(
position):PointLocation
Parameters
position
IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
includesPoint()
includesPoint(
px,py,options?):boolean
Parameters
px
number
py
number
options?
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
ImageBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
Implements
Constructors
Properties
Accessors
Methods
ImageBlockTransformer
Extends
Constructors
Properties
Methods
fromSnapshot()
fromSnapshot(
payload):Promise<SnapshotNode<ImageBlockProps>>
Parameters
payload
Returns
Promise<SnapshotNode<ImageBlockProps>>
Overrides
BaseBlockTransformer.fromSnapshot
toSnapshot()
toSnapshot(
snapshot):BlockSnapshotLeaf
Parameters
snapshot
ToSnapshotPayload<ImageBlockProps>
Returns
Overrides
BaseBlockTransformer.toSnapshot
LatexBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
GfxBlockElementModel<LatexProps,this>
Implements
Constructors
Properties
Accessors
Methods
ListBlockModel
Extends
Constructors
Properties
Accessors
Methods
LocalConnectorElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
absolutePath
absolutePath:
PointLocation[] =[]
frontEndpointStyle
frontEndpointStyle:
PointStyle
mode
mode:
ConnectorMode=ConnectorMode.Orthogonal
rearEndpointStyle
rearEndpointStyle:
PointStyle
rough?
optionalrough:boolean
roughness
roughness:
number=DEFAULT_ROUGHNESS
source
source:
Connection
stroke
stroke:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.connectorColor
strokeStyle
strokeStyle:
StrokeStyle=StrokeStyle.Solid
strokeWidth
strokeWidth:
number=4
target
target:
Connection
updatingPath
updatingPath:
boolean=false
Accessors
path
Get Signature
get path():
PointLocation[]
Returns
PointLocation[]
Set Signature
set path(
value):void
Parameters
value
PointLocation[]
Returns
void
type
Get Signature
get type():
string
Returns
string
Overrides
Methods
LocalShapeElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
roughness
roughness:
number=DEFAULT_ROUGHNESS
textBound
textBound:
Bound|null=null
textDisplay
textDisplay:
boolean=true
Accessors
color
fillColor
filled
fontFamily
fontSize
fontStyle
fontWeight
padding
radius
shadow
shapeStyle
shapeType
strokeColor
strokeStyle
strokeWidth
text
textAlign
textVerticalAlign
type
Get Signature
get type():
string
Returns
string
Overrides
Methods
MindmapElementModel
GfxGroupCompatibleElement is a model that can contain other models. It just like a group that in common graphic software.
Extends
GfxGroupLikeElementModel<MindmapElementProps>
Constructors
Properties
connectors
connectors:
Map<string,LocalConnectorElementModel>
Accessors
children
Overrides
GfxGroupLikeElementModel.children
layoutType
nodeMap
Get Signature
get nodeMap():
Map<string,MindmapNode>
Returns
Map<string, MindmapNode>
rotate
Get Signature
get rotate():
number
Returns
number
Set Signature
set rotate(
_):void
Parameters
_
number
Returns
void
Overrides
GfxGroupLikeElementModel.rotate
style
styleGetter
Get Signature
get styleGetter():
MindmapStyleGetter
Returns
tree
Get Signature
get tree():
MindmapRoot
Returns
type
Get Signature
get type():
string
Returns
string
Overrides
GfxGroupLikeElementModel.type
Methods
_getXYWH()
protected_getXYWH():Bound
Returns
Bound
Overrides
GfxGroupLikeElementModel._getXYWH
addChild()
addChild(
_element):void
Parameters
_element
Returns
void
Deprecated
you should not call this method directly
Overrides
GfxGroupLikeElementModel.addChild
addNode()
addNode(
parent,sibling?,position?,props?):string
Parameters
parent
The parent node id of the new node. If it's null, the node will be the root node
string | MindmapNode | null
sibling?
string | number
position?
"before" | "after"
props?
Record<string, unknown> = {}
Returns
string
buildTree()
buildTree():
void
Returns
void
getChildNodes()
getChildNodes(
id,subtree?):MindmapNode[]
Parameters
id
string
subtree?
The subtree of root, this only take effects when the layout type is BALANCED.
"left" | "right"
Returns
getConnectors()
getConnectors(
node):object[] |null
Get all the connectors start from the given node
Parameters
node
Returns
object[] | null
getLayoutDir()
getLayoutDir(
node):LayoutType
Parameters
node
string | MindmapNode
Returns
getNode()
getNode(
id):MindmapNode|null
Parameters
id
string
Returns
MindmapNode | null
getNodeByPath()
getNodeByPath(
path):MindmapNode|null
Parameters
path
number[]
Returns
MindmapNode | null
getParentNode()
getParentNode(
id):MindmapNode|null
Parameters
id
string
Returns
MindmapNode | null
getPath()
getPath(
element):number[]
Path is an array of indexes that represent the path from the root node to the target node. The first element of the array is always 0, which represents the root node.
Parameters
element
string | MindmapNode
Returns
number[]
Example
const path = mindmap.getPath('nodeId');
// [0, 1, 2]getSiblingNode()
getSiblingNode(
id,direction,subtree?):MindmapNode|null
Parameters
id
string
direction
"prev" | "next"
subtree?
The subtree of which that the sibling node belongs to, this is used when the layout type is BALANCED.
"left" | "right"
Returns
MindmapNode | null
includesPoint()
includesPoint(
x,y,options):boolean
Parameters
x
number
y
number
options
Returns
boolean
Overrides
GfxGroupLikeElementModel.includesPoint
layout()
layout(
_tree,_options):void
Parameters
_tree
_options
applyStyle?
boolean
calculateTreeBound?
boolean
layoutType?
stashed?
boolean
Returns
void
moveTo()
moveTo(
targetXYWH):void
Parameters
targetXYWH
`[${number},${number},${number},${number}]` | XYWH
Returns
void
onCreated()
onCreated():
void
Returns
void
Overrides
GfxGroupLikeElementModel.onCreated
removeChild()
removeChild(
element):void
Remove the child from the group
Parameters
element
Returns
void
Overrides
GfxGroupLikeElementModel.removeChild
requestBuildTree()
protectedrequestBuildTree():void
Returns
void
requestLayout()
requestLayout():
void
Returns
void
serialize()
serialize():
SerializedMindmapElement
Returns
Overrides
GfxGroupLikeElementModel.serialize
setLayoutMethod()
setLayoutMethod(
layoutMethod):void
Parameters
layoutMethod
(_tree, _options) => void
Returns
void
stashTree()
stashTree(
node): () =>void|undefined
Stash mind map node and its children's xywh property
Parameters
node
string | MindmapNode
Returns
() => void | undefined
a function that write back the stashed xywh into yjs
toggleCollapse()
toggleCollapse(
node,options):void
Parameters
node
options
layout?
boolean
Returns
void
traverse()
traverse(
callback,root,options):void
Parameters
callback
(node, parent) => void
root
MindmapNode = ...
options
stopOnCollapse?
boolean
Returns
void
propsToY()
staticpropsToY(props):MindmapElementProps
Parameters
props
Record<string, unknown>
Returns
MindmapElementProps
abstract MindmapStyleGetter
Extended by
Constructors
Constructor
new MindmapStyleGetter():
MindmapStyleGetter
Returns
Properties
root
abstractreadonlyroot:NodeStyle
Methods
getNodeStyle()
abstractgetNodeStyle(node,path):object
Parameters
node
path
number[]
Returns
object
collapseButton
collapseButton:
CollapseButton
connector
connector:
ConnectorStyle
expandButton
expandButton:
ExpandButton
node
node:
NodeStyle
NoteBlockModel
The methods that a graphic element should implement. It is already included in the GfxCompatibleInterface interface.
Extends
GfxBlockElementModel<NoteProps,this>
Implements
Constructors
Properties
Accessors
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
bounds
Bound
Returns
boolean
Implementation of
GfxElementGeometry.containsBound
Overrides
GfxBlockElementModel.containsBound
includesPoint()
includesPoint(
x,y):boolean
Parameters
x
number
y
number
Returns
boolean
Implementation of
GfxElementGeometry.includesPoint
Overrides
GfxBlockElementModel.includesPoint
intersectsBound()
intersectsBound(
bound):boolean
Parameters
bound
Bound
Returns
boolean
Implementation of
GfxElementGeometry.intersectsBound
Overrides
GfxBlockElementModel.intersectsBound
isEmpty()
isEmpty():
boolean
Returns
boolean
Overrides
GfxCompatible<NoteProps>(BlockModel).isEmpty
isPageBlock()
isPageBlock():
boolean
We define a note block as a page block if it is the first visible note
Returns
boolean
ParagraphBlockModel
Extends
Constructors
Properties
Accessors
Methods
isEmpty()
isEmpty():
boolean
Returns
boolean
Overrides
RootBlockModel
Extends
Constructors
Constructor
new RootBlockModel():
RootBlockModel
Returns
Overrides
Properties
Accessors
Methods
isEmpty()
isEmpty():
boolean
A page is empty if it only contains one empty note and the canvas is empty
Returns
boolean
Overrides
ShapeElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
textBound
textBound:
IBound|null=null
The bound of the text content.
Accessors
color
fillColor
filled
fontFamily
fontSize
fontStyle
fontWeight
maxWidth
padding
radius
rotate
Overrides
GfxPrimitiveElementModel.rotate
roughness
shadow
shapeStyle
shapeType
strokeColor
strokeStyle
strokeWidth
text
textAlign
textDisplay
textHorizontalAlign
textResizing
textVerticalAlign
type
Get Signature
get type():
string
Returns
string
Overrides
xywh
Overrides
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
bounds
Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
getLineIntersections()
getLineIntersections(
start,end):PointLocation[] |null
Parameters
start
IVec
end
IVec
Returns
PointLocation[] | null
Overrides
GfxPrimitiveElementModel.getLineIntersections
getNearestPoint()
getNearestPoint(
point):IVec
Parameters
point
IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
getRelativePointLocation()
getRelativePointLocation(
point):PointLocation
Parameters
point
IVec
Returns
PointLocation
Overrides
GfxPrimitiveElementModel.getRelativePointLocation
includesPoint()
includesPoint(
x,y,options):boolean
Parameters
x
number
y
number
options
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
propsToY()
staticpropsToY(props):ShapeProps
Parameters
props
Returns
StyleFour
Extends
Constructors
Properties
root
readonlyroot:object
color
color:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
fillColor
fillColor:
string='transparent'
filled
filled:
boolean=true
fontFamily
fontFamily:
FontFamily=FontFamily.Kalam
fontSize
fontSize:
number=22
fontWeight
fontWeight:
FontWeight=FontWeight.Bold
maxWidth
maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
padding
padding: [
number,number]
radius
radius:
number=0
strokeColor
strokeColor:
string='transparent'
strokeWidth
strokeWidth:
number=0
textResizing
textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
Methods
getNodeStyle()
getNodeStyle(
_,path):object
Parameters
_
path
number[]
Returns
object
collapseButton
collapseButton:
object
collapseButton.fillColor
collapseButton.fillColor:
string=DefaultTheme.pureWhite
collapseButton.filled
collapseButton.filled:
boolean=true
collapseButton.height
collapseButton.height:
number=16
collapseButton.radius
collapseButton.radius:
number=0.5
collapseButton.strokeColor
collapseButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =stroke
collapseButton.strokeWidth
collapseButton.strokeWidth:
number=3
collapseButton.width
collapseButton.width:
number=16
connector
connector:
object
connector.mode
connector.mode:
ConnectorMode=ConnectorMode.Curve
connector.stroke
connector.stroke:
string| {normal:string; } | {dark:string;light:string; }
connector.strokeStyle
connector.strokeStyle:
StrokeStyle=StrokeStyle.Solid
connector.strokeWidth
connector.strokeWidth:
number=3
expandButton
expandButton:
object
expandButton.color
expandButton.color:
string=DefaultTheme.pureWhite
expandButton.fillColor
expandButton.fillColor:
string| {normal:string; } | {dark:string;light:string; } =stroke
expandButton.filled
expandButton.filled:
boolean=true
expandButton.fontFamily
expandButton.fontFamily:
FontFamily=FontFamily.Inter
expandButton.fontSize
expandButton.fontSize:
number=15
expandButton.fontWeight
expandButton.fontWeight:
FontWeight=FontWeight.Bold
expandButton.height
expandButton.height:
number=24
expandButton.padding
expandButton.padding:
number[]
expandButton.radius
expandButton.radius:
number=8
expandButton.strokeColor
expandButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =stroke
expandButton.strokeWidth
expandButton.strokeWidth:
number=0
expandButton.width
expandButton.width:
number=24
node
node:
object
node.color
node.color:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
node.fillColor
node.fillColor:
string='transparent'
node.filled
node.filled:
boolean=true
node.fontFamily
node.fontFamily:
FontFamily=FontFamily.Kalam
node.fontSize
node.fontSize:
number=18
node.fontWeight
node.fontWeight:
FontWeight=FontWeight.Bold
node.maxWidth
node.maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
node.padding
node.padding: [
number,number]
node.radius
node.radius:
number=0
node.strokeColor
node.strokeColor:
string='transparent'
node.strokeWidth
node.strokeWidth:
number=0
node.textResizing
node.textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
MindmapStyleGetter.getNodeStyle
StyleOne
Extends
Constructors
Properties
root
readonlyroot:object
color
color:
string=DefaultTheme.pureBlack
fillColor
fillColor:
string=DefaultTheme.pureWhite
filled
filled:
boolean=true
fontFamily
fontFamily:
FontFamily=FontFamily.Poppins
fontSize
fontSize:
number=20
fontWeight
fontWeight:
FontWeight=FontWeight.SemiBold
maxWidth
maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
padding
padding: [
number,number]
radius
radius:
number=8
shadow
shadow:
object
shadow.blur
shadow.blur:
number=12
shadow.color
shadow.color:
string='rgba(0, 0, 0, 0.14)'
shadow.offsetX
shadow.offsetX:
number=0
shadow.offsetY
shadow.offsetY:
number=6
strokeColor
strokeColor:
string='#53b2ef'
strokeWidth
strokeWidth:
number=4
textResizing
textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
Methods
getNodeStyle()
getNodeStyle(
_,path):object
Parameters
_
path
number[]
Returns
object
collapseButton
collapseButton:
object
collapseButton.fillColor
collapseButton.fillColor:
string=DefaultTheme.pureWhite
collapseButton.filled
collapseButton.filled:
boolean=true
collapseButton.height
collapseButton.height:
number=16
collapseButton.radius
collapseButton.radius:
number=0.5
collapseButton.strokeColor
collapseButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =color
collapseButton.strokeWidth
collapseButton.strokeWidth:
number=3
collapseButton.width
collapseButton.width:
number=16
connector
connector:
object
connector.mode
connector.mode:
ConnectorMode=ConnectorMode.Curve
connector.stroke
connector.stroke:
string| {normal:string; } | {dark:string;light:string; } =color
connector.strokeStyle
connector.strokeStyle:
StrokeStyle=StrokeStyle.Solid
connector.strokeWidth
connector.strokeWidth:
number=3
expandButton
expandButton:
object
expandButton.color
expandButton.color:
string=DefaultTheme.pureWhite
expandButton.fillColor
expandButton.fillColor:
string| {normal:string; } | {dark:string;light:string; } =color
expandButton.filled
expandButton.filled:
boolean=true
expandButton.fontFamily
expandButton.fontFamily:
FontFamily=FontFamily.Inter
expandButton.fontSize
expandButton.fontSize:
number=15
expandButton.fontWeight
expandButton.fontWeight:
FontWeight=FontWeight.Bold
expandButton.height
expandButton.height:
number=24
expandButton.padding
expandButton.padding:
number[]
expandButton.radius
expandButton.radius:
number=8
expandButton.strokeColor
expandButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =color
expandButton.strokeWidth
expandButton.strokeWidth:
number=0
expandButton.width
expandButton.width:
number=24
node
node:
object
node.color
node.color:
string=DefaultTheme.pureBlack
node.fillColor
node.fillColor:
string=DefaultTheme.pureWhite
node.filled
node.filled:
boolean=true
node.fontFamily
node.fontFamily:
FontFamily=FontFamily.Poppins
node.fontSize
node.fontSize:
number=16
node.fontWeight
node.fontWeight:
FontWeight=FontWeight.Medium
node.maxWidth
node.maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
node.padding
node.padding: [
number,number]
node.radius
node.radius:
number=8
node.shadow
node.shadow:
object
node.shadow.blur
node.shadow.blur:
number=12
node.shadow.color
node.shadow.color:
string='rgba(0, 0, 0, 0.14)'
node.shadow.offsetX
node.shadow.offsetX:
number=0
node.shadow.offsetY
node.shadow.offsetY:
number=6
node.strokeColor
node.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =color
node.strokeWidth
node.strokeWidth:
number=3
node.textResizing
node.textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
MindmapStyleGetter.getNodeStyle
StyleThree
Extends
Constructors
Properties
root
readonlyroot:object
color
color:
string=DefaultTheme.pureBlack
fillColor
fillColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.StrokeColorShortMap.Yellow
filled
filled:
boolean=true
fontFamily
fontFamily:
FontFamily=FontFamily.Poppins
fontSize
fontSize:
number=16
fontWeight
fontWeight:
FontWeight=FontWeight.Medium
maxWidth
maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
padding
padding: [
number,number]
radius
radius:
number=10
shadow
shadow:
object
shadow.blur
shadow.blur:
number=12
shadow.color
shadow.color:
string='rgba(66, 65, 73, 0.18)'
shadow.offsetX
shadow.offsetX:
number=0
shadow.offsetY
shadow.offsetY:
number=0
strokeColor
strokeColor:
string='transparent'
strokeWidth
strokeWidth:
number=0
textResizing
textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
Methods
getNodeStyle()
getNodeStyle(
_,path):object
Parameters
_
path
number[]
Returns
object
collapseButton
collapseButton:
object
collapseButton.fillColor
collapseButton.fillColor:
string=DefaultTheme.pureWhite
collapseButton.filled
collapseButton.filled:
boolean=true
collapseButton.height
collapseButton.height:
number=16
collapseButton.radius
collapseButton.radius:
number=0.5
collapseButton.strokeColor
collapseButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =dotColor
collapseButton.strokeWidth
collapseButton.strokeWidth:
number=3
collapseButton.width
collapseButton.width:
number=16
connector
connector:
object
connector.mode
connector.mode:
ConnectorMode=ConnectorMode.Curve
connector.stroke
connector.stroke:
string| {normal:string; } | {dark:string;light:string; } =strokeColor
connector.strokeStyle
connector.strokeStyle:
StrokeStyle=StrokeStyle.Solid
connector.strokeWidth
connector.strokeWidth:
number=2
expandButton
expandButton:
object
expandButton.color
expandButton.color:
string=DefaultTheme.pureWhite
expandButton.fillColor
expandButton.fillColor:
string| {normal:string; } | {dark:string;light:string; } =dotColor
expandButton.filled
expandButton.filled:
boolean=true
expandButton.fontFamily
expandButton.fontFamily:
FontFamily=FontFamily.Inter
expandButton.fontSize
expandButton.fontSize:
number=15
expandButton.fontWeight
expandButton.fontWeight:
FontWeight=FontWeight.Bold
expandButton.height
expandButton.height:
number=24
expandButton.padding
expandButton.padding:
number[]
expandButton.radius
expandButton.radius:
number=8
expandButton.strokeColor
expandButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =dotColor
expandButton.strokeWidth
expandButton.strokeWidth:
number=0
expandButton.width
expandButton.width:
number=24
node
node:
object
node.color
node.color:
string=DefaultTheme.pureBlack
node.fillColor
node.fillColor:
string=DefaultTheme.pureWhite
node.filled
node.filled:
boolean=true
node.fontFamily
node.fontFamily:
FontFamily=FontFamily.Poppins
node.fontSize
node.fontSize:
number=16
node.fontWeight
node.fontWeight:
FontWeight=FontWeight.Medium
node.maxWidth
node.maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
node.padding
node.padding: [
number,number]
node.radius
node.radius:
number=10
node.shadow
node.shadow:
object
node.shadow.blur
node.shadow.blur:
number=12
node.shadow.color
node.shadow.color:
string='rgba(66, 65, 73, 0.18)'
node.shadow.offsetX
node.shadow.offsetX:
number=0
node.shadow.offsetY
node.shadow.offsetY:
number=0
node.strokeColor
node.strokeColor:
string| {normal:string; } | {dark:string;light:string; }
node.strokeWidth
node.strokeWidth:
number=2
node.textResizing
node.textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
MindmapStyleGetter.getNodeStyle
StyleTwo
Extends
Constructors
Properties
root
readonlyroot:object
color
color:
string=DefaultTheme.pureBlack
fillColor
fillColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.StrokeColorShortMap.Yellow
filled
filled:
boolean=true
fontFamily
fontFamily:
FontFamily=FontFamily.Poppins
fontSize
fontSize:
number=18
fontWeight
fontWeight:
FontWeight=FontWeight.SemiBold
maxWidth
maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
padding
padding: [
number,number]
radius
radius:
number=3
shadow
shadow:
object
shadow.blur
shadow.blur:
number=0
shadow.color
shadow.color:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
shadow.offsetX
shadow.offsetX:
number=3
shadow.offsetY
shadow.offsetY:
number=3
strokeColor
strokeColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
strokeWidth
strokeWidth:
number=3
textResizing
textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
Methods
getNodeStyle()
getNodeStyle(
_,path):object
Parameters
_
path
number[]
Returns
object
collapseButton
collapseButton:
object
collapseButton.fillColor
collapseButton.fillColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.white
collapseButton.filled
collapseButton.filled:
boolean=true
collapseButton.height
collapseButton.height:
number=16
collapseButton.radius
collapseButton.radius:
number=0.5
collapseButton.strokeColor
collapseButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
collapseButton.strokeWidth
collapseButton.strokeWidth:
number=3
collapseButton.width
collapseButton.width:
number=16
connector
connector:
object
connector.mode
connector.mode:
ConnectorMode=ConnectorMode.Orthogonal
connector.stroke
connector.stroke:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
connector.strokeStyle
connector.strokeStyle:
StrokeStyle=StrokeStyle.Solid
connector.strokeWidth
connector.strokeWidth:
number=3
expandButton
expandButton:
object
expandButton.color
expandButton.color:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.white
expandButton.fillColor
expandButton.fillColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
expandButton.filled
expandButton.filled:
boolean=true
expandButton.fontFamily
expandButton.fontFamily:
FontFamily=FontFamily.Inter
expandButton.fontSize
expandButton.fontSize:
number=15
expandButton.fontWeight
expandButton.fontWeight:
FontWeight=FontWeight.Bold
expandButton.height
expandButton.height:
number=24
expandButton.padding
expandButton.padding:
number[]
expandButton.radius
expandButton.radius:
number=2
expandButton.strokeColor
expandButton.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
expandButton.strokeWidth
expandButton.strokeWidth:
number=0
expandButton.width
expandButton.width:
number=24
node
node:
object
node.color
node.color:
string=DefaultTheme.pureBlack
node.fillColor
node.fillColor:
string| {normal:string; } | {dark:string;light:string; } =color
node.filled
node.filled:
boolean=true
node.fontFamily
node.fontFamily:
FontFamily=FontFamily.Poppins
node.fontSize
node.fontSize:
number=16
node.fontWeight
node.fontWeight:
FontWeight=FontWeight.SemiBold
node.maxWidth
node.maxWidth:
number=MINDMAP_NODE_MAX_WIDTH
node.padding
node.padding: [
number,number]
node.radius
node.radius:
number=3
node.shadow
node.shadow:
object
node.shadow.blur
node.shadow.blur:
number=0
node.shadow.color
node.shadow.color:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
node.shadow.offsetX
node.shadow.offsetX:
number=3
node.shadow.offsetY
node.shadow.offsetY:
number=3
node.strokeColor
node.strokeColor:
string| {normal:string; } | {dark:string;light:string; } =DefaultTheme.black
node.strokeWidth
node.strokeWidth:
number=3
node.textResizing
node.textResizing:
TextResizing=TextResizing.AUTO_WIDTH_AND_HEIGHT
Overrides
MindmapStyleGetter.getNodeStyle
SurfaceRefBlockModel
Extends
Constructors
Properties
Accessors
Methods
TableBlockModel
Extends
Constructors
Properties
Accessors
Methods
TextElementModel
All the model that can be rendered in graphics mode should implement this interface.
Extends
Constructors
Properties
Accessors
color
fontFamily
fontSize
fontStyle
fontWeight
hasMaxWidth
rotate
Overrides
GfxPrimitiveElementModel.rotate
text
textAlign
type
Get Signature
get type():
string
Returns
string
Overrides
xywh
Overrides
Methods
containsBound()
containsBound(
bounds):boolean
Parameters
bounds
Bound
Returns
boolean
Overrides
GfxPrimitiveElementModel.containsBound
getLineIntersections()
getLineIntersections(
start,end):PointLocation[] |null
Parameters
start
IVec
end
IVec
Returns
PointLocation[] | null
Overrides
GfxPrimitiveElementModel.getLineIntersections
getNearestPoint()
getNearestPoint(
point):IVec
Parameters
point
IVec
Returns
IVec
Overrides
GfxPrimitiveElementModel.getNearestPoint
includesPoint()
includesPoint(
x,y):boolean
Parameters
x
number
y
number
Returns
boolean
Overrides
GfxPrimitiveElementModel.includesPoint
propsToY()
staticpropsToY(props):Record<string,unknown>
Parameters
props
Record<string, unknown>
Returns
Record<string, unknown>
Interfaces
ColumnDataType<Data>
Type Parameters
Data
Data extends Record<string, unknown> = Record<string, unknown>
Properties
data
data:
Data
id
id:
string
name
name:
string
type
type:
string
MindMapElement
Properties
children
children:
object
affine:surface:ymap
affine:surface:ymap:
boolean
json
json:
MindMapJson
id
id:
string
index
index:
string
layoutType
layoutType:
number
seed
seed:
number
style
style:
number
type
type:
"mindmap"
MindMapNode
Properties
index
index:
string
parent?
optionalparent:string
MindMapTreeNode
Properties
children
children:
MindMapTreeNode[]
id
id:
string
index
index:
string
TableBlockProps
Extends
Properties
cells
cells:
Record<string,TableCell>
columns
columns:
Record<string,TableColumn>
comments?
optionalcomments:Record<string,boolean>
rows
rows:
Record<string,TableRow>
textAlign?
optionaltextAlign:TextAlign
TableBlockPropsSerialized
Properties
cells
cells:
Record<string,TableCellSerialized>
columns
columns:
Record<string,TableColumn>
rows
rows:
Record<string,TableRow>
TableCellSerialized
Properties
text
text:
object
delta
delta:
DeltaInsert[]
TableColumn
Properties
backgroundColor?
optionalbackgroundColor:string
columnId
columnId:
string
order
order:
string
width?
optionalwidth:number
TableRow
Properties
backgroundColor?
optionalbackgroundColor:string
order
order:
string
rowId
rowId:
string
Type Aliases
AliasInfo
AliasInfo =
z.infer<typeofAliasInfoSchema>
AttachmentBlockProps
AttachmentBlockProps =
object&Omit<GfxCommonBlockProps,"scale"> &BlockMeta
Type Declaration
caption?
optionalcaption:string
comments?
optionalcomments:Record<string,boolean>
embed
embed:
boolean|BackwardCompatibleUndefined
Whether to show the attachment as an embed view.
footnoteIdentifier
footnoteIdentifier:
string|null
name
name:
string
size
size:
number
sourceId?
optionalsourceId:string
style?
optionalstyle: typeofAttachmentBlockStyles[number]
type
type:
string
MIME type
BlockMeta
BlockMeta =
object
Extended by
Properties
meta:createdAt?
optionalmeta:createdAt:number
meta:createdBy?
optionalmeta:createdBy:string
meta:updatedAt?
optionalmeta:updatedAt:number
meta:updatedBy?
optionalmeta:updatedBy:string
BookmarkBlockProps
BookmarkBlockProps =
object&LinkPreviewData&Omit<GfxCommonBlockProps,"scale"> &BlockMeta
Type Declaration
caption
caption:
string|null
comments?
optionalcomments:Record<string,boolean>
footnoteIdentifier
footnoteIdentifier:
string|null
style
style: typeof
BookmarkStyles[number]
url
url:
string
BrushProps
BrushProps =
BaseElementProps&object
Type Declaration
color
color:
Color
lineWidth
lineWidth:
number
points
points:
number[][]
[[x0,y0,pressure0?],[x1,y1,pressure1?]...] pressure is optional and exsits when pressure sensitivity is supported, otherwise not.
BuiltInEmbedModel
BuiltInEmbedModel =
EmbedCardModel|EmbedHtmlModel
CalloutProps
CalloutProps =
object&BlockMeta
Type Declaration
backgroundColorName?
optionalbackgroundColorName:string
icon?
optionalicon:IconData
text
text:
Text
CellDataType<ValueType>
CellDataType<
ValueType> =object
Type Parameters
ValueType
ValueType = unknown
Properties
columnId
columnId:
ColumnDataType["id"]
value
value:
ValueType
CollapseButton
CollapseButton =
object
Properties
fillColor
fillColor:
Color
filled
filled:
boolean
height
height:
number
radius
radius:
number
strokeColor
strokeColor:
Color
strokeWidth
strokeWidth:
number
width
width:
number
Color
Color =
z.infer<typeofColorSchema>
ColumnUpdater()<T>
ColumnUpdater<
T> = (data) =>Partial<T>
Type Parameters
T
T extends ColumnDataType = ColumnDataType
Parameters
data
T
Returns
Partial<T>
Connectable
Connectable =
Exclude<GfxModel,ConnectorElementModel|BrushElementModel|GroupElementModel>
Connection
Connection =
object
Properties
id?
optionalid:string
position?
optionalposition: [number,number]
ConnectorElementProps
ConnectorElementProps =
BaseElementProps&object&ConnectorLabelProps
Type Declaration
frontEndpointStyle?
optionalfrontEndpointStyle:PointStyle
mode
mode:
ConnectorMode
rearEndpointStyle?
optionalrearEndpointStyle:PointStyle
rough?
optionalrough:boolean
roughness?
optionalroughness:number
source
source:
Connection
stroke
stroke:
Color
strokeStyle
strokeStyle:
StrokeStyle
strokeWidth
strokeWidth:
number
target
target:
Connection
ConnectorLabelConstraintsProps
ConnectorLabelConstraintsProps =
object
Properties
hasMaxWidth
hasMaxWidth:
boolean
maxWidth
maxWidth:
number
ConnectorLabelOffsetProps
ConnectorLabelOffsetProps =
object
Properties
anchor?
optionalanchor:ConnectorLabelOffsetAnchor
distance
distance:
number
ConnectorLabelProps
ConnectorLabelProps =
object
Properties
labelConstraints?
optionallabelConstraints:ConnectorLabelConstraintsProps
labelDisplay?
optionallabelDisplay:boolean
labelEditing?
optionallabelEditing:boolean
labelOffset?
optionallabelOffset:ConnectorLabelOffsetProps
labelStyle?
optionallabelStyle:TextStyleProps
labelXYWH?
optionallabelXYWH:XYWH
text?
optionaltext:Y.Text
ConnectorStyle
ConnectorStyle =
object
Properties
mode
mode:
ConnectorMode
stroke
stroke:
Color
strokeStyle
strokeStyle:
StrokeStyle
strokeWidth
strokeWidth:
number
DatabaseBlockProps
DatabaseBlockProps =
object
Properties
cells
cells:
SerializedCells
columns
columns:
ColumnDataType[]
comments?
optionalcomments:Record<string,boolean>
title
title:
Text
views
views:
ViewBasicDataType[]
DocMode
DocMode =
"edgeless"|"page"
EmbedBlockModel<Props>
EmbedBlockModel<
Props> =BlockModel<EmbedProps<Props>>
Type Parameters
Props
Props = object
EmbedCardModel
EmbedCardModel =
InstanceType<ExternalEmbedModel|InternalEmbedModel>
EmbedCardStyle
EmbedCardStyle =
"horizontal"|"horizontalThin"|"list"|"vertical"|"cube"|"cubeThick"|"video"|"figma"|"html"|"syncedDoc"|"pdf"|"citation"|"audio"
EmbedFigmaBlockProps
EmbedFigmaBlockProps =
object&EmbedFigmaBlockUrlData
Type Declaration
caption
caption:
string|null
style
style: typeof
EmbedFigmaStyles[number]
url
url:
string
EmbedFigmaBlockUrlData
EmbedFigmaBlockUrlData =
object
Properties
description
description:
string|null
title
title:
string|null
EmbedGithubBlockProps
EmbedGithubBlockProps =
object&EmbedGithubBlockUrlData
Type Declaration
caption
caption:
string|null
githubId
githubId:
string
githubType
githubType:
"issue"|"pr"
owner
owner:
string
repo
repo:
string
style
style: typeof
EmbedGithubStyles[number]
url
url:
string
EmbedGithubBlockUrlData
EmbedGithubBlockUrlData =
object
Properties
assignees
assignees:
string[] |null
createdAt
createdAt:
string|null
description
description:
string|null
image
image:
string|null
status
status:
string|null
statusReason
statusReason:
string|null
title
title:
string|null
EmbedHtmlBlockProps
EmbedHtmlBlockProps =
object
Properties
caption
caption:
string|null
design?
optionaldesign:string
html?
optionalhtml:string
style
style: typeof
EmbedHtmlStyles[number]
EmbedIframeBlockProps
EmbedIframeBlockProps =
object&Omit<GfxCommonBlockProps,"rotate">
Type Declaration
caption
caption:
string|null
description
description:
string|null
height?
optionalheight:number
iframeUrl?
optionaliframeUrl:string
title
title:
string|null
url
url:
string
width?
optionalwidth:number
EmbedLinkedDocBlockProps
EmbedLinkedDocBlockProps =
object&ReferenceInfo
Type Declaration
caption
caption:
string|null
footnoteIdentifier
footnoteIdentifier:
string|null
style
style: typeof
EmbedLinkedDocStyles[number]
EmbedLoomBlockProps
EmbedLoomBlockProps =
object&EmbedLoomBlockUrlData
Type Declaration
caption
caption:
string|null
style
style: typeof
EmbedLoomStyles[number]
url
url:
string
EmbedLoomBlockUrlData
EmbedLoomBlockUrlData =
object
Properties
description
description:
string|null
image
image:
string|null
title
title:
string|null
videoId
videoId:
string|null
EmbedProps<Props>
EmbedProps<
Props> =Props&GfxCompatibleProps&BlockMeta&object
Type Declaration
comments?
optionalcomments:Record<string,boolean>
Type Parameters
Props
Props = object
EmbedSyncedDocBlockProps
EmbedSyncedDocBlockProps =
object&ReferenceInfo&GfxCompatibleProps
Type Declaration
caption?
optionalcaption:string|null
preFoldHeight?
optionalpreFoldHeight:number
Record the scaled height of the synced doc block when it is folded, a.k.a the fourth number of the xywh
scale?
optionalscale:number
style
style:
EmbedCardStyle
EmbedYoutubeBlockProps
EmbedYoutubeBlockProps =
object&EmbedYoutubeBlockUrlData
Type Declaration
caption
caption:
string|null
style
style: typeof
EmbedYoutubeStyles[number]
url
url:
string
EmbedYoutubeBlockUrlData
EmbedYoutubeBlockUrlData =
object
Properties
creator
creator:
string|null
creatorImage
creatorImage:
string|null
creatorUrl
creatorUrl:
string|null
description
description:
string|null
image
image:
string|null
title
title:
string|null
videoId
videoId:
string|null
ExpandButton
ExpandButton =
CollapseButton&object
Type Declaration
color
color:
Color
fontFamily
fontFamily:
FontFamily
fontSize
fontSize:
number
fontWeight
fontWeight:
FontWeight
ExternalEmbedModel
ExternalEmbedModel = typeof
ExternalEmbedModels[number]
FootNote
FootNote =
z.infer<typeofFootNoteSchema>
FootNoteReferenceParams
FootNoteReferenceParams =
z.infer<typeofFootNoteReferenceParamsSchema>
FootNoteReferenceType
FootNoteReferenceType =
"doc"|"attachment"|"url"
FrameBlockProps
FrameBlockProps =
object&GfxCompatibleProps
Type Declaration
background
background:
Color
childElementIds?
optionalchildElementIds:Record<string,boolean>
comments?
optionalcomments:Record<string,boolean>
presentationIndex?
optionalpresentationIndex:string
title
title:
Text
HighlighterProps
HighlighterProps =
BaseElementProps&object
Type Declaration
color
color:
Color
lineWidth
lineWidth:
number
points
points:
number[][]
[[x0,y0,pressure0?],[x1,y1,pressure1?]...] pressure is optional and exsits when pressure sensitivity is supported, otherwise not.
ImageBlockProps
ImageBlockProps =
object&Omit<GfxCommonBlockProps,"scale"> &BlockMeta
Type Declaration
caption?
optionalcaption:string
comments?
optionalcomments:Record<string,boolean>
height?
optionalheight:number
rotate
rotate:
number
size?
optionalsize:number
sourceId?
optionalsourceId:string
textAlign?
optionaltextAlign:TextAlign
width?
optionalwidth:number
InternalEmbedModel
InternalEmbedModel = typeof
InternalEmbedModels[number]
LatexProps
LatexProps =
object&GfxCommonBlockProps
Type Declaration
comments?
optionalcomments:Record<string,boolean>
latex
latex:
string
LinkableEmbedModel
LinkableEmbedModel =
EmbedCardModel|EmbedIframeBlockModel|BookmarkBlockModel
LinkPreviewData
LinkPreviewData =
z.infer<typeofLinkPreviewDataSchema>
ListProps
ListProps =
object&BlockMeta
Type Declaration
checked
checked:
boolean
collapsed
collapsed:
boolean
comments?
optionalcomments:Record<string,boolean>
order
order:
number|null
text
text:
Text
textAlign?
optionaltextAlign:TextAlign
type
type:
ListType
ListType
ListType =
"bulleted"|"numbered"|"todo"|"toggle"
MindMapJson
MindMapJson =
Record<string,MindMapNode>
MindmapNode
MindmapNode =
object
Properties
children
children:
MindmapNode[]
detail
detail:
NodeDetail
element
element:
GfxPrimitiveElementModel
id
id:
string
overriddenDir?
optionaloverriddenDir:LayoutType
This property override the preferredDir or default layout direction. It is used during dragging that would temporary change the layout direction
parent
parent:
MindmapNode|null
responseArea?
optionalresponseArea:Bound
This area is used to determine where to place the dragged node.
When dragging another node into this area, it will become a sibling of the this node. But if it is dragged into the small area located right after the this node, it will become a child of the this node.
MindmapRoot
MindmapRoot =
MindmapNode&object
Type Declaration
left
left:
MindmapNode[]
right
right:
MindmapNode[]
NodeDetail
NodeDetail =
object
Properties
collapsed?
optionalcollapsed:boolean
index
index:
string
The index of the node, it decides the layout order of the node
parent?
optionalparent:string
NodeStyle
NodeStyle =
object
Properties
color
color:
Color
fillColor
fillColor:
Color
filled
filled:
boolean
fontFamily
fontFamily:
string
fontSize
fontSize:
number
fontWeight
fontWeight:
FontWeight
maxWidth
maxWidth:
false|number
padding
padding: [
number,number]
radius
radius:
number
shadow?
optionalshadow:object
blur
blur:
number
color
color:
Color
offsetX
offsetX:
number
offsetY
offsetY:
number
strokeColor
strokeColor:
Color
strokeWidth
strokeWidth:
number
textResizing
textResizing:
TextResizing
NodeType
NodeType =
z.infer<typeofnodeSchema>
NoteEdgelessProps
NoteEdgelessProps =
object
Properties
collapse?
optionalcollapse:boolean
collapsedHeight?
optionalcollapsedHeight:number
scale?
optionalscale:number
style
style:
object
borderRadius
borderRadius:
number
borderSize
borderSize:
number
borderStyle
borderStyle:
StrokeStyle
shadowType
shadowType:
string
NoteProps
NoteProps =
object&GfxCompatibleProps
Type Declaration
background
background:
Color
comments?
optionalcomments:Record<string,boolean>
displayMode
displayMode:
NoteDisplayMode
edgeless
edgeless:
NoteEdgelessProps
hidden
hidden:
boolean
Deprecated
use displayMode instead hidden:true -> displayMode:NoteDisplayMode.EdgelessOnly: means the note is visible only in the edgeless mode hidden:false -> displayMode:NoteDisplayMode.DocAndEdgeless: means the note is visible in the doc and edgeless mode
Palette
Palette =
z.infer<typeofPaletteSchema>
ParagraphProps
ParagraphProps =
object&BlockMeta
Type Declaration
collapsed
collapsed:
boolean
comments?
optionalcomments:Record<string,boolean>
text
text:
Text
textAlign?
optionaltextAlign:TextAlign
type
type:
ParagraphType
ParagraphType
ParagraphType =
"text"|"quote"|"h1"|"h2"|"h3"|"h4"|"h5"|"h6"
ReferenceInfo
ReferenceInfo =
z.infer<typeofReferenceInfoSchema>
ReferenceParams
ReferenceParams =
z.infer<typeofReferenceParamsSchema>
RootBlockProps
RootBlockProps =
object
Properties
title
title:
Text
SerializedCells
SerializedCells =
Record<string,Record<string,CellDataType>>
SerializedConnection
SerializedConnection =
object
Properties
id?
optionalid:string
position?
optionalposition:`[${number},${number}]`|PointLocation
SerializedConnectorElement
SerializedConnectorElement =
SerializedElement&object
Type Declaration
source
source:
SerializedConnection
target
target:
SerializedConnection
SerializedGroupElement
SerializedGroupElement =
SerializedElement&object
Type Declaration
children
children:
Record<string,boolean>
title
title:
string
SerializedMindmapElement
SerializedMindmapElement =
SerializedElement&object
Type Declaration
children
children:
Record<string,NodeDetail>
ShapeName
ShapeName =
ShapeType|"roundedRect"
ShapeProps
ShapeProps =
BaseElementProps&object&Partial<TextStyleProps>
Type Declaration
fillColor
fillColor:
Color
filled
filled:
boolean
maxWidth?
optionalmaxWidth:false|number
radius
radius:
number
roughness?
optionalroughness:number
shapeStyle
shapeStyle:
ShapeStyle
shapeType
shapeType:
ShapeType
strokeColor
strokeColor:
Color
strokeStyle
strokeStyle:
StrokeStyle
strokeWidth
strokeWidth:
number
text?
optionaltext:Y.Text
textHorizontalAlign?
optionaltextHorizontalAlign:TextAlign
textResizing?
optionaltextResizing:TextResizing
textVerticalAlign?
optionaltextVerticalAlign:TextVerticalAlign
SurfaceElementModelMap
SurfaceElementModelMap =
object
Properties
brush
brush:
BrushElementModel
connector
connector:
ConnectorElementModel
group
group:
GroupElementModel
highlighter
highlighter:
HighlighterElementModel
mindmap
mindmap:
MindmapElementModel
shape
shape:
ShapeElementModel
text
text:
TextElementModel
SurfaceRefProps
SurfaceRefProps =
object
Properties
caption
caption:
string
comments?
optionalcomments:Record<string,boolean>
reference
reference:
string
refFlavour
refFlavour:
string
SurfaceTextModel
SurfaceTextModel =
SurfaceTextModelMap[keyofSurfaceTextModelMap]
SurfaceTextModelMap
SurfaceTextModelMap =
object
Properties
connector
connector:
ConnectorElementModel
edgeless-text
edgeless-text:
EdgelessTextBlockModel
shape
shape:
ShapeElementModel
text
text:
TextElementModel
TableCell
TableCell =
object
Properties
text
text:
Text
TextElementProps
TextElementProps =
BaseElementProps&object&Omit<TextStyleProps,"fontWeight"|"fontStyle"> &Partial<Pick<TextStyleProps,"fontWeight"|"fontStyle">>
Type Declaration
hasMaxWidth?
optionalhasMaxWidth:boolean
text
text:
Y.Text
TextStyleProps
TextStyleProps =
object
Properties
color
color:
Color
fontFamily
fontFamily:
FontFamily
fontSize
fontSize:
number
fontStyle
fontStyle:
FontStyle
fontWeight
fontWeight:
FontWeight
textAlign
textAlign:
TextAlign
Theme
Theme =
z.infer<typeofThemeSchema>
ViewBasicDataType
ViewBasicDataType =
object
Properties
id
id:
string
mode
mode:
string
name
name:
string
Variables
AliasInfoSchema
constAliasInfoSchema:ZodObject<{description:ZodOptional<ZodString>;title:ZodOptional<ZodString>; },"strip",ZodTypeAny, {description?:string;title?:string; }, {description?:string;title?:string; }>
Custom title and description information.
Supports the following blocks:
- Inline View:
AffineReference- title - Card View:
EmbedLinkedDocBlock- title & description - Embed View:
EmbedSyncedDocBlock- title
AttachmentBlockSchema
constAttachmentBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:attachment"
props
props:
PropsGetter<AttachmentBlockProps>
Type Declaration
children
children:
string[]
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>AttachmentBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
AttachmentBlockSchemaExtension
constAttachmentBlockSchemaExtension:ExtensionType
AttachmentBlockStyles
constAttachmentBlockStyles: ["cubeThick","horizontalThin","pdf","citation"]
BookmarkBlockSchema
constBookmarkBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:bookmark"
props
props:
PropsGetter<BookmarkBlockProps>
Type Declaration
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
BookmarkBlockSchemaExtension
constBookmarkBlockSchemaExtension:ExtensionType
BookmarkStyles
constBookmarkStyles: ["vertical","horizontal","list","cube","citation"]
BRUSH_LINE_WIDTHS
constBRUSH_LINE_WIDTHS:LineWidth[]
CalloutBlockSchema
constCalloutBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:callout"
props
props:
PropsGetter<CalloutProps>
Type Declaration
children
children:
string[]
parent
parent:
string[]
role
role:
"hub"='hub'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
CalloutBlockSchemaExtension
constCalloutBlockSchemaExtension:ExtensionType
CodeBlockSchema
constCodeBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:code"
props
props:
PropsGetter<CodeBlockProps>
Type Declaration
children
children:
never[] =[]
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
CodeBlockSchemaExtension
constCodeBlockSchemaExtension:ExtensionType
ColorSchema
constColorSchema:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>
CONNECTOR_LABEL_MAX_WIDTH
constCONNECTOR_LABEL_MAX_WIDTH:280=280
DatabaseBlockSchema
constDatabaseBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:database"
props
props:
PropsGetter<DatabaseBlockProps>
Type Declaration
children
children:
string[]
parent
parent:
string[]
role
role:
"hub"='hub'
version
version:
number=3
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
DatabaseBlockSchemaExtension
constDatabaseBlockSchemaExtension:ExtensionType
DEFAULT_CENTRAL_AREA_RATIO
constDEFAULT_CENTRAL_AREA_RATIO:0.3=0.3
DEFAULT_CONNECTOR_MODE
constDEFAULT_CONNECTOR_MODE:Curve=ConnectorMode.Curve
DEFAULT_FRONT_ENDPOINT_STYLE
constDEFAULT_FRONT_ENDPOINT_STYLE:None=PointStyle.None
DEFAULT_HIGHLIGHTER_LINE_WIDTH
constDEFAULT_HIGHLIGHTER_LINE_WIDTH:22=22
DEFAULT_NOTE_BORDER_SIZE
constDEFAULT_NOTE_BORDER_SIZE:4=4
DEFAULT_NOTE_BORDER_STYLE
constDEFAULT_NOTE_BORDER_STYLE:None=StrokeStyle.None
DEFAULT_NOTE_CORNER
constDEFAULT_NOTE_CORNER:Small=NoteCorners.Small
DEFAULT_NOTE_HEIGHT
constDEFAULT_NOTE_HEIGHT:92=NOTE_MIN_HEIGHT
DEFAULT_NOTE_SHADOW
constDEFAULT_NOTE_SHADOW:Box=NoteShadow.Box
DEFAULT_NOTE_WIDTH
constDEFAULT_NOTE_WIDTH:number
DEFAULT_PAGE_BLOCK_HEIGHT
constDEFAULT_PAGE_BLOCK_HEIGHT:92=DEFAULT_NOTE_HEIGHT
DEFAULT_PAGE_BLOCK_WIDTH
constDEFAULT_PAGE_BLOCK_WIDTH:800=800
DEFAULT_REAR_ENDPOINT_STYLE
constDEFAULT_REAR_ENDPOINT_STYLE:Arrow=PointStyle.Arrow
DEFAULT_ROUGHNESS
constDEFAULT_ROUGHNESS:1.4=1.4
defaultAttachmentProps
constdefaultAttachmentProps:AttachmentBlockProps
defaultEmbedIframeProps
constdefaultEmbedIframeProps:EmbedIframeBlockProps
defaultEmbedSyncedDocBlockProps
constdefaultEmbedSyncedDocBlockProps:EmbedSyncedDocBlockProps
DefaultTheme
constDefaultTheme:Theme
DividerBlockSchema
constDividerBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:divider"
props
props:
PropsGetter<object>
Type Declaration
children
children:
never[] =[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
DividerBlockSchemaExtension
constDividerBlockSchemaExtension:ExtensionType
DocModes
constDocModes: readonly ["edgeless","page"]
EDGELESS_TEXT_BLOCK_MIN_HEIGHT
constEDGELESS_TEXT_BLOCK_MIN_HEIGHT:50=50
EDGELESS_TEXT_BLOCK_MIN_WIDTH
constEDGELESS_TEXT_BLOCK_MIN_WIDTH:50=50
EdgelessTextBlockSchema
constEdgelessTextBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:edgeless-text"
props
props:
PropsGetter<EdgelessTextProps>
Type Declaration
children
children:
string[]
parent
parent:
string[]
role
role:
"hub"='hub'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EdgelessTextBlockSchemaExtension
constEdgelessTextBlockSchemaExtension:ExtensionType
EdgelessTextZodSchema
constEdgelessTextZodSchema:ZodDefault<ZodObject<{color:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;fontFamily:ZodNativeEnum<typeofFontFamily>;fontStyle:ZodNativeEnum<typeofFontStyle>;fontWeight:ZodNativeEnum<typeofFontWeight>;textAlign:ZodNativeEnum<typeofTextAlign>; },"strip",ZodTypeAny, {color:string| {normal:string; } | {dark:string;light:string; };fontFamily:FontFamily;fontStyle:FontStyle;fontWeight:FontWeight;textAlign:TextAlign; }, {color:string| {normal:string; } | {dark:string;light:string; };fontFamily:FontFamily;fontStyle:FontStyle;fontWeight:FontWeight;textAlign:TextAlign; }>>
EmbedFigmaBlockSchema
constEmbedFigmaBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
props:
PropsGetter<EmbedProps<EmbedFigmaBlockProps>>
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedFigmaBlockSchemaExtension
constEmbedFigmaBlockSchemaExtension:ExtensionType
EmbedFigmaStyles
constEmbedFigmaStyles: ["figma"]
EmbedGithubBlockSchema
constEmbedGithubBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
props:
PropsGetter<EmbedProps<EmbedGithubBlockProps>>
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedGithubBlockSchemaExtension
constEmbedGithubBlockSchemaExtension:ExtensionType
EmbedGithubStyles
constEmbedGithubStyles: ["vertical","horizontal","list","cube"]
EmbedHtmlBlockSchema
constEmbedHtmlBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
props:
PropsGetter<EmbedProps<EmbedHtmlBlockProps>>
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedHtmlBlockSchemaExtension
constEmbedHtmlBlockSchemaExtension:ExtensionType
EmbedHtmlStyles
constEmbedHtmlStyles: ["html"]
EmbedIframeBlockSchema
constEmbedIframeBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:embed-iframe"
props
props:
PropsGetter<EmbedIframeBlockProps>
Type Declaration
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedIframeBlockSchemaExtension
constEmbedIframeBlockSchemaExtension:ExtensionType
EmbedIframeStyles
constEmbedIframeStyles: ["figma"]
EmbedLinkedDocBlockSchema
constEmbedLinkedDocBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedLinkedDocBlockSchemaExtension
constEmbedLinkedDocBlockSchemaExtension:ExtensionType
EmbedLinkedDocStyles
constEmbedLinkedDocStyles: ["vertical","horizontal","list","cube","horizontalThin","citation"]
EmbedLoomBlockSchema
constEmbedLoomBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
props:
PropsGetter<EmbedProps<EmbedLoomBlockProps>>
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedLoomBlockSchemaExtension
constEmbedLoomBlockSchemaExtension:ExtensionType
EmbedLoomStyles
constEmbedLoomStyles: ["video"]
EmbedSyncedDocBlockSchema
constEmbedSyncedDocBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedSyncedDocBlockSchemaExtension
constEmbedSyncedDocBlockSchemaExtension:ExtensionType
EmbedSyncedDocStyles
constEmbedSyncedDocStyles: ["syncedDoc"]
EmbedYoutubeBlockSchema
constEmbedYoutubeBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
props:
PropsGetter<EmbedProps<EmbedYoutubeBlockProps>>
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
EmbedYoutubeBlockSchemaExtension
constEmbedYoutubeBlockSchemaExtension:ExtensionType
EmbedYoutubeStyles
constEmbedYoutubeStyles: ["video"]
ExternalEmbedModels
constExternalEmbedModels: readonly [typeofEmbedFigmaModel, typeofEmbedGithubModel, typeofEmbedLoomModel, typeofEmbedYoutubeModel]
FontFamilyList
constFontFamilyList: ([BebasNeue,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"] | [Inter,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"] | [Kalam,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"] | [Lora,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"] | [OrelegaOne,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"] | [Poppins,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"] | [Satoshi,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi"])[]
FontFamilyMap
constFontFamilyMap:Record<FontFamily,"BebasNeue"|"Inter"|"Kalam"|"Lora"|"OrelegaOne"|"Poppins"|"Satoshi">
FontFamilySchema
constFontFamilySchema:ZodNativeEnum<typeofFontFamily>
FontStyleSchema
constFontStyleSchema:ZodNativeEnum<typeofFontStyle>
FontWeightMap
constFontWeightMap:Record<FontWeight,"Medium"|"Bold"|"Light"|"Regular"|"SemiBold">
FontWeightSchema
constFontWeightSchema:ZodNativeEnum<typeofFontWeight>
FootNoteReferenceParamsSchema
constFootNoteReferenceParamsSchema:ZodObject<{blobId:ZodOptional<ZodString>;description:ZodOptional<ZodString>;docId:ZodOptional<ZodString>;favicon:ZodOptional<ZodString>;fileName:ZodOptional<ZodString>;fileType:ZodOptional<ZodString>;title:ZodOptional<ZodString>;type:ZodEnum<["doc","attachment","url"]>;url:ZodOptional<ZodString>; },"strip",ZodTypeAny, {blobId?:string;description?:string;docId?:string;favicon?:string;fileName?:string;fileType?:string;title?:string;type:"doc"|"attachment"|"url";url?:string; }, {blobId?:string;description?:string;docId?:string;favicon?:string;fileName?:string;fileType?:string;title?:string;type:"doc"|"attachment"|"url";url?:string; }>
FootNoteReferenceParamsSchema is used to define the parameters for a footnote reference. It supports the following types:
- docId: string - the id of the doc
- blobId: string - the id of the attachment
- url: string - the url of the reference
- fileName: string - the name of the attachment
- fileType: string - the type of the attachment
- favicon: string - the favicon of the url reference
- title: string - the title of the url reference
- description: string - the description of the url reference
FootNoteReferenceTypes
constFootNoteReferenceTypes: readonly ["doc","attachment","url"]
FootNoteSchema
constFootNoteSchema:ZodObject<{label:ZodString;reference:ZodObject<{blobId:ZodOptional<ZodString>;description:ZodOptional<ZodString>;docId:ZodOptional<ZodString>;favicon:ZodOptional<ZodString>;fileName:ZodOptional<ZodString>;fileType:ZodOptional<ZodString>;title:ZodOptional<ZodString>;type:ZodEnum<["doc","attachment","url"]>;url:ZodOptional<ZodString>; },"strip",ZodTypeAny, {blobId?:string;description?:string;docId?:string;favicon?:string;fileName?:string;fileType?:string;title?:string;type:"doc"|"attachment"|"url";url?:string; }, {blobId?:string;description?:string;docId?:string;favicon?:string;fileName?:string;fileType?:string;title?:string;type:"doc"|"attachment"|"url";url?:string; }>; },"strip",ZodTypeAny, {label:string;reference: {blobId?:string;description?:string;docId?:string;favicon?:string;fileName?:string;fileType?:string;title?:string;type:"doc"|"attachment"|"url";url?:string; }; }, {label:string;reference: {blobId?:string;description?:string;docId?:string;favicon?:string;fileName?:string;fileType?:string;title?:string;type:"doc"|"attachment"|"url";url?:string; }; }>
FrameBlockSchema
constFrameBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:frame"
props
props:
PropsGetter<FrameBlockProps>
Type Declaration
children
children:
never[] =[]
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
FrameBlockSchemaExtension
constFrameBlockSchemaExtension:ExtensionType
FrameZodSchema
constFrameZodSchema:ZodDefault<ZodObject<{background:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {background:string| {normal:string; } | {dark:string;light:string; }; }, {background:string| {normal:string; } | {dark:string;light:string; }; }>>
HIGHLIGHTER_LINE_WIDTHS
constHIGHLIGHTER_LINE_WIDTHS:number[]
ImageBlockSchema
constImageBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:image"
props
props:
PropsGetter<ImageBlockProps>
Type Declaration
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>ImageBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
ImageBlockSchemaExtension
constImageBlockSchemaExtension:ExtensionType
InternalEmbedModels
constInternalEmbedModels: readonly [typeofEmbedLinkedDocModel, typeofEmbedSyncedDocModel]
LatexBlockSchema
constLatexBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:latex"
props
props:
PropsGetter<LatexProps>
Type Declaration
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
LatexBlockSchemaExtension
constLatexBlockSchemaExtension:ExtensionType
LINE_COLORS
constLINE_COLORS: readonly [Yellow,Orange,Red,Magenta,Purple,Blue,Teal,Green,Black,Grey,White]
Use DefaultTheme.StrokeColorShortPalettes instead.
Deprecated
LineColorMap
constLineColorMap:Record<LineColor,"Black"|"Blue"|"Green"|"Grey"|"Magenta"|"Orange"|"Purple"|"Red"|"Teal"|"White"|"Yellow">
LineColorsSchema
constLineColorsSchema:ZodNativeEnum<typeofLineColor>
LinkPreviewDataSchema
constLinkPreviewDataSchema:ZodObject<{description:ZodNullable<ZodString>;icon:ZodNullable<ZodString>;image:ZodNullable<ZodString>;title:ZodNullable<ZodString>; },"strip",ZodTypeAny, {description:string|null;icon:string|null;image:string|null;title:string|null; }, {description:string|null;icon:string|null;image:string|null;title:string|null; }>
ListBlockSchema
constListBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:list"
props
props:
PropsGetter<ListProps>
Type Declaration
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
ListBlockSchemaExtension
constListBlockSchemaExtension:ExtensionType
MAX_IMAGE_WIDTH
constMAX_IMAGE_WIDTH:460=460
MINDMAP_NODE_MAX_WIDTH
constMINDMAP_NODE_MAX_WIDTH:512=512
mindmapStyleGetters
constmindmapStyleGetters:Record<MindmapStyle,MindmapStyleGetter>
NOTE_CORNERS
constNOTE_CORNERS: readonly [None,Small,Medium,Large,Huge]
NOTE_MIN_HEIGHT
constNOTE_MIN_HEIGHT:92=92
NOTE_MIN_WIDTH
constNOTE_MIN_WIDTH:number
NOTE_SHADOWS
constNOTE_SHADOWS: readonly [None,Box,Sticker,Paper,Float,Film]
NoteBlockSchema
constNoteBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:note"
props
props:
PropsGetter<NoteProps>
Type Declaration
children
children:
string[]
parent
parent:
string[]
role
role:
"hub"='hub'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
NoteBlockSchemaExtension
constNoteBlockSchemaExtension:ExtensionType
NoteCornersMap
constNoteCornersMap:Record<NoteCorners,"None"|"Huge"|"Large"|"Medium"|"Small">
NoteCornersSchema
constNoteCornersSchema:ZodNativeEnum<typeofNoteCorners>
NoteDisplayModeSchema
constNoteDisplayModeSchema:ZodNativeEnum<typeofNoteDisplayMode>
NoteShadowMap
constNoteShadowMap:Record<NoteShadow,"None"|"Box"|"Film"|"Float"|"Paper"|"Sticker">
NoteShadowsSchema
constNoteShadowsSchema:ZodNativeEnum<typeofNoteShadow>
NoteZodSchema
constNoteZodSchema:ZodDefault<ZodObject<{background:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;displayMode:ZodNativeEnum<typeofNoteDisplayMode>;edgeless:ZodObject<{style:ZodObject<{borderRadius:ZodNumber;borderSize:ZodNumber;borderStyle:ZodNativeEnum<typeofStrokeStyle>;shadowType:ZodNativeEnum<typeofNoteShadow>; },"strip",ZodTypeAny, {borderRadius:number;borderSize:number;borderStyle:StrokeStyle;shadowType:NoteShadow; }, {borderRadius:number;borderSize:number;borderStyle:StrokeStyle;shadowType:NoteShadow; }>; },"strip",ZodTypeAny, {style: {borderRadius:number;borderSize:number;borderStyle:StrokeStyle;shadowType:NoteShadow; }; }, {style: {borderRadius:number;borderSize:number;borderStyle:StrokeStyle;shadowType:NoteShadow; }; }>; },"strip",ZodTypeAny, {background:string| {normal:string; } | {dark:string;light:string; };displayMode:NoteDisplayMode;edgeless: {style: {borderRadius:number;borderSize:number;borderStyle:StrokeStyle;shadowType:NoteShadow; }; }; }, {background:string| {normal:string; } | {dark:string;light:string; };displayMode:NoteDisplayMode;edgeless: {style: {borderRadius:number;borderSize:number;borderStyle:StrokeStyle;shadowType:NoteShadow; }; }; }>>
PaletteSchema
constPaletteSchema:ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>
ParagraphBlockSchema
constParagraphBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:paragraph"
props
props:
PropsGetter<ParagraphProps>
Type Declaration
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
ParagraphBlockSchemaExtension
constParagraphBlockSchemaExtension:ExtensionType
PointStyleMap
constPointStyleMap:Record<PointStyle,"Arrow"|"Circle"|"Diamond"|"None"|"Triangle">
ReferenceInfoSchema
constReferenceInfoSchema:ZodObject<object&object,"strip",ZodTypeAny, {description?:string;pageId:string;params?: {blockIds?:string[];commentId?:string;databaseId?:string;databaseRowId?:string;elementIds?:string[];mode?:"edgeless"|"page";xywh?:`[${number},${number},${number},${number}]`; };title?:string; }, {description?:string;pageId:string;params?: {blockIds?:string[];commentId?:string;databaseId?:string;databaseRowId?:string;elementIds?:string[];mode?:"edgeless"|"page";xywh?:`[${number},${number},${number},${number}]`; };title?:string; }>
ReferenceParamsSchema
constReferenceParamsSchema:ZodObject<{blockIds:ZodOptional<ZodArray<ZodString,"many">>;commentId:ZodOptional<ZodOptional<ZodString>>;databaseId:ZodOptional<ZodOptional<ZodString>>;databaseRowId:ZodOptional<ZodOptional<ZodString>>;elementIds:ZodOptional<ZodArray<ZodString,"many">>;mode:ZodOptional<ZodEnum<["edgeless","page"]>>;xywh:ZodOptional<ZodOptional<ZodType<`[${number},${number},${number},${number}]`,ZodTypeDef,`[${number},${number},${number},${number}]`>>>; },"strip",ZodTypeAny, {blockIds?:string[];commentId?:string;databaseId?:string;databaseRowId?:string;elementIds?:string[];mode?:"edgeless"|"page";xywh?:`[${number},${number},${number},${number}]`; }, {blockIds?:string[];commentId?:string;databaseId?:string;databaseRowId?:string;elementIds?:string[];mode?:"edgeless"|"page";xywh?:`[${number},${number},${number},${number}]`; }>
RootBlockSchema
constRootBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:page"
props
props:
PropsGetter<RootBlockProps>
Type Declaration
role
role:
"root"='root'
version
version:
number=2
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
RootBlockSchemaExtension
constRootBlockSchemaExtension:ExtensionType
SerializedXYWHSchema
constSerializedXYWHSchema:ZodType<`[${number},${number},${number},${number}]`,ZodTypeDef,`[${number},${number},${number},${number}]`>
SHAPE_TEXT_PADDING
constSHAPE_TEXT_PADDING:20=20
SHAPE_TEXT_VERTICAL_PADDING
constSHAPE_TEXT_VERTICAL_PADDING:10=10
shapeMethods
constshapeMethods:Record<ShapeType, typeofrect>
StrokeStyleMap
constStrokeStyleMap:Record<StrokeStyle,"None"|"Dash"|"Solid">
StrokeStyleSchema
constStrokeStyleSchema:ZodNativeEnum<typeofStrokeStyle>
styleFour
conststyleFour:StyleFour
styleOne
conststyleOne:StyleOne
styleThree
conststyleThree:StyleThree
styleTwo
conststyleTwo:StyleTwo
SurfaceRefBlockSchema
constSurfaceRefBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:surface-ref"
props
props:
PropsGetter<SurfaceRefProps>
Type Declaration
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
SurfaceRefBlockSchemaExtension
constSurfaceRefBlockSchemaExtension:ExtensionType
SYNCED_DEFAULT_MAX_HEIGHT
constSYNCED_DEFAULT_MAX_HEIGHT:800=800
SYNCED_DEFAULT_WIDTH
constSYNCED_DEFAULT_WIDTH:800=800
SYNCED_MIN_HEIGHT
constSYNCED_MIN_HEIGHT:48=48
SYNCED_MIN_WIDTH
constSYNCED_MIN_WIDTH:370=370
TableBlockSchema
constTableBlockSchema:object
Type Declaration
model
model:
object&object
Type Declaration
flavour
flavour:
"affine:table"
props
props:
PropsGetter<TableBlockProps>
Type Declaration
children
children:
never[] =[]
isFlatData
isFlatData:
true=true
parent
parent:
string[]
role
role:
"content"='content'
version
version:
number=1
transformer()?
optionaltransformer: (transformerConfig) =>BaseBlockTransformer
Parameters
transformerConfig
Map<string, unknown>
Returns
version
version:
number
TableBlockSchemaExtension
constTableBlockSchemaExtension:ExtensionType
TableModelFlavour
constTableModelFlavour:"affine:table"='affine:table'
TextAlignMap
constTextAlignMap:Record<TextAlign,"Center"|"Left"|"Right">
TextAlignSchema
constTextAlignSchema:ZodNativeEnum<typeofTextAlign>
Themes
constThemes:Record<string,Theme>
ThemeSchema
constThemeSchema:ZodObject<{black:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;connectorColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;FillColorShortMap:ZodRecord<ZodString,ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>>;FillColorShortPalettes:ZodArray<ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>,"many">;hightlighterColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;noteBackgrounColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;NoteBackgroundColorMap:ZodRecord<ZodString,ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>>;NoteBackgroundColorPalettes:ZodArray<ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>,"many">;Palettes:ZodArray<ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>,"many">;pureBlack:ZodString;pureWhite:ZodString;shapeFillColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;shapeStrokeColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;shapeTextColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;ShapeTextColorPalettes:ZodArray<ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>,"many">;ShapeTextColorShortMap:ZodRecord<ZodString,ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>>;ShapeTextColorShortPalettes:ZodArray<ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>,"many">;StrokeColorShortMap:ZodRecord<ZodString,ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>>;StrokeColorShortPalettes:ZodArray<ZodObject<{key:ZodString;value:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }, {key:string;value:string| {normal:string; } | {dark:string;light:string; }; }>,"many">;textColor:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>;transparent:ZodLiteral<"transparent">;white:ZodUnion<[ZodString,ZodObject<{normal:ZodString; },"strip",ZodTypeAny, {normal:string; }, {normal:string; }>,ZodObject<{dark:ZodString;light:ZodString; },"strip",ZodTypeAny, {dark:string;light:string; }, {dark:string;light:string; }>]>; },"strip",ZodTypeAny, {black:string| {normal:string; } | {dark:string;light:string; };connectorColor:string| {normal:string; } | {dark:string;light:string; };FillColorShortMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;FillColorShortPalettes:object[];hightlighterColor:string| {normal:string; } | {dark:string;light:string; };noteBackgrounColor:string| {normal:string; } | {dark:string;light:string; };NoteBackgroundColorMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;NoteBackgroundColorPalettes:object[];Palettes:object[];pureBlack:string;pureWhite:string;shapeFillColor:string| {normal:string; } | {dark:string;light:string; };shapeStrokeColor:string| {normal:string; } | {dark:string;light:string; };shapeTextColor:string| {normal:string; } | {dark:string;light:string; };ShapeTextColorPalettes:object[];ShapeTextColorShortMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;ShapeTextColorShortPalettes:object[];StrokeColorShortMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;StrokeColorShortPalettes:object[];textColor:string| {normal:string; } | {dark:string;light:string; };transparent:"transparent";white:string| {normal:string; } | {dark:string;light:string; }; }, {black:string| {normal:string; } | {dark:string;light:string; };connectorColor:string| {normal:string; } | {dark:string;light:string; };FillColorShortMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;FillColorShortPalettes:object[];hightlighterColor:string| {normal:string; } | {dark:string;light:string; };noteBackgrounColor:string| {normal:string; } | {dark:string;light:string; };NoteBackgroundColorMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;NoteBackgroundColorPalettes:object[];Palettes:object[];pureBlack:string;pureWhite:string;shapeFillColor:string| {normal:string; } | {dark:string;light:string; };shapeStrokeColor:string| {normal:string; } | {dark:string;light:string; };shapeTextColor:string| {normal:string; } | {dark:string;light:string; };ShapeTextColorPalettes:object[];ShapeTextColorShortMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;ShapeTextColorShortPalettes:object[];StrokeColorShortMap:Record<string,string| {normal:string; } | {dark:string;light:string; }>;StrokeColorShortPalettes:object[];textColor:string| {normal:string; } | {dark:string;light:string; };transparent:"transparent";white:string| {normal:string; } | {dark:string;light:string; }; }>
Functions
applyNodeStyle()
applyNodeStyle(
node,nodeStyle):void
Parameters
node
nodeStyle
Returns
void
buildMindMapTree()
buildMindMapTree(
element):MindMapTreeNode|null
Parameters
element
Record<string, unknown>
Returns
MindMapTreeNode | null
createEmbedBlockSchema()
createEmbedBlockSchema<
Props,Model,Transformer>(__namedParameters):object
Type Parameters
Props
Props extends object
Model
Model extends EmbedBlockModel<Props>
Transformer
Transformer extends BaseBlockTransformer<EmbedProps<Props>> = BaseBlockTransformer<EmbedProps<Props>>
Parameters
__namedParameters
name
string
props?
(internalPrimitives) => Props
toModel
() => Model
transformer?
() => Transformer
version
number
Returns
object
model
model:
object&object
Type Declaration
flavour
flavour:
`affine:embed-${string}`
props
props:
PropsGetter<EmbedProps<Props>>
Type Declaration
role
role:
"content"='content'
version
version:
number
transformer()?
optionaltransformer: (transformerConfig) =>Transformer
Parameters
transformerConfig
Map<string, unknown>
Returns
Transformer
version
version:
number
createEnumMap()
createEnumMap<
T>(EnumObject):Record<T[keyofT], keyofT>
Type Parameters
T
T extends Record<string, string | number>
Parameters
EnumObject
T
Returns
Record<T[keyof T], keyof T>
defineEmbedModel()
defineEmbedModel<
Props,T>(BlockModelSuperClass): {():GfxBlockElementModel<EmbedProps<Props>>;prototype:GfxBlockElementModel<any>; }
Type Parameters
Props
Props extends object
T
T extends Constructor<BlockModel<Props>> = Constructor<BlockModel<Props>>
Parameters
BlockModelSuperClass
T
Returns
new defineEmbedModel():
GfxBlockElementModel<EmbedProps<Props>>
Returns
GfxBlockElementModel<EmbedProps<Props>>
prototype
prototype:
GfxBlockElementModel<any>
getConnectorModeName()
getConnectorModeName(
mode):string
Parameters
mode
Returns
string
getMindMapNodeMap()
getMindMapNodeMap(
element):Map<string,MindMapTreeNode>
Parameters
element
Record<string, unknown>
Returns
Map<string, MindMapTreeNode>
getShapeName()
getShapeName(
type,radius):ShapeName
Parameters
type
radius
number
Returns
getShapeRadius()
getShapeRadius(
name):number
Parameters
name
Returns
number
getShapeType()
getShapeType(
name):ShapeType
Parameters
name
Returns
isExternalEmbedModel()
isExternalEmbedModel(
model): model is EmbedGithubModel | EmbedYoutubeModel | EmbedFigmaModel | EmbedLoomModel
Parameters
model
BlockModel<object> | GfxModel
Returns
model is EmbedGithubModel | EmbedYoutubeModel | EmbedFigmaModel | EmbedLoomModel
isInternalEmbedModel()
isInternalEmbedModel(
model): model is EmbedLinkedDocModel | EmbedSyncedDocModel
Parameters
model
BlockModel<object> | GfxModel
Returns
model is EmbedLinkedDocModel | EmbedSyncedDocModel
isTransparent()
isTransparent(
color):boolean
Parameters
color
string | { normal: string; } | { dark: string; light: string; }
Returns
boolean
resolveColor()
resolveColor(
color,colorScheme,fallback):string
Parameters
color
string | { normal: string; } | { dark: string; light: string; }
colorScheme
fallback
string = 'transparent'
Returns
string