Skip to content

Instantly share code, notes, and snippets.

@cabe56
Created May 23, 2021 20:34
Show Gist options
  • Save cabe56/558f338123b224a1633d0dcbd22f40a5 to your computer and use it in GitHub Desktop.
Save cabe56/558f338123b224a1633d0dcbd22f40a5 to your computer and use it in GitHub Desktop.
Notion's block type
// 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