BlockSpec
type BlockSpec = | { align?: AlignSpec | null; breakBefore?: boolean; keepWithNext?: boolean; level?: number | null; lineHeight?: number | null; orphans?: number | null; spaceAfter?: number | null; spaceBefore?: number | null; spans?: SpanSpec[] | null; style?: string | null; text?: Text | null; type: "paragraph"; widows?: number | null;} | { align?: AlignSpec | null; breakBefore?: boolean; keepWithNext?: boolean; level?: number | null; lineHeight?: number | null; orphans?: number | null; spaceAfter?: number | null; spaceBefore?: number | null; spans?: SpanSpec[] | null; style?: string | null; text?: Text | null; type: "heading"; widows?: number | null;} | { indent?: number | null; items: ListItemSpec[]; kind: ListKindSpec; start?: number | null; style?: string | null; type: "list";} | { alt: Text; image: string; type: "figure"; width?: number | null;} | { height: number; type: "spacer";} | { type: "pageBreak";} | { blocks: BlockSpec[]; type: "keep";} | { columns: ColumnSpec[]; footer?: RowSpec[]; frame?: RuleSpec | null; header?: RowSpec[]; headerBackground?: string | null; headerRule?: RuleSpec | null; padding?: number | null; rowRules?: RuleSpec | null; rows?: RowSpec[]; spaceAfter?: number | null; spaceBefore?: number | null; type: "table";} | { indent?: number | null; levels?: number | null; style?: string | null; type: "contents";} | { blocks: BlockSpec[]; type: "quote";} | { style?: string | null; text: Text; type: "codeBlock";} | { type: "rule";};Defined in: packages/sdk/src/generated/document.ts:16
One block of the flow, tagged by type.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ align?: AlignSpec | null; breakBefore?: boolean; keepWithNext?: boolean; level?: number | null; lineHeight?: number | null; orphans?: number | null; spaceAfter?: number | null; spaceBefore?: number | null; spans?: SpanSpec[] | null; style?: string | null; text?: Text | null; type: "paragraph"; widows?: number | null;}align?
Section titled “align?”align?: AlignSpec | null;Where the lines sit.
breakBefore?
Section titled “breakBefore?”breakBefore?: boolean;Start it on a new page.
keepWithNext?
Section titled “keepWithNext?”keepWithNext?: boolean;Keep it on the page of the next block.
level?
Section titled “level?”level?: number | null;The heading’s level, 1 to 6: needed by a heading, refused on a paragraph.
lineHeight?
Section titled “lineHeight?”lineHeight?: number | null;The space between lines, as a factor of the size (1.2 when left out).
orphans?
Section titled “orphans?”orphans?: number | null;The fewest lines of the paragraph left at the foot of a page before it breaks (2 when left out).
spaceAfter?
Section titled “spaceAfter?”spaceAfter?: number | null;Points of space below.
spaceBefore?
Section titled “spaceBefore?”spaceBefore?: number | null;Points of space above.
spans?
Section titled “spans?”spans?: SpanSpec[] | null;The text as spans; give this or text.
style?
Section titled “style?”style?: string | null;The style of text, and of spans that name none (body when left out).
text?: Text | null;The text, in style; give this or spans.
type: "paragraph";widows?
Section titled “widows?”widows?: number | null;The fewest lines of the paragraph carried to the top of a new page (2 when left out).
Type Literal
Section titled “Type Literal”{ align?: AlignSpec | null; breakBefore?: boolean; keepWithNext?: boolean; level?: number | null; lineHeight?: number | null; orphans?: number | null; spaceAfter?: number | null; spaceBefore?: number | null; spans?: SpanSpec[] | null; style?: string | null; text?: Text | null; type: "heading"; widows?: number | null;}align?
Section titled “align?”align?: AlignSpec | null;Where the lines sit.
breakBefore?
Section titled “breakBefore?”breakBefore?: boolean;Start it on a new page.
keepWithNext?
Section titled “keepWithNext?”keepWithNext?: boolean;Keep it on the page of the next block.
level?
Section titled “level?”level?: number | null;The heading’s level, 1 to 6: needed by a heading, refused on a paragraph.
lineHeight?
Section titled “lineHeight?”lineHeight?: number | null;The space between lines, as a factor of the size (1.2 when left out).
orphans?
Section titled “orphans?”orphans?: number | null;The fewest lines of the paragraph left at the foot of a page before it breaks (2 when left out).
spaceAfter?
Section titled “spaceAfter?”spaceAfter?: number | null;Points of space below.
spaceBefore?
Section titled “spaceBefore?”spaceBefore?: number | null;Points of space above.
spans?
Section titled “spans?”spans?: SpanSpec[] | null;The text as spans; give this or text.
style?
Section titled “style?”style?: string | null;The style of text, and of spans that name none (body when left out).
text?: Text | null;The text, in style; give this or spans.
type: "heading";widows?
Section titled “widows?”widows?: number | null;The fewest lines of the paragraph carried to the top of a new page (2 when left out).
Type Literal
Section titled “Type Literal”{ indent?: number | null; items: ListItemSpec[]; kind: ListKindSpec; start?: number | null; style?: string | null; type: "list";}indent?
Section titled “indent?”indent?: number | null;Points the items are indented.
items: ListItemSpec[];The items.
kind: ListKindSpec;bullet or numbered.
start?
Section titled “start?”start?: number | null;The first number of a numbered list (1 when left out).
style?
Section titled “style?”style?: string | null;The markers’ style (body when left out).
type: "list";Type Literal
Section titled “Type Literal”{ alt: Text; image: string; type: "figure"; width?: number | null;}alt: Text;Its alternate text, which a screen reader reads.
image: string;An image given beside the document, by name.
type: "figure";width?
Section titled “width?”width?: number | null;Its width in points (the body’s width at most; its own size when left out).
Type Literal
Section titled “Type Literal”{ height: number; type: "spacer";}height
Section titled “height”height: number;Its height in points.
type: "spacer";Type Literal
Section titled “Type Literal”{ type: "pageBreak";}Type Literal
Section titled “Type Literal”{ blocks: BlockSpec[]; type: "keep";}blocks
Section titled “blocks”blocks: BlockSpec[];The blocks.
type: "keep";Type Literal
Section titled “Type Literal”{ columns: ColumnSpec[]; footer?: RowSpec[]; frame?: RuleSpec | null; header?: RowSpec[]; headerBackground?: string | null; headerRule?: RuleSpec | null; padding?: number | null; rowRules?: RuleSpec | null; rows?: RowSpec[]; spaceAfter?: number | null; spaceBefore?: number | null; type: "table";}columns
Section titled “columns”columns: ColumnSpec[];One width per column.
footer?
Section titled “footer?”footer?: RowSpec[];The footer rows, kept with the last body row.
frame?
Section titled “frame?”frame?: RuleSpec | null;A rule around the table.
header?
Section titled “header?”header?: RowSpec[];The header rows, repeated on each page the table runs onto.
headerBackground?
Section titled “headerBackground?”headerBackground?: string | null;The header rows’ background, as #rrggbb.
headerRule?
Section titled “headerRule?”headerRule?: RuleSpec | null;A rule under the header.
padding?
Section titled “padding?”padding?: number | null;Points of space inside each cell.
rowRules?
Section titled “rowRules?”rowRules?: RuleSpec | null;A rule between body rows.
rows?: RowSpec[];The body rows; a row is never split between pages.
spaceAfter?
Section titled “spaceAfter?”spaceAfter?: number | null;Points of space below the table.
spaceBefore?
Section titled “spaceBefore?”spaceBefore?: number | null;Points of space above the table.
type: "table";Type Literal
Section titled “Type Literal”{ indent?: number | null; levels?: number | null; style?: string | null; type: "contents";}indent?
Section titled “indent?”indent?: number | null;Points each level below the first is indented.
levels?
Section titled “levels?”levels?: number | null;The deepest heading level it lists, 1 to 6 (2 when left out).
style?
Section titled “style?”style?: string | null;The entries’ style (body when left out).
type: "contents";Type Literal
Section titled “Type Literal”{ blocks: BlockSpec[]; type: "quote";}blocks
Section titled “blocks”blocks: BlockSpec[];The blocks.
type: "quote";Type Literal
Section titled “Type Literal”{ style?: string | null; text: Text; type: "codeBlock";}style?
Section titled “style?”style?: string | null;Its style (body when left out).
text: Text;The code.
type: "codeBlock";Type Literal
Section titled “Type Literal”{ type: "rule";}0.2.0