Skip to content

@sqlrooms/documents / blockDocumentContentToBlocks

Function: blockDocumentContentToBlocks()

blockDocumentContentToBlocks(content): ({ id: string; type: "heading"; level: 1 | 2 | 3; text: string; } | { id: string; type: "paragraph"; text: string; } | { id: string; type: "richText"; markdown: string; } | { id: string; type: "list"; ordered?: boolean; items: string[]; } | { id: string; type: "todo"; checked: boolean; text: string; } | { id: string; type: "image"; assetId: string; caption?: string; } | { id: string; type: "chartImage"; assetId: string; caption?: string; } | { id: string; type: "chart"; tableName: string; config: unknown; selectionGroupId?: string; caption?: string; } | { id: string; type: "statefulBlock"; blockType: string; blockInstanceId: string; ownership?: "owned" | "shared" | "external"; title?: string; caption?: string; height?: number; })[]

Parameters

ParameterType
content{[key: string]: unknown; type: "doc"; content: BlockDocumentNode[]; }
content.type"doc"
content.contentBlockDocumentNode[]

Returns

({ id: string; type: "heading"; level: 1 | 2 | 3; text: string; } | { id: string; type: "paragraph"; text: string; } | { id: string; type: "richText"; markdown: string; } | { id: string; type: "list"; ordered?: boolean; items: string[]; } | { id: string; type: "todo"; checked: boolean; text: string; } | { id: string; type: "image"; assetId: string; caption?: string; } | { id: string; type: "chartImage"; assetId: string; caption?: string; } | { id: string; type: "chart"; tableName: string; config: unknown; selectionGroupId?: string; caption?: string; } | { id: string; type: "statefulBlock"; blockType: string; blockInstanceId: string; ownership?: "owned" | "shared" | "external"; title?: string; caption?: string; height?: number; })[]