diff --git a/block.go b/block.go index e02a73d..d7f7544 100644 --- a/block.go +++ b/block.go @@ -242,6 +242,27 @@ type Quote struct { Children Blocks `json:"children,omitempty"` } +type TableBlock struct { + BasicBlock + Table Table `json:"table"` +} + +type Table struct { + TableWidth int `json:"table_width"` + HasColumnHeader bool `json:"has_column_header"` + HasRowHeader bool `json:"has_row_header"` + Children Blocks `json:"children,omitempty"` +} + +type TableRowBlock struct { + BasicBlock + TableRow TableRow `json:"table_row"` +} + +type TableRow struct { + Cells [][]RichText `json:"cells"` +} + type BulletedListItemBlock struct { BasicBlock BulletedListItem ListItem `json:"bulleted_list_item"` @@ -582,6 +603,10 @@ func decodeBlock(raw map[string]interface{}) (Block, error) { b = &TemplateBlock{} case BlockTypeSyncedBlock: b = &SyncedBlock{} + case BlockTypeTableBlock: + b = &TableBlock{} + case BlockTypeTableRowBlock: + b = &TableRowBlock{} case BlockTypeUnsupported: b = &UnsupportedBlock{} diff --git a/const.go b/const.go index 7e820e8..2a5692b 100644 --- a/const.go +++ b/const.go @@ -208,6 +208,8 @@ const ( BlockTypeLinkToPage BlockType = "link_to_page" BlockTypeTemplate BlockType = "template" BlockTypeSyncedBlock BlockType = "synced_block" + BlockTypeTableBlock BlockType = "table" + BlockTypeTableRowBlock BlockType = "table_row" BlockTypeUnsupported BlockType = "unsupported" )