/
index.d.ts
194 lines (162 loc) · 3.65 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import * as Notion from "notionapi-agent/dist/interfaces"
import { SemanticString } from "./SemanticString"
import { Emoji, PublicUrl, URI, UUID, TimestampNumber } from "./util"
interface Parent<T> {
children: T[]
}
export as namespace NAST
export interface Block extends Parent<Block> {
uri: URI
type: string
color?: string
createdTime: TimestampNumber
lastEditedTime: TimestampNumber
}
export interface Page extends Block {
type: "page"
title: SemanticString[]
icon?: Emoji | PublicUrl
cover?: PublicUrl
fullWidth: boolean
coverPosition: number
properties?: {
[key: string]: SemanticString[]
}
}
export interface Text extends Block {
type: "text"
title: SemanticString[]
}
export interface ToDo extends Block {
type: "to_do"
title: SemanticString[]
checked: boolean
}
export interface Heading extends Block {
type: "heading"
title: SemanticString[]
depth: number
}
export interface BulletedList extends Block {
type: "bulleted_list"
title: SemanticString[]
}
export interface NumberedList extends Block {
type: "numbered_list"
title: SemanticString[]
}
export interface Toggle extends Block {
type: "toggle"
title: SemanticString[]
}
export interface Quote extends Block {
type: "quote"
title: SemanticString[]
}
export interface Divider extends Block {
type: "divider"
}
export interface Callout extends Block {
type: "callout"
icon?: Emoji | PublicUrl
title: SemanticString[]
}
/**
* Visual content container.
*
* If `width`, `height`, or `aspectRatio` is -1,
* it can be decided by the renderer.
*/
export interface Visual extends Block {
type: "embed" | "pdf" | "image" | "video"
source: PublicUrl
caption?: SemanticString[]
width: number
height: number
fullWidth: boolean
pageWidth: boolean
aspectRatio: number
preserveScale: boolean
}
export interface Embed extends Visual {
type: "embed"
}
export interface PDF extends Visual {
type: "pdf"
}
export interface Image extends Visual {
type: "image"
}
export interface Video extends Visual {
type: "video"
}
export interface Audio extends Block {
type: "audio"
source: PublicUrl
}
export interface Bookmark extends Block {
type: "bookmark"
link: PublicUrl
title?: string
description?: string
icon?: string
cover?: string
}
export interface Code extends Block {
type: "code"
title: SemanticString[]
language?: string
wrap: boolean
}
export interface Equation extends Block {
type: "equation"
latex: string
}
/** A kind of helper for parallel layout. */
export interface ColumnList extends Block {
type: "column_list"
children: Column[]
}
/** A kind of helper for parallel layout. */
export interface Column extends Block {
type: "column"
ratio: number
}
/**
* Collection is experimental, containing many Notion-specific stuffs.
*/
export interface Collection extends Block {
type: "collection_inline" | "collection_page"
name: SemanticString[]
collectionId: UUID
defaultViewId: UUID
views: Notion.CollectionView[]
schema: Notion.Collection.Schema
children: Page[]
}
export interface CollectionInline extends Collection {
type: "collection_inline"
}
export interface CollectionPage extends Collection {
type: "collection_page"
icon?: Emoji | PublicUrl
cover?: PublicUrl
description?: SemanticString[]
coverPosition: number
}
export interface TableOfContents extends Block {
type: "table_of_contents"
}
export interface BreadCrumb extends Block {
type: "breadcrumb"
}
/** `fileId` is Notion-specific. */
export interface File extends Block {
type: "file"
fileId?: UUID
title: string
size?: string
source: string
}
export * from "./SemanticString"
export * from "./util"