Skip to content

Commit

Permalink
feat: add table block support (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
saltbo authored Jan 31, 2022
1 parent 97f740c commit 63149ba
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type Block struct {
Breadcrumb *Breadcrumb `json:"breadcrumb,omitempty"`
ColumnList *ColumnList `json:"column_list,omitempty"`
Column *Column `json:"column,omitempty"`
Table *Table `json:"table,omitempty"`
TableRow *TableRow `json:"table_row,omitempty"`
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
LinkToPage *LinkToPage `json:"link_to_page,omitempty"`
SyncedBlock *SyncedBlock `json:"synced_block,omitempty"`
Expand Down Expand Up @@ -104,6 +106,17 @@ type Column struct {
Children []Block `json:"children,omitempty"`
}

type Table struct {
TableWidth int `json:"table_width"`
HasColumnHeader bool `json:"has_column_header"`
HasRowHeader bool `json:"has_row_header"`
Children []Block `json:"children,omitempty"`
}

type TableRow struct {
Cells [][]RichText `json:"cells"`
}

type LinkToPage struct {
Type LinkToPageType `json:"type"`

Expand Down Expand Up @@ -166,6 +179,8 @@ const (
BlockTypeBreadCrumb BlockType = "breadcrumb"
BlockTypeColumnList BlockType = "column_list"
BlockTypeColumn BlockType = "column"
BlockTypeTable BlockType = "table"
BlockTypeTableRow BlockType = "table_row"
BlockTypeLinkPreview BlockType = "link_preview"
BlockTypeLinkToPage BlockType = "link_to_page"
BlockTypeSyncedBlock BlockType = "synced_block"
Expand Down

0 comments on commit 63149ba

Please sign in to comment.