Created
May 23, 2021 20:34
-
-
Save cabe56/558f338123b224a1633d0dcbd22f40a5 to your computer and use it in GitHub Desktop.
Notion's block type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.notion.so/blog/data-model-behind-notion | |
enum BlockType { | |
Heading, | |
Callout, | |
Toggle, | |
Text, | |
Image, | |
OrderedList, | |
TodoList, | |
TodoItem, | |
Page, | |
Database, | |
DatabaseRow | |
} | |
type Block = { | |
id: string; | |
type: BlockType; | |
// How can properties and content be type checked depending on `type`? | |
properties: object; | |
content: string[]; | |
parent: string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment