BlockSuite API Documentation / @blocksuite/blocks / BlocksUtils
Variable: BlocksUtils
const
BlocksUtils:object
Type declaration
deserializeXYWH()
deserializeXYWH: (
xywh
) =>XYWH
Parameters
xywh
string
Returns
XYWH
isCanvasElement()
isCanvasElement: (
selectable
) =>selectable is SurfaceElementModel<BaseElementProps>
Parameters
selectable
null
| GfxModel
| BlockModel
<object
, SignaledProps
<object
>>
Returns
selectable is SurfaceElementModel<BaseElementProps>
matchFlavours()
matchFlavours: <
Key
>(model
,expected
) =>model is BlockModels[Key[number]]
Type Parameters
• Key extends keyof BlockModels
[]
Parameters
model
null
| DraftModel
expected
Key
Returns
model is BlockModels[Key[number]]
Point
Point: typeof
Point
splitElements()
splitElements: (
elements
) =>object
Parameters
elements
GfxModel
[]
Returns
object
edgelessTexts
edgelessTexts:
EdgelessTextBlockModel
[]
embedSyncedDocs
embedSyncedDocs:
EmbedSyncedDocModel
[]
frames
frames:
FrameBlockModel
[]
images
images:
ImageBlockModel
[]
notes
notes:
NoteBlockModel
[]
shapes
shapes:
SurfaceModel
[]
Defined in
packages/blocks/src/index.ts:116