notionic 0.0.0-stage → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +135 -0
- package/LICENSE +21 -0
- package/README.md +261 -2
- package/dist/fetch.d.ts +62 -0
- package/dist/fetch.js +259 -0
- package/dist/files-DIc0m6LM.js +104 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.js +1266 -0
- package/dist/markdown.d.ts +15 -0
- package/dist/markdown.js +162 -0
- package/dist/page-BmeweSIt.js +27 -0
- package/dist/styles.css +108 -0
- package/dist/types-DOxr5KpT.d.ts +1305 -0
- package/dist/utils-BL_oAR33.js +18 -0
- package/package.json +73 -4
|
@@ -0,0 +1,1305 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from "react";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@notionhq+client@5.27.1/node_modules/@notionhq/client/build/src/api-endpoints/common.d.ts
|
|
3
|
+
type AgentIdParentForBlockBasedObjectResponse = {
|
|
4
|
+
type: "agent_id";
|
|
5
|
+
agent_id: IdResponse;
|
|
6
|
+
};
|
|
7
|
+
type AnnotationResponse = {
|
|
8
|
+
bold: boolean;
|
|
9
|
+
italic: boolean;
|
|
10
|
+
strikethrough: boolean;
|
|
11
|
+
underline: boolean;
|
|
12
|
+
code: boolean;
|
|
13
|
+
color: ApiColor;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,
|
|
17
|
+
* `pink`, `red`, `default_background`, `gray_background`, `brown_background`,
|
|
18
|
+
* `orange_background`, `yellow_background`, `green_background`, `blue_background`,
|
|
19
|
+
* `purple_background`, `pink_background`, `red_background`
|
|
20
|
+
*/
|
|
21
|
+
type ApiColor = "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red" | "default_background" | "gray_background" | "brown_background" | "orange_background" | "yellow_background" | "green_background" | "blue_background" | "purple_background" | "pink_background" | "red_background";
|
|
22
|
+
type BlockIdParentForBlockBasedObjectResponse = {
|
|
23
|
+
type: "block_id";
|
|
24
|
+
block_id: IdResponse;
|
|
25
|
+
};
|
|
26
|
+
type BotInfoResponse = {
|
|
27
|
+
owner: {
|
|
28
|
+
type: "user";
|
|
29
|
+
user: {
|
|
30
|
+
id: IdResponse;
|
|
31
|
+
object: "user";
|
|
32
|
+
name: string | null;
|
|
33
|
+
avatar_url: string | null;
|
|
34
|
+
type: "person";
|
|
35
|
+
person: {
|
|
36
|
+
email?: string;
|
|
37
|
+
};
|
|
38
|
+
} | PartialUserObjectResponse;
|
|
39
|
+
} | {
|
|
40
|
+
type: "workspace";
|
|
41
|
+
workspace: true;
|
|
42
|
+
};
|
|
43
|
+
workspace_id: string;
|
|
44
|
+
workspace_limits: {
|
|
45
|
+
max_file_upload_size_in_bytes: number;
|
|
46
|
+
};
|
|
47
|
+
workspace_name: string | null;
|
|
48
|
+
};
|
|
49
|
+
type BotUserObjectResponse = {
|
|
50
|
+
type: "bot";
|
|
51
|
+
bot: EmptyObject | BotInfoResponse;
|
|
52
|
+
};
|
|
53
|
+
type CustomEmojiPageIconResponse = {
|
|
54
|
+
type: "custom_emoji";
|
|
55
|
+
custom_emoji: CustomEmojiResponse;
|
|
56
|
+
};
|
|
57
|
+
type CustomEmojiResponse = {
|
|
58
|
+
id: IdResponse;
|
|
59
|
+
name: string;
|
|
60
|
+
url: string;
|
|
61
|
+
};
|
|
62
|
+
type DataSourceParentResponse = {
|
|
63
|
+
type: "data_source_id";
|
|
64
|
+
data_source_id: IdResponse;
|
|
65
|
+
database_id: IdResponse;
|
|
66
|
+
};
|
|
67
|
+
type DatabaseParentResponse = {
|
|
68
|
+
type: "database_id";
|
|
69
|
+
database_id: IdResponse;
|
|
70
|
+
};
|
|
71
|
+
type DateResponse = {
|
|
72
|
+
start: string;
|
|
73
|
+
end: string | null;
|
|
74
|
+
time_zone: TimeZoneRequest | null;
|
|
75
|
+
};
|
|
76
|
+
type EmojiPageIconResponse = {
|
|
77
|
+
type: "emoji";
|
|
78
|
+
emoji: EmojiRequest;
|
|
79
|
+
};
|
|
80
|
+
type EmojiRequest = string;
|
|
81
|
+
type EmptyObject = Record<string, never>;
|
|
82
|
+
type EquationRichTextItemResponse = {
|
|
83
|
+
type: "equation";
|
|
84
|
+
equation: {
|
|
85
|
+
expression: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
type ExternalPageCoverResponse = {
|
|
89
|
+
type: "external";
|
|
90
|
+
external: {
|
|
91
|
+
url: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
type ExternalPageIconResponse = {
|
|
95
|
+
type: "external";
|
|
96
|
+
external: {
|
|
97
|
+
url: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
type FilePageCoverResponse = {
|
|
101
|
+
type: "file";
|
|
102
|
+
file: InternalFileResponse;
|
|
103
|
+
};
|
|
104
|
+
type FilePageIconResponse = {
|
|
105
|
+
type: "file";
|
|
106
|
+
file: InternalFileResponse;
|
|
107
|
+
};
|
|
108
|
+
type GroupObjectResponse = {
|
|
109
|
+
id: IdResponse;
|
|
110
|
+
object: "group";
|
|
111
|
+
name: string | null;
|
|
112
|
+
};
|
|
113
|
+
type IconPageIconResponse = {
|
|
114
|
+
type: "icon";
|
|
115
|
+
icon: NoticonIconResponse;
|
|
116
|
+
};
|
|
117
|
+
type IdRequest = string;
|
|
118
|
+
type IdResponse = string;
|
|
119
|
+
type InternalFileResponse = {
|
|
120
|
+
url: string;
|
|
121
|
+
expiry_time: string;
|
|
122
|
+
};
|
|
123
|
+
type LinkMentionResponse = {
|
|
124
|
+
href: string;
|
|
125
|
+
title?: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
link_author?: string;
|
|
128
|
+
link_provider?: string;
|
|
129
|
+
thumbnail_url?: string;
|
|
130
|
+
icon_url?: string;
|
|
131
|
+
iframe_url?: string;
|
|
132
|
+
height?: number;
|
|
133
|
+
padding?: number;
|
|
134
|
+
padding_top?: number;
|
|
135
|
+
};
|
|
136
|
+
type LinkPreviewMentionResponse = {
|
|
137
|
+
url: string;
|
|
138
|
+
};
|
|
139
|
+
type MentionRichTextItemResponse = {
|
|
140
|
+
type: "mention";
|
|
141
|
+
mention: {
|
|
142
|
+
type: "user";
|
|
143
|
+
user: UserValueResponse;
|
|
144
|
+
} | {
|
|
145
|
+
type: "date";
|
|
146
|
+
date: DateResponse;
|
|
147
|
+
} | {
|
|
148
|
+
type: "link_preview";
|
|
149
|
+
link_preview: LinkPreviewMentionResponse;
|
|
150
|
+
} | {
|
|
151
|
+
type: "link_mention";
|
|
152
|
+
link_mention: LinkMentionResponse;
|
|
153
|
+
} | {
|
|
154
|
+
type: "page";
|
|
155
|
+
page: {
|
|
156
|
+
id: IdResponse;
|
|
157
|
+
};
|
|
158
|
+
} | {
|
|
159
|
+
type: "database";
|
|
160
|
+
database: {
|
|
161
|
+
id: IdResponse;
|
|
162
|
+
};
|
|
163
|
+
} | {
|
|
164
|
+
type: "template_mention";
|
|
165
|
+
template_mention: TemplateMentionResponse;
|
|
166
|
+
} | {
|
|
167
|
+
type: "custom_emoji";
|
|
168
|
+
custom_emoji: CustomEmojiResponse;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* One of: `gray`, `lightgray`, `brown`, `yellow`, `orange`, `green`, `blue`, `purple`,
|
|
173
|
+
* `pink`, `red`
|
|
174
|
+
*/
|
|
175
|
+
type NoticonColor = "gray" | "lightgray" | "brown" | "yellow" | "orange" | "green" | "blue" | "purple" | "pink" | "red";
|
|
176
|
+
type NoticonIconResponse = {
|
|
177
|
+
name: NoticonName;
|
|
178
|
+
color: NoticonColor;
|
|
179
|
+
};
|
|
180
|
+
type NoticonName = string;
|
|
181
|
+
type PageCoverResponse = FilePageCoverResponse | ExternalPageCoverResponse;
|
|
182
|
+
type PageIconResponse = EmojiPageIconResponse | FilePageIconResponse | ExternalPageIconResponse | CustomEmojiPageIconResponse | IconPageIconResponse;
|
|
183
|
+
type PageIdParentForBlockBasedObjectResponse = {
|
|
184
|
+
type: "page_id";
|
|
185
|
+
page_id: IdResponse;
|
|
186
|
+
};
|
|
187
|
+
type ParentForBlockBasedObjectResponse = DatabaseParentResponse | DataSourceParentResponse | PageIdParentForBlockBasedObjectResponse | BlockIdParentForBlockBasedObjectResponse | AgentIdParentForBlockBasedObjectResponse | WorkspaceParentForBlockBasedObjectResponse;
|
|
188
|
+
type PartialUserObjectResponse = {
|
|
189
|
+
id: IdResponse;
|
|
190
|
+
object: "user";
|
|
191
|
+
};
|
|
192
|
+
type PersonUserObjectResponse = {
|
|
193
|
+
type: "person";
|
|
194
|
+
person: {
|
|
195
|
+
email?: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
type RichTextItemResponse = RichTextItemResponseCommon & (TextRichTextItemResponse | MentionRichTextItemResponse | EquationRichTextItemResponse);
|
|
199
|
+
type RichTextItemResponseCommon = {
|
|
200
|
+
plain_text: string;
|
|
201
|
+
href: string | null;
|
|
202
|
+
annotations: AnnotationResponse;
|
|
203
|
+
};
|
|
204
|
+
type RollupFunction = "count" | "count_values" | "empty" | "not_empty" | "unique" | "show_unique" | "percent_empty" | "percent_not_empty" | "sum" | "average" | "median" | "min" | "max" | "range" | "earliest_date" | "latest_date" | "date_range" | "checked" | "unchecked" | "percent_checked" | "percent_unchecked" | "count_per_group" | "percent_per_group" | "show_original";
|
|
205
|
+
type TemplateMentionDateTemplateMentionResponse = {
|
|
206
|
+
type: "template_mention_date";
|
|
207
|
+
template_mention_date: "today" | "now";
|
|
208
|
+
};
|
|
209
|
+
type TemplateMentionResponse = TemplateMentionDateTemplateMentionResponse | TemplateMentionUserTemplateMentionResponse;
|
|
210
|
+
type TemplateMentionUserTemplateMentionResponse = {
|
|
211
|
+
type: "template_mention_user";
|
|
212
|
+
template_mention_user: "me";
|
|
213
|
+
};
|
|
214
|
+
type TextRichTextItemResponse = {
|
|
215
|
+
type: "text";
|
|
216
|
+
text: {
|
|
217
|
+
content: string;
|
|
218
|
+
link: {
|
|
219
|
+
url: string;
|
|
220
|
+
} | null;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
type TimeZoneRequest = string;
|
|
224
|
+
type UserObjectResponse = UserObjectResponseCommon & (PersonUserObjectResponse | BotUserObjectResponse);
|
|
225
|
+
type UserObjectResponseCommon = {
|
|
226
|
+
id: IdResponse;
|
|
227
|
+
object: "user";
|
|
228
|
+
name: string | null;
|
|
229
|
+
avatar_url: string | null;
|
|
230
|
+
};
|
|
231
|
+
type UserValueResponse = PartialUserObjectResponse | UserObjectResponse;
|
|
232
|
+
type WorkspaceParentForBlockBasedObjectResponse = {
|
|
233
|
+
type: "workspace";
|
|
234
|
+
workspace: true;
|
|
235
|
+
};
|
|
236
|
+
type TextRequest = string;
|
|
237
|
+
type PartialPageObjectResponse = {
|
|
238
|
+
object: "page";
|
|
239
|
+
id: IdResponse;
|
|
240
|
+
};
|
|
241
|
+
type PageObjectResponse = {
|
|
242
|
+
object: "page";
|
|
243
|
+
id: IdResponse;
|
|
244
|
+
created_time: string;
|
|
245
|
+
last_edited_time: string;
|
|
246
|
+
in_trash: boolean;
|
|
247
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
248
|
+
archived: boolean;
|
|
249
|
+
is_archived: boolean;
|
|
250
|
+
is_locked: boolean;
|
|
251
|
+
url: string;
|
|
252
|
+
public_url: string | null;
|
|
253
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
254
|
+
properties: Record<string, PagePropertyValueWithIdResponse>;
|
|
255
|
+
icon: PageIconResponse | null;
|
|
256
|
+
cover: PageCoverResponse | null;
|
|
257
|
+
created_by: PartialUserObjectResponse;
|
|
258
|
+
last_edited_by: PartialUserObjectResponse;
|
|
259
|
+
};
|
|
260
|
+
type LanguageRequest = "abap" | "abc" | "agda" | "arduino" | "ascii art" | "assembly" | "bash" | "basic" | "bnf" | "c" | "c#" | "c++" | "clojure" | "coffeescript" | "coq" | "css" | "dart" | "dhall" | "diff" | "docker" | "ebnf" | "elixir" | "elm" | "erlang" | "f#" | "flow" | "fortran" | "gherkin" | "glsl" | "go" | "graphql" | "groovy" | "haskell" | "hcl" | "html" | "idris" | "java" | "javascript" | "json" | "julia" | "kotlin" | "latex" | "less" | "lisp" | "livescript" | "llvm ir" | "lua" | "makefile" | "markdown" | "markup" | "matlab" | "mathematica" | "mermaid" | "nix" | "notion formula" | "objective-c" | "ocaml" | "pascal" | "perl" | "php" | "plain text" | "powershell" | "prolog" | "protobuf" | "purescript" | "python" | "r" | "racket" | "reason" | "ruby" | "rust" | "sass" | "scala" | "scheme" | "scss" | "shell" | "smalltalk" | "solidity" | "sql" | "swift" | "toml" | "typescript" | "vb.net" | "verilog" | "vhdl" | "visual basic" | "webassembly" | "xml" | "yaml" | "java/c/c++/c#";
|
|
261
|
+
type PagePropertyValueWithIdResponse = IdObjectResponse & (SimpleOrArrayPropertyValueResponse | PartialRollupPropertyResponse);
|
|
262
|
+
type IdObjectResponse = {
|
|
263
|
+
id: string;
|
|
264
|
+
};
|
|
265
|
+
type PartialRollupPropertyResponse = {
|
|
266
|
+
type: "rollup";
|
|
267
|
+
rollup: PartialRollupValueResponse;
|
|
268
|
+
};
|
|
269
|
+
type SimpleOrArrayPropertyValueResponse = SimplePropertyValueResponse | ArrayBasedPropertyValueResponse;
|
|
270
|
+
type ArrayBasedPropertyValueResponse = TitleArrayBasedPropertyValueResponse | RichTextArrayBasedPropertyValueResponse | PeopleArrayBasedPropertyValueResponse | RelationArrayBasedPropertyValueResponse;
|
|
271
|
+
type PartialRollupValueResponse = PartialRollupValueResponseCommon & (NumberPartialRollupValueResponse | DatePartialRollupValueResponse | ArrayPartialRollupValueResponse | UnsupportedPartialRollupValueResponse);
|
|
272
|
+
type SimplePropertyValueResponse = NumberSimplePropertyValueResponse | UrlSimplePropertyValueResponse | SelectSimplePropertyValueResponse | MultiSelectSimplePropertyValueResponse | StatusSimplePropertyValueResponse | DateSimplePropertyValueResponse | EmailSimplePropertyValueResponse | PhoneNumberSimplePropertyValueResponse | CheckboxSimplePropertyValueResponse | FilesSimplePropertyValueResponse | CreatedBySimplePropertyValueResponse | CreatedTimeSimplePropertyValueResponse | LastEditedBySimplePropertyValueResponse | LastEditedTimeSimplePropertyValueResponse | FormulaSimplePropertyValueResponse | ButtonSimplePropertyValueResponse | UniqueIdSimplePropertyValueResponse | VerificationSimplePropertyValueResponse | PlaceSimplePropertyValueResponse;
|
|
273
|
+
type ArrayPartialRollupValueResponse = {
|
|
274
|
+
type: "array";
|
|
275
|
+
array: Array<SimpleOrArrayPropertyValueResponse>;
|
|
276
|
+
};
|
|
277
|
+
type ButtonSimplePropertyValueResponse = {
|
|
278
|
+
type: "button";
|
|
279
|
+
button: EmptyObject;
|
|
280
|
+
};
|
|
281
|
+
type CheckboxSimplePropertyValueResponse = {
|
|
282
|
+
type: "checkbox";
|
|
283
|
+
checkbox: boolean;
|
|
284
|
+
};
|
|
285
|
+
type CreatedBySimplePropertyValueResponse = {
|
|
286
|
+
type: "created_by";
|
|
287
|
+
created_by: UserValueResponse;
|
|
288
|
+
};
|
|
289
|
+
type CreatedTimeSimplePropertyValueResponse = {
|
|
290
|
+
type: "created_time";
|
|
291
|
+
created_time: string;
|
|
292
|
+
};
|
|
293
|
+
type DatePartialRollupValueResponse = {
|
|
294
|
+
type: "date";
|
|
295
|
+
date: DateResponse | null;
|
|
296
|
+
};
|
|
297
|
+
type DateSimplePropertyValueResponse = {
|
|
298
|
+
type: "date";
|
|
299
|
+
date: DateResponse | null;
|
|
300
|
+
};
|
|
301
|
+
type EmailSimplePropertyValueResponse = {
|
|
302
|
+
type: "email";
|
|
303
|
+
email: string | null;
|
|
304
|
+
};
|
|
305
|
+
type FilesSimplePropertyValueResponse = {
|
|
306
|
+
type: "files";
|
|
307
|
+
files: Array<InternalOrExternalFileWithNameResponse>;
|
|
308
|
+
};
|
|
309
|
+
type FormulaSimplePropertyValueResponse = {
|
|
310
|
+
type: "formula";
|
|
311
|
+
formula: FormulaPropertyValueResponse;
|
|
312
|
+
};
|
|
313
|
+
type LastEditedBySimplePropertyValueResponse = {
|
|
314
|
+
type: "last_edited_by";
|
|
315
|
+
last_edited_by: UserValueResponse;
|
|
316
|
+
};
|
|
317
|
+
type LastEditedTimeSimplePropertyValueResponse = {
|
|
318
|
+
type: "last_edited_time";
|
|
319
|
+
last_edited_time: string;
|
|
320
|
+
};
|
|
321
|
+
type MultiSelectSimplePropertyValueResponse = {
|
|
322
|
+
type: "multi_select";
|
|
323
|
+
multi_select: Array<PartialSelectPropertyValueResponse>;
|
|
324
|
+
};
|
|
325
|
+
type NumberPartialRollupValueResponse = {
|
|
326
|
+
type: "number";
|
|
327
|
+
number: number | null;
|
|
328
|
+
};
|
|
329
|
+
type NumberSimplePropertyValueResponse = {
|
|
330
|
+
type: "number";
|
|
331
|
+
number: number | null;
|
|
332
|
+
};
|
|
333
|
+
type PartialRollupValueResponseCommon = {
|
|
334
|
+
function: RollupFunction;
|
|
335
|
+
};
|
|
336
|
+
type PeopleArrayBasedPropertyValueResponse = {
|
|
337
|
+
type: "people";
|
|
338
|
+
people: Array<UserValueResponse | GroupObjectResponse>;
|
|
339
|
+
};
|
|
340
|
+
type PhoneNumberSimplePropertyValueResponse = {
|
|
341
|
+
type: "phone_number";
|
|
342
|
+
phone_number: string | null;
|
|
343
|
+
};
|
|
344
|
+
type PlaceSimplePropertyValueResponse = {
|
|
345
|
+
type: "place";
|
|
346
|
+
place: PlacePropertyValueResponse | null;
|
|
347
|
+
};
|
|
348
|
+
type RelationArrayBasedPropertyValueResponse = {
|
|
349
|
+
type: "relation";
|
|
350
|
+
relation: Array<RelationItemPropertyValueResponse>;
|
|
351
|
+
};
|
|
352
|
+
type RichTextArrayBasedPropertyValueResponse = {
|
|
353
|
+
type: "rich_text";
|
|
354
|
+
rich_text: Array<RichTextItemResponse>;
|
|
355
|
+
};
|
|
356
|
+
type SelectSimplePropertyValueResponse = {
|
|
357
|
+
type: "select";
|
|
358
|
+
select: PartialSelectPropertyValueResponse | null;
|
|
359
|
+
};
|
|
360
|
+
type StatusSimplePropertyValueResponse = {
|
|
361
|
+
type: "status";
|
|
362
|
+
status: PartialSelectPropertyValueResponse | null;
|
|
363
|
+
};
|
|
364
|
+
type TitleArrayBasedPropertyValueResponse = {
|
|
365
|
+
type: "title";
|
|
366
|
+
title: Array<RichTextItemResponse>;
|
|
367
|
+
};
|
|
368
|
+
type UniqueIdSimplePropertyValueResponse = {
|
|
369
|
+
type: "unique_id";
|
|
370
|
+
unique_id: UniqueIdPropertyValueResponse;
|
|
371
|
+
};
|
|
372
|
+
type UnsupportedPartialRollupValueResponse = {
|
|
373
|
+
type: "unsupported";
|
|
374
|
+
unsupported: EmptyObject;
|
|
375
|
+
};
|
|
376
|
+
type UrlSimplePropertyValueResponse = {
|
|
377
|
+
type: "url";
|
|
378
|
+
url: string | null;
|
|
379
|
+
};
|
|
380
|
+
type VerificationSimplePropertyValueResponse = {
|
|
381
|
+
type: "verification";
|
|
382
|
+
verification: VerificationPropertyValueResponse | null;
|
|
383
|
+
};
|
|
384
|
+
type FormulaPropertyValueResponse = BooleanFormulaPropertyValueResponse | DateFormulaPropertyValueResponse | NumberFormulaPropertyValueResponse | StringFormulaPropertyValueResponse | UnsupportedFormulaPropertyValueResponse;
|
|
385
|
+
type InternalOrExternalFileWithNameResponse = InternalOrExternalFileWithNameResponseCommon & (FileInternalOrExternalFileWithNameResponse | ExternalInternalOrExternalFileWithNameResponse);
|
|
386
|
+
type PartialSelectPropertyValueResponse = {
|
|
387
|
+
id: string;
|
|
388
|
+
name: string;
|
|
389
|
+
color: "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
|
|
390
|
+
};
|
|
391
|
+
type PlacePropertyValueResponse = {
|
|
392
|
+
lat: number;
|
|
393
|
+
lon: number;
|
|
394
|
+
name?: string | null;
|
|
395
|
+
address?: string | null;
|
|
396
|
+
aws_place_id?: string | null;
|
|
397
|
+
google_place_id?: string | null;
|
|
398
|
+
};
|
|
399
|
+
type RelationItemPropertyValueResponse = {
|
|
400
|
+
id: IdRequest;
|
|
401
|
+
};
|
|
402
|
+
type UniqueIdPropertyValueResponse = {
|
|
403
|
+
prefix: string | null;
|
|
404
|
+
number: number | null;
|
|
405
|
+
};
|
|
406
|
+
type VerificationPropertyValueResponse = VerificationPropertyUnverifiedResponse | VerificationPropertyResponse;
|
|
407
|
+
type BooleanFormulaPropertyValueResponse = {
|
|
408
|
+
type: "boolean";
|
|
409
|
+
boolean: boolean | null;
|
|
410
|
+
};
|
|
411
|
+
type DateFormulaPropertyValueResponse = {
|
|
412
|
+
type: "date";
|
|
413
|
+
date: DateResponse | null;
|
|
414
|
+
};
|
|
415
|
+
type ExternalInternalOrExternalFileWithNameResponse = {
|
|
416
|
+
type: "external";
|
|
417
|
+
external: {
|
|
418
|
+
url: string;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
type FileInternalOrExternalFileWithNameResponse = {
|
|
422
|
+
type: "file";
|
|
423
|
+
file: InternalFileResponse;
|
|
424
|
+
};
|
|
425
|
+
type InternalOrExternalFileWithNameResponseCommon = {
|
|
426
|
+
name: string;
|
|
427
|
+
};
|
|
428
|
+
type NumberFormulaPropertyValueResponse = {
|
|
429
|
+
type: "number";
|
|
430
|
+
number: number | null;
|
|
431
|
+
};
|
|
432
|
+
type StringFormulaPropertyValueResponse = {
|
|
433
|
+
type: "string";
|
|
434
|
+
string: string | null;
|
|
435
|
+
};
|
|
436
|
+
type UnsupportedFormulaPropertyValueResponse = {
|
|
437
|
+
type: "unsupported";
|
|
438
|
+
unsupported: EmptyObject;
|
|
439
|
+
};
|
|
440
|
+
type VerificationPropertyResponse = {
|
|
441
|
+
state: "verified" | "expired";
|
|
442
|
+
date: DateResponse | null;
|
|
443
|
+
verified_by: UserValueResponse | null;
|
|
444
|
+
};
|
|
445
|
+
type VerificationPropertyUnverifiedResponse = {
|
|
446
|
+
state: "unverified";
|
|
447
|
+
date: null;
|
|
448
|
+
verified_by: null;
|
|
449
|
+
};
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region ../../node_modules/.pnpm/@notionhq+client@5.27.1/node_modules/@notionhq/client/build/src/api-endpoints/blocks.d.ts
|
|
452
|
+
type ApiTranscriptionStatus = "transcription_not_started" | "transcription_paused" | "transcription_in_progress" | "summary_in_progress" | "notes_ready";
|
|
453
|
+
type AudioBlockObjectResponse = {
|
|
454
|
+
type: "audio";
|
|
455
|
+
audio: MediaContentWithFileAndCaptionResponse;
|
|
456
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
457
|
+
object: "block";
|
|
458
|
+
id: string;
|
|
459
|
+
created_time: string;
|
|
460
|
+
created_by: PartialUserObjectResponse;
|
|
461
|
+
last_edited_time: string;
|
|
462
|
+
last_edited_by: PartialUserObjectResponse;
|
|
463
|
+
has_children: boolean;
|
|
464
|
+
in_trash: boolean;
|
|
465
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
466
|
+
archived: boolean;
|
|
467
|
+
};
|
|
468
|
+
type BlockObjectResponse = ParagraphBlockObjectResponse | Heading1BlockObjectResponse | Heading2BlockObjectResponse | Heading3BlockObjectResponse | Heading4BlockObjectResponse | BulletedListItemBlockObjectResponse | NumberedListItemBlockObjectResponse | QuoteBlockObjectResponse | ToDoBlockObjectResponse | ToggleBlockObjectResponse | TemplateBlockObjectResponse | SyncedBlockBlockObjectResponse | ChildPageBlockObjectResponse | ChildDatabaseBlockObjectResponse | EquationBlockObjectResponse | CodeBlockObjectResponse | CalloutBlockObjectResponse | DividerBlockObjectResponse | BreadcrumbBlockObjectResponse | TableOfContentsBlockObjectResponse | TabBlockObjectResponse | ColumnListBlockObjectResponse | ColumnBlockObjectResponse | LinkToPageBlockObjectResponse | TableBlockObjectResponse | TableRowBlockObjectResponse | MeetingNotesBlockObjectResponse | TranscriptionBlockObjectResponse | EmbedBlockObjectResponse | BookmarkBlockObjectResponse | ImageBlockObjectResponse | VideoBlockObjectResponse | PdfBlockObjectResponse | FileBlockObjectResponse | AudioBlockObjectResponse | LinkPreviewBlockObjectResponse | UnsupportedBlockObjectResponse;
|
|
469
|
+
type BookmarkBlockObjectResponse = {
|
|
470
|
+
type: "bookmark";
|
|
471
|
+
bookmark: MediaContentWithUrlAndCaptionResponse;
|
|
472
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
473
|
+
object: "block";
|
|
474
|
+
id: string;
|
|
475
|
+
created_time: string;
|
|
476
|
+
created_by: PartialUserObjectResponse;
|
|
477
|
+
last_edited_time: string;
|
|
478
|
+
last_edited_by: PartialUserObjectResponse;
|
|
479
|
+
has_children: boolean;
|
|
480
|
+
in_trash: boolean;
|
|
481
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
482
|
+
archived: boolean;
|
|
483
|
+
};
|
|
484
|
+
type BreadcrumbBlockObjectResponse = {
|
|
485
|
+
type: "breadcrumb";
|
|
486
|
+
breadcrumb: EmptyObject;
|
|
487
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
488
|
+
object: "block";
|
|
489
|
+
id: string;
|
|
490
|
+
created_time: string;
|
|
491
|
+
created_by: PartialUserObjectResponse;
|
|
492
|
+
last_edited_time: string;
|
|
493
|
+
last_edited_by: PartialUserObjectResponse;
|
|
494
|
+
has_children: boolean;
|
|
495
|
+
in_trash: boolean;
|
|
496
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
497
|
+
archived: boolean;
|
|
498
|
+
};
|
|
499
|
+
type BulletedListItemBlockObjectResponse = {
|
|
500
|
+
type: "bulleted_list_item";
|
|
501
|
+
bulleted_list_item: ContentWithRichTextAndColorResponse;
|
|
502
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
503
|
+
object: "block";
|
|
504
|
+
id: string;
|
|
505
|
+
created_time: string;
|
|
506
|
+
created_by: PartialUserObjectResponse;
|
|
507
|
+
last_edited_time: string;
|
|
508
|
+
last_edited_by: PartialUserObjectResponse;
|
|
509
|
+
has_children: boolean;
|
|
510
|
+
in_trash: boolean;
|
|
511
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
512
|
+
archived: boolean;
|
|
513
|
+
};
|
|
514
|
+
type CalloutBlockObjectResponse = {
|
|
515
|
+
type: "callout";
|
|
516
|
+
callout: {
|
|
517
|
+
rich_text: Array<RichTextItemResponse>;
|
|
518
|
+
color: ApiColor;
|
|
519
|
+
icon: PageIconResponse | null;
|
|
520
|
+
};
|
|
521
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
522
|
+
object: "block";
|
|
523
|
+
id: string;
|
|
524
|
+
created_time: string;
|
|
525
|
+
created_by: PartialUserObjectResponse;
|
|
526
|
+
last_edited_time: string;
|
|
527
|
+
last_edited_by: PartialUserObjectResponse;
|
|
528
|
+
has_children: boolean;
|
|
529
|
+
in_trash: boolean;
|
|
530
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
531
|
+
archived: boolean;
|
|
532
|
+
};
|
|
533
|
+
type ChildDatabaseBlockObjectResponse = {
|
|
534
|
+
type: "child_database";
|
|
535
|
+
child_database: TitleObjectResponse;
|
|
536
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
537
|
+
object: "block";
|
|
538
|
+
id: string;
|
|
539
|
+
created_time: string;
|
|
540
|
+
created_by: PartialUserObjectResponse;
|
|
541
|
+
last_edited_time: string;
|
|
542
|
+
last_edited_by: PartialUserObjectResponse;
|
|
543
|
+
has_children: boolean;
|
|
544
|
+
in_trash: boolean;
|
|
545
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
546
|
+
archived: boolean;
|
|
547
|
+
};
|
|
548
|
+
type ChildPageBlockObjectResponse = {
|
|
549
|
+
type: "child_page";
|
|
550
|
+
child_page: TitleObjectResponse;
|
|
551
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
552
|
+
object: "block";
|
|
553
|
+
id: string;
|
|
554
|
+
created_time: string;
|
|
555
|
+
created_by: PartialUserObjectResponse;
|
|
556
|
+
last_edited_time: string;
|
|
557
|
+
last_edited_by: PartialUserObjectResponse;
|
|
558
|
+
has_children: boolean;
|
|
559
|
+
in_trash: boolean;
|
|
560
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
561
|
+
archived: boolean;
|
|
562
|
+
};
|
|
563
|
+
type CodeBlockObjectResponse = {
|
|
564
|
+
type: "code";
|
|
565
|
+
code: {
|
|
566
|
+
rich_text: Array<RichTextItemResponse>;
|
|
567
|
+
caption: Array<RichTextItemResponse>;
|
|
568
|
+
language: LanguageRequest;
|
|
569
|
+
};
|
|
570
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
571
|
+
object: "block";
|
|
572
|
+
id: string;
|
|
573
|
+
created_time: string;
|
|
574
|
+
created_by: PartialUserObjectResponse;
|
|
575
|
+
last_edited_time: string;
|
|
576
|
+
last_edited_by: PartialUserObjectResponse;
|
|
577
|
+
has_children: boolean;
|
|
578
|
+
in_trash: boolean;
|
|
579
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
580
|
+
archived: boolean;
|
|
581
|
+
};
|
|
582
|
+
type ColumnBlockObjectResponse = {
|
|
583
|
+
type: "column";
|
|
584
|
+
column: ColumnResponse;
|
|
585
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
586
|
+
object: "block";
|
|
587
|
+
id: string;
|
|
588
|
+
created_time: string;
|
|
589
|
+
created_by: PartialUserObjectResponse;
|
|
590
|
+
last_edited_time: string;
|
|
591
|
+
last_edited_by: PartialUserObjectResponse;
|
|
592
|
+
has_children: boolean;
|
|
593
|
+
in_trash: boolean;
|
|
594
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
595
|
+
archived: boolean;
|
|
596
|
+
};
|
|
597
|
+
type ColumnListBlockObjectResponse = {
|
|
598
|
+
type: "column_list";
|
|
599
|
+
column_list: EmptyObject;
|
|
600
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
601
|
+
object: "block";
|
|
602
|
+
id: string;
|
|
603
|
+
created_time: string;
|
|
604
|
+
created_by: PartialUserObjectResponse;
|
|
605
|
+
last_edited_time: string;
|
|
606
|
+
last_edited_by: PartialUserObjectResponse;
|
|
607
|
+
has_children: boolean;
|
|
608
|
+
in_trash: boolean;
|
|
609
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
610
|
+
archived: boolean;
|
|
611
|
+
};
|
|
612
|
+
type ColumnResponse = {
|
|
613
|
+
width_ratio?: number;
|
|
614
|
+
};
|
|
615
|
+
type ContentWithRichTextAndColorAndListResponse = {
|
|
616
|
+
rich_text: Array<RichTextItemResponse>;
|
|
617
|
+
color: ApiColor;
|
|
618
|
+
list_start_index?: number;
|
|
619
|
+
list_format?: NumberedListFormat;
|
|
620
|
+
};
|
|
621
|
+
type ContentWithRichTextAndColorResponse = {
|
|
622
|
+
rich_text: Array<RichTextItemResponse>;
|
|
623
|
+
color: ApiColor;
|
|
624
|
+
};
|
|
625
|
+
type ContentWithRichTextColorAndIconResponse = {
|
|
626
|
+
rich_text: Array<RichTextItemResponse>;
|
|
627
|
+
color: ApiColor;
|
|
628
|
+
icon: PageIconResponse | null;
|
|
629
|
+
};
|
|
630
|
+
type ContentWithTableResponse = {
|
|
631
|
+
has_column_header: boolean;
|
|
632
|
+
has_row_header: boolean;
|
|
633
|
+
table_width: number;
|
|
634
|
+
};
|
|
635
|
+
type ContentWithTableRowResponse = {
|
|
636
|
+
cells: Array<Array<RichTextItemResponse>>;
|
|
637
|
+
};
|
|
638
|
+
type DividerBlockObjectResponse = {
|
|
639
|
+
type: "divider";
|
|
640
|
+
divider: EmptyObject;
|
|
641
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
642
|
+
object: "block";
|
|
643
|
+
id: string;
|
|
644
|
+
created_time: string;
|
|
645
|
+
created_by: PartialUserObjectResponse;
|
|
646
|
+
last_edited_time: string;
|
|
647
|
+
last_edited_by: PartialUserObjectResponse;
|
|
648
|
+
has_children: boolean;
|
|
649
|
+
in_trash: boolean;
|
|
650
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
651
|
+
archived: boolean;
|
|
652
|
+
};
|
|
653
|
+
type EmbedBlockObjectResponse = {
|
|
654
|
+
type: "embed";
|
|
655
|
+
embed: MediaContentWithUrlAndCaptionResponse;
|
|
656
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
657
|
+
object: "block";
|
|
658
|
+
id: string;
|
|
659
|
+
created_time: string;
|
|
660
|
+
created_by: PartialUserObjectResponse;
|
|
661
|
+
last_edited_time: string;
|
|
662
|
+
last_edited_by: PartialUserObjectResponse;
|
|
663
|
+
has_children: boolean;
|
|
664
|
+
in_trash: boolean;
|
|
665
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
666
|
+
archived: boolean;
|
|
667
|
+
};
|
|
668
|
+
type EquationBlockObjectResponse = {
|
|
669
|
+
type: "equation";
|
|
670
|
+
equation: ExpressionObjectResponse;
|
|
671
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
672
|
+
object: "block";
|
|
673
|
+
id: string;
|
|
674
|
+
created_time: string;
|
|
675
|
+
created_by: PartialUserObjectResponse;
|
|
676
|
+
last_edited_time: string;
|
|
677
|
+
last_edited_by: PartialUserObjectResponse;
|
|
678
|
+
has_children: boolean;
|
|
679
|
+
in_trash: boolean;
|
|
680
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
681
|
+
archived: boolean;
|
|
682
|
+
};
|
|
683
|
+
type ExpressionObjectResponse = {
|
|
684
|
+
expression: string;
|
|
685
|
+
};
|
|
686
|
+
type ExternalMediaContentWithFileAndCaptionResponse = {
|
|
687
|
+
type: "external";
|
|
688
|
+
external: {
|
|
689
|
+
url: TextRequest;
|
|
690
|
+
};
|
|
691
|
+
caption: Array<RichTextItemResponse>;
|
|
692
|
+
};
|
|
693
|
+
type ExternalMediaContentWithFileNameAndCaptionResponse = {
|
|
694
|
+
type: "external";
|
|
695
|
+
external: {
|
|
696
|
+
url: TextRequest;
|
|
697
|
+
};
|
|
698
|
+
caption: Array<RichTextItemResponse>;
|
|
699
|
+
name: string;
|
|
700
|
+
};
|
|
701
|
+
type FileBlockObjectResponse = {
|
|
702
|
+
type: "file";
|
|
703
|
+
file: MediaContentWithFileNameAndCaptionResponse;
|
|
704
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
705
|
+
object: "block";
|
|
706
|
+
id: string;
|
|
707
|
+
created_time: string;
|
|
708
|
+
created_by: PartialUserObjectResponse;
|
|
709
|
+
last_edited_time: string;
|
|
710
|
+
last_edited_by: PartialUserObjectResponse;
|
|
711
|
+
has_children: boolean;
|
|
712
|
+
in_trash: boolean;
|
|
713
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
714
|
+
archived: boolean;
|
|
715
|
+
};
|
|
716
|
+
type FileMediaContentWithFileAndCaptionResponse = {
|
|
717
|
+
type: "file";
|
|
718
|
+
file: InternalFileResponse;
|
|
719
|
+
caption: Array<RichTextItemResponse>;
|
|
720
|
+
};
|
|
721
|
+
type FileMediaContentWithFileNameAndCaptionResponse = {
|
|
722
|
+
type: "file";
|
|
723
|
+
file: InternalFileResponse;
|
|
724
|
+
caption: Array<RichTextItemResponse>;
|
|
725
|
+
name: string;
|
|
726
|
+
};
|
|
727
|
+
type HeaderContentWithRichTextAndColorResponse = {
|
|
728
|
+
rich_text: Array<RichTextItemResponse>;
|
|
729
|
+
color: ApiColor;
|
|
730
|
+
is_toggleable: boolean;
|
|
731
|
+
};
|
|
732
|
+
type Heading1BlockObjectResponse = {
|
|
733
|
+
type: "heading_1";
|
|
734
|
+
heading_1: HeaderContentWithRichTextAndColorResponse;
|
|
735
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
736
|
+
object: "block";
|
|
737
|
+
id: string;
|
|
738
|
+
created_time: string;
|
|
739
|
+
created_by: PartialUserObjectResponse;
|
|
740
|
+
last_edited_time: string;
|
|
741
|
+
last_edited_by: PartialUserObjectResponse;
|
|
742
|
+
has_children: boolean;
|
|
743
|
+
in_trash: boolean;
|
|
744
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
745
|
+
archived: boolean;
|
|
746
|
+
};
|
|
747
|
+
type Heading2BlockObjectResponse = {
|
|
748
|
+
type: "heading_2";
|
|
749
|
+
heading_2: HeaderContentWithRichTextAndColorResponse;
|
|
750
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
751
|
+
object: "block";
|
|
752
|
+
id: string;
|
|
753
|
+
created_time: string;
|
|
754
|
+
created_by: PartialUserObjectResponse;
|
|
755
|
+
last_edited_time: string;
|
|
756
|
+
last_edited_by: PartialUserObjectResponse;
|
|
757
|
+
has_children: boolean;
|
|
758
|
+
in_trash: boolean;
|
|
759
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
760
|
+
archived: boolean;
|
|
761
|
+
};
|
|
762
|
+
type Heading3BlockObjectResponse = {
|
|
763
|
+
type: "heading_3";
|
|
764
|
+
heading_3: HeaderContentWithRichTextAndColorResponse;
|
|
765
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
766
|
+
object: "block";
|
|
767
|
+
id: string;
|
|
768
|
+
created_time: string;
|
|
769
|
+
created_by: PartialUserObjectResponse;
|
|
770
|
+
last_edited_time: string;
|
|
771
|
+
last_edited_by: PartialUserObjectResponse;
|
|
772
|
+
has_children: boolean;
|
|
773
|
+
in_trash: boolean;
|
|
774
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
775
|
+
archived: boolean;
|
|
776
|
+
};
|
|
777
|
+
type Heading4BlockObjectResponse = {
|
|
778
|
+
type: "heading_4";
|
|
779
|
+
heading_4: HeaderContentWithRichTextAndColorResponse;
|
|
780
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
781
|
+
object: "block";
|
|
782
|
+
id: string;
|
|
783
|
+
created_time: string;
|
|
784
|
+
created_by: PartialUserObjectResponse;
|
|
785
|
+
last_edited_time: string;
|
|
786
|
+
last_edited_by: PartialUserObjectResponse;
|
|
787
|
+
has_children: boolean;
|
|
788
|
+
in_trash: boolean;
|
|
789
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
790
|
+
archived: boolean;
|
|
791
|
+
};
|
|
792
|
+
type ImageBlockObjectResponse = {
|
|
793
|
+
type: "image";
|
|
794
|
+
image: MediaContentWithFileAndCaptionResponse;
|
|
795
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
796
|
+
object: "block";
|
|
797
|
+
id: string;
|
|
798
|
+
created_time: string;
|
|
799
|
+
created_by: PartialUserObjectResponse;
|
|
800
|
+
last_edited_time: string;
|
|
801
|
+
last_edited_by: PartialUserObjectResponse;
|
|
802
|
+
has_children: boolean;
|
|
803
|
+
in_trash: boolean;
|
|
804
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
805
|
+
archived: boolean;
|
|
806
|
+
};
|
|
807
|
+
type LinkPreviewBlockObjectResponse = {
|
|
808
|
+
type: "link_preview";
|
|
809
|
+
link_preview: MediaContentWithUrlResponse;
|
|
810
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
811
|
+
object: "block";
|
|
812
|
+
id: string;
|
|
813
|
+
created_time: string;
|
|
814
|
+
created_by: PartialUserObjectResponse;
|
|
815
|
+
last_edited_time: string;
|
|
816
|
+
last_edited_by: PartialUserObjectResponse;
|
|
817
|
+
has_children: boolean;
|
|
818
|
+
in_trash: boolean;
|
|
819
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
820
|
+
archived: boolean;
|
|
821
|
+
};
|
|
822
|
+
type LinkToPageBlockObjectResponse = {
|
|
823
|
+
type: "link_to_page";
|
|
824
|
+
link_to_page: {
|
|
825
|
+
type: "page_id";
|
|
826
|
+
page_id: IdRequest;
|
|
827
|
+
} | {
|
|
828
|
+
type: "database_id";
|
|
829
|
+
database_id: IdRequest;
|
|
830
|
+
} | {
|
|
831
|
+
type: "comment_id";
|
|
832
|
+
comment_id: IdRequest;
|
|
833
|
+
};
|
|
834
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
835
|
+
object: "block";
|
|
836
|
+
id: string;
|
|
837
|
+
created_time: string;
|
|
838
|
+
created_by: PartialUserObjectResponse;
|
|
839
|
+
last_edited_time: string;
|
|
840
|
+
last_edited_by: PartialUserObjectResponse;
|
|
841
|
+
has_children: boolean;
|
|
842
|
+
in_trash: boolean;
|
|
843
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
844
|
+
archived: boolean;
|
|
845
|
+
};
|
|
846
|
+
type MediaContentWithFileAndCaptionResponse = ExternalMediaContentWithFileAndCaptionResponse | FileMediaContentWithFileAndCaptionResponse;
|
|
847
|
+
type MediaContentWithFileNameAndCaptionResponse = ExternalMediaContentWithFileNameAndCaptionResponse | FileMediaContentWithFileNameAndCaptionResponse;
|
|
848
|
+
type MediaContentWithUrlAndCaptionResponse = {
|
|
849
|
+
url: string;
|
|
850
|
+
caption: Array<RichTextItemResponse>;
|
|
851
|
+
};
|
|
852
|
+
type MediaContentWithUrlResponse = {
|
|
853
|
+
url: TextRequest;
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* @deprecated Use MeetingNotesBlockObjectResponse instead. Renamed in API version 2026-03-11.
|
|
857
|
+
*/
|
|
858
|
+
type TranscriptionBlockObjectResponse = {
|
|
859
|
+
type: "transcription";
|
|
860
|
+
transcription: TranscriptionBlockResponse;
|
|
861
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
862
|
+
object: "block";
|
|
863
|
+
id: string;
|
|
864
|
+
created_time: string;
|
|
865
|
+
created_by: PartialUserObjectResponse;
|
|
866
|
+
last_edited_time: string;
|
|
867
|
+
last_edited_by: PartialUserObjectResponse;
|
|
868
|
+
has_children: boolean;
|
|
869
|
+
in_trash: boolean;
|
|
870
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
871
|
+
archived: boolean;
|
|
872
|
+
};
|
|
873
|
+
type MeetingNotesBlockObjectResponse = {
|
|
874
|
+
type: "meeting_notes";
|
|
875
|
+
meeting_notes: TranscriptionBlockResponse;
|
|
876
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
877
|
+
object: "block";
|
|
878
|
+
id: string;
|
|
879
|
+
created_time: string;
|
|
880
|
+
created_by: PartialUserObjectResponse;
|
|
881
|
+
last_edited_time: string;
|
|
882
|
+
last_edited_by: PartialUserObjectResponse;
|
|
883
|
+
has_children: boolean;
|
|
884
|
+
in_trash: boolean;
|
|
885
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
886
|
+
archived: boolean;
|
|
887
|
+
};
|
|
888
|
+
type NumberedListFormat = "numbers" | "letters" | "roman";
|
|
889
|
+
type NumberedListItemBlockObjectResponse = {
|
|
890
|
+
type: "numbered_list_item";
|
|
891
|
+
numbered_list_item: ContentWithRichTextAndColorAndListResponse;
|
|
892
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
893
|
+
object: "block";
|
|
894
|
+
id: string;
|
|
895
|
+
created_time: string;
|
|
896
|
+
created_by: PartialUserObjectResponse;
|
|
897
|
+
last_edited_time: string;
|
|
898
|
+
last_edited_by: PartialUserObjectResponse;
|
|
899
|
+
has_children: boolean;
|
|
900
|
+
in_trash: boolean;
|
|
901
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
902
|
+
archived: boolean;
|
|
903
|
+
};
|
|
904
|
+
type ParagraphBlockObjectResponse = {
|
|
905
|
+
type: "paragraph";
|
|
906
|
+
paragraph: ContentWithRichTextColorAndIconResponse;
|
|
907
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
908
|
+
object: "block";
|
|
909
|
+
id: string;
|
|
910
|
+
created_time: string;
|
|
911
|
+
created_by: PartialUserObjectResponse;
|
|
912
|
+
last_edited_time: string;
|
|
913
|
+
last_edited_by: PartialUserObjectResponse;
|
|
914
|
+
has_children: boolean;
|
|
915
|
+
in_trash: boolean;
|
|
916
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
917
|
+
archived: boolean;
|
|
918
|
+
};
|
|
919
|
+
type PartialBlockObjectResponse = {
|
|
920
|
+
object: "block";
|
|
921
|
+
id: string;
|
|
922
|
+
};
|
|
923
|
+
type PdfBlockObjectResponse = {
|
|
924
|
+
type: "pdf";
|
|
925
|
+
pdf: MediaContentWithFileAndCaptionResponse;
|
|
926
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
927
|
+
object: "block";
|
|
928
|
+
id: string;
|
|
929
|
+
created_time: string;
|
|
930
|
+
created_by: PartialUserObjectResponse;
|
|
931
|
+
last_edited_time: string;
|
|
932
|
+
last_edited_by: PartialUserObjectResponse;
|
|
933
|
+
has_children: boolean;
|
|
934
|
+
in_trash: boolean;
|
|
935
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
936
|
+
archived: boolean;
|
|
937
|
+
};
|
|
938
|
+
type QuoteBlockObjectResponse = {
|
|
939
|
+
type: "quote";
|
|
940
|
+
quote: ContentWithRichTextAndColorResponse;
|
|
941
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
942
|
+
object: "block";
|
|
943
|
+
id: string;
|
|
944
|
+
created_time: string;
|
|
945
|
+
created_by: PartialUserObjectResponse;
|
|
946
|
+
last_edited_time: string;
|
|
947
|
+
last_edited_by: PartialUserObjectResponse;
|
|
948
|
+
has_children: boolean;
|
|
949
|
+
in_trash: boolean;
|
|
950
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
951
|
+
archived: boolean;
|
|
952
|
+
};
|
|
953
|
+
type SyncedBlockBlockObjectResponse = {
|
|
954
|
+
type: "synced_block";
|
|
955
|
+
synced_block: {
|
|
956
|
+
synced_from: {
|
|
957
|
+
type: "block_id";
|
|
958
|
+
block_id: IdRequest;
|
|
959
|
+
} | null;
|
|
960
|
+
};
|
|
961
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
962
|
+
object: "block";
|
|
963
|
+
id: string;
|
|
964
|
+
created_time: string;
|
|
965
|
+
created_by: PartialUserObjectResponse;
|
|
966
|
+
last_edited_time: string;
|
|
967
|
+
last_edited_by: PartialUserObjectResponse;
|
|
968
|
+
has_children: boolean;
|
|
969
|
+
in_trash: boolean;
|
|
970
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
971
|
+
archived: boolean;
|
|
972
|
+
};
|
|
973
|
+
type TabBlockObjectResponse = {
|
|
974
|
+
type: "tab";
|
|
975
|
+
tab: EmptyObject;
|
|
976
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
977
|
+
object: "block";
|
|
978
|
+
id: string;
|
|
979
|
+
created_time: string;
|
|
980
|
+
created_by: PartialUserObjectResponse;
|
|
981
|
+
last_edited_time: string;
|
|
982
|
+
last_edited_by: PartialUserObjectResponse;
|
|
983
|
+
has_children: boolean;
|
|
984
|
+
in_trash: boolean;
|
|
985
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
986
|
+
archived: boolean;
|
|
987
|
+
};
|
|
988
|
+
type TableBlockObjectResponse = {
|
|
989
|
+
type: "table";
|
|
990
|
+
table: ContentWithTableResponse;
|
|
991
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
992
|
+
object: "block";
|
|
993
|
+
id: string;
|
|
994
|
+
created_time: string;
|
|
995
|
+
created_by: PartialUserObjectResponse;
|
|
996
|
+
last_edited_time: string;
|
|
997
|
+
last_edited_by: PartialUserObjectResponse;
|
|
998
|
+
has_children: boolean;
|
|
999
|
+
in_trash: boolean;
|
|
1000
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1001
|
+
archived: boolean;
|
|
1002
|
+
};
|
|
1003
|
+
type TableOfContentsBlockObjectResponse = {
|
|
1004
|
+
type: "table_of_contents";
|
|
1005
|
+
table_of_contents: {
|
|
1006
|
+
color: ApiColor;
|
|
1007
|
+
};
|
|
1008
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1009
|
+
object: "block";
|
|
1010
|
+
id: string;
|
|
1011
|
+
created_time: string;
|
|
1012
|
+
created_by: PartialUserObjectResponse;
|
|
1013
|
+
last_edited_time: string;
|
|
1014
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1015
|
+
has_children: boolean;
|
|
1016
|
+
in_trash: boolean;
|
|
1017
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1018
|
+
archived: boolean;
|
|
1019
|
+
};
|
|
1020
|
+
type TableRowBlockObjectResponse = {
|
|
1021
|
+
type: "table_row";
|
|
1022
|
+
table_row: ContentWithTableRowResponse;
|
|
1023
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1024
|
+
object: "block";
|
|
1025
|
+
id: string;
|
|
1026
|
+
created_time: string;
|
|
1027
|
+
created_by: PartialUserObjectResponse;
|
|
1028
|
+
last_edited_time: string;
|
|
1029
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1030
|
+
has_children: boolean;
|
|
1031
|
+
in_trash: boolean;
|
|
1032
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1033
|
+
archived: boolean;
|
|
1034
|
+
};
|
|
1035
|
+
type TemplateBlockObjectResponse = {
|
|
1036
|
+
type: "template";
|
|
1037
|
+
template: {
|
|
1038
|
+
rich_text: Array<RichTextItemResponse>;
|
|
1039
|
+
};
|
|
1040
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1041
|
+
object: "block";
|
|
1042
|
+
id: string;
|
|
1043
|
+
created_time: string;
|
|
1044
|
+
created_by: PartialUserObjectResponse;
|
|
1045
|
+
last_edited_time: string;
|
|
1046
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1047
|
+
has_children: boolean;
|
|
1048
|
+
in_trash: boolean;
|
|
1049
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1050
|
+
archived: boolean;
|
|
1051
|
+
};
|
|
1052
|
+
type TitleObjectResponse = {
|
|
1053
|
+
title: string;
|
|
1054
|
+
};
|
|
1055
|
+
type ToDoBlockObjectResponse = {
|
|
1056
|
+
type: "to_do";
|
|
1057
|
+
to_do: {
|
|
1058
|
+
rich_text: Array<RichTextItemResponse>;
|
|
1059
|
+
color: ApiColor;
|
|
1060
|
+
checked: boolean;
|
|
1061
|
+
};
|
|
1062
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1063
|
+
object: "block";
|
|
1064
|
+
id: string;
|
|
1065
|
+
created_time: string;
|
|
1066
|
+
created_by: PartialUserObjectResponse;
|
|
1067
|
+
last_edited_time: string;
|
|
1068
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1069
|
+
has_children: boolean;
|
|
1070
|
+
in_trash: boolean;
|
|
1071
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1072
|
+
archived: boolean;
|
|
1073
|
+
};
|
|
1074
|
+
type ToggleBlockObjectResponse = {
|
|
1075
|
+
type: "toggle";
|
|
1076
|
+
toggle: ContentWithRichTextAndColorResponse;
|
|
1077
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1078
|
+
object: "block";
|
|
1079
|
+
id: string;
|
|
1080
|
+
created_time: string;
|
|
1081
|
+
created_by: PartialUserObjectResponse;
|
|
1082
|
+
last_edited_time: string;
|
|
1083
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1084
|
+
has_children: boolean;
|
|
1085
|
+
in_trash: boolean;
|
|
1086
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1087
|
+
archived: boolean;
|
|
1088
|
+
};
|
|
1089
|
+
type TranscriptionBlockResponse = {
|
|
1090
|
+
title?: Array<RichTextItemResponse>;
|
|
1091
|
+
status?: ApiTranscriptionStatus;
|
|
1092
|
+
children?: TranscriptionChildrenResponse;
|
|
1093
|
+
calendar_event?: TranscriptionCalendarEventResponse;
|
|
1094
|
+
recording?: TranscriptionRecordingResponse;
|
|
1095
|
+
};
|
|
1096
|
+
type TranscriptionCalendarEventResponse = {
|
|
1097
|
+
start_time: string;
|
|
1098
|
+
end_time: string;
|
|
1099
|
+
attendees?: Array<IdRequest>;
|
|
1100
|
+
};
|
|
1101
|
+
type TranscriptionChildrenResponse = {
|
|
1102
|
+
summary_block_id?: IdRequest;
|
|
1103
|
+
notes_block_id?: IdRequest;
|
|
1104
|
+
transcript_block_id?: IdRequest;
|
|
1105
|
+
};
|
|
1106
|
+
type TranscriptionRecordingResponse = {
|
|
1107
|
+
start_time?: string;
|
|
1108
|
+
end_time?: string;
|
|
1109
|
+
};
|
|
1110
|
+
type UnsupportedBlockObjectResponse = {
|
|
1111
|
+
type: "unsupported";
|
|
1112
|
+
unsupported: {
|
|
1113
|
+
block_type: string;
|
|
1114
|
+
};
|
|
1115
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1116
|
+
object: "block";
|
|
1117
|
+
id: string;
|
|
1118
|
+
created_time: string;
|
|
1119
|
+
created_by: PartialUserObjectResponse;
|
|
1120
|
+
last_edited_time: string;
|
|
1121
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1122
|
+
has_children: boolean;
|
|
1123
|
+
in_trash: boolean;
|
|
1124
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1125
|
+
archived: boolean;
|
|
1126
|
+
};
|
|
1127
|
+
type VideoBlockObjectResponse = {
|
|
1128
|
+
type: "video";
|
|
1129
|
+
video: MediaContentWithFileAndCaptionResponse;
|
|
1130
|
+
parent: ParentForBlockBasedObjectResponse;
|
|
1131
|
+
object: "block";
|
|
1132
|
+
id: string;
|
|
1133
|
+
created_time: string;
|
|
1134
|
+
created_by: PartialUserObjectResponse;
|
|
1135
|
+
last_edited_time: string;
|
|
1136
|
+
last_edited_by: PartialUserObjectResponse;
|
|
1137
|
+
has_children: boolean;
|
|
1138
|
+
in_trash: boolean;
|
|
1139
|
+
/** @deprecated Use `in_trash` instead. Present for backwards compatibility with API versions prior to 2026-03-11. */
|
|
1140
|
+
archived: boolean;
|
|
1141
|
+
};
|
|
1142
|
+
type ListBlockChildrenPathParameters = {
|
|
1143
|
+
block_id: IdRequest;
|
|
1144
|
+
};
|
|
1145
|
+
type ListBlockChildrenQueryParameters = {
|
|
1146
|
+
start_cursor?: string | null;
|
|
1147
|
+
page_size?: number;
|
|
1148
|
+
};
|
|
1149
|
+
type ListBlockChildrenParameters = ListBlockChildrenPathParameters & ListBlockChildrenQueryParameters;
|
|
1150
|
+
type ListBlockChildrenResponse = {
|
|
1151
|
+
type: "block";
|
|
1152
|
+
block: EmptyObject;
|
|
1153
|
+
object: "list";
|
|
1154
|
+
next_cursor: string | null;
|
|
1155
|
+
has_more: boolean;
|
|
1156
|
+
results: Array<PartialBlockObjectResponse | BlockObjectResponse>;
|
|
1157
|
+
};
|
|
1158
|
+
//#endregion
|
|
1159
|
+
//#region src/files.d.ts
|
|
1160
|
+
/** A file uploaded to Notion, whose signed URL expires after an hour. */
|
|
1161
|
+
type HostedFile = {
|
|
1162
|
+
/** The block the file belongs to: an image, video, file… or a block with an icon. */
|
|
1163
|
+
blockId: string;
|
|
1164
|
+
url: string;
|
|
1165
|
+
};
|
|
1166
|
+
type FileObject = {
|
|
1167
|
+
type: "external";
|
|
1168
|
+
external: {
|
|
1169
|
+
url: string;
|
|
1170
|
+
};
|
|
1171
|
+
} | {
|
|
1172
|
+
type: "file";
|
|
1173
|
+
file: {
|
|
1174
|
+
url: string;
|
|
1175
|
+
};
|
|
1176
|
+
} | {
|
|
1177
|
+
type: string;
|
|
1178
|
+
};
|
|
1179
|
+
/**
|
|
1180
|
+
* The URL to render for a Notion file object (a media block's payload, or a
|
|
1181
|
+
* callout's icon). Files uploaded to Notion go through `transformFileUrl`;
|
|
1182
|
+
* external URLs are returned as they are. Null for other kinds.
|
|
1183
|
+
*/
|
|
1184
|
+
declare function resolveFileUrl(file: FileObject | null | undefined, blockId: string, context: RenderContext): string | null;
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region src/headings.d.ts
|
|
1187
|
+
type PageHeading = {
|
|
1188
|
+
/** The heading block's id. */
|
|
1189
|
+
blockId: string;
|
|
1190
|
+
/** Its anchor id on the page, unique across all headings. */
|
|
1191
|
+
id: string;
|
|
1192
|
+
text: string;
|
|
1193
|
+
/** Notion's heading level: 1 for heading_1, and so on. */
|
|
1194
|
+
level: 1 | 2 | 3 | 4;
|
|
1195
|
+
};
|
|
1196
|
+
/**
|
|
1197
|
+
* Every non-blank heading on the page, in reading order (headings nested in
|
|
1198
|
+
* toggles, columns and callouts included), with unique anchor ids. Use it for
|
|
1199
|
+
* a table of contents or a sidebar outline.
|
|
1200
|
+
*/
|
|
1201
|
+
declare function collectHeadings(blocks: NotionBlock[]): PageHeading[];
|
|
1202
|
+
//#endregion
|
|
1203
|
+
//#region src/types.d.ts
|
|
1204
|
+
type PageIcon = PageObjectResponse["icon"];
|
|
1205
|
+
/** The page a `link_to_page` or `child_page` block points to, attached by `fetchBlocks`. */
|
|
1206
|
+
type LinkedPage = {
|
|
1207
|
+
id: string;
|
|
1208
|
+
title: string;
|
|
1209
|
+
icon: PageIcon;
|
|
1210
|
+
};
|
|
1211
|
+
/** What a linked page says about itself, attached by `fetchBlocks` to bookmarks, embeds and link previews. */
|
|
1212
|
+
type BookmarkPreview = {
|
|
1213
|
+
title: string;
|
|
1214
|
+
description?: string;
|
|
1215
|
+
/** The page's Open Graph image. */
|
|
1216
|
+
image?: string;
|
|
1217
|
+
favicon?: string;
|
|
1218
|
+
siteName?: string;
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* A block from the Notion API, with its nested blocks attached as `children`,
|
|
1222
|
+
* for `link_to_page` and `child_page` the linked page as `linkedPage`, and for `bookmark`,
|
|
1223
|
+
* `embed` and `link_preview` the linked page's preview as `bookmarkPreview`.
|
|
1224
|
+
*/
|
|
1225
|
+
type NotionBlock = BlockObjectResponse & {
|
|
1226
|
+
children?: NotionBlock[];
|
|
1227
|
+
linkedPage?: LinkedPage;
|
|
1228
|
+
bookmarkPreview?: BookmarkPreview;
|
|
1229
|
+
};
|
|
1230
|
+
/** A Notion page's metadata, from `fetchPage`. */
|
|
1231
|
+
type NotionPage = {
|
|
1232
|
+
id: string;
|
|
1233
|
+
url: string;
|
|
1234
|
+
title: string;
|
|
1235
|
+
icon: PageIcon;
|
|
1236
|
+
cover: PageObjectResponse["cover"];
|
|
1237
|
+
lastEditedTime: string;
|
|
1238
|
+
properties: PageObjectResponse["properties"];
|
|
1239
|
+
};
|
|
1240
|
+
type NotionBlockType = NotionBlock["type"];
|
|
1241
|
+
/** A Notion block of one type, with its typed payload. */
|
|
1242
|
+
type BlockOf<T extends NotionBlockType> = Extract<NotionBlock, {
|
|
1243
|
+
type: T;
|
|
1244
|
+
}>;
|
|
1245
|
+
type RichText = RichTextItemResponse[];
|
|
1246
|
+
/** A link as it should render: same tab, or a new tab for another site. */
|
|
1247
|
+
type ResolvedLink = {
|
|
1248
|
+
href: string;
|
|
1249
|
+
external: boolean;
|
|
1250
|
+
};
|
|
1251
|
+
/**
|
|
1252
|
+
* Per-render state, passed down explicitly: Server Components can't read
|
|
1253
|
+
* React context.
|
|
1254
|
+
*/
|
|
1255
|
+
type RenderContext = {
|
|
1256
|
+
/** Where a Notion page links to, or null to render its text without a link. */
|
|
1257
|
+
pageHref: (pageId: string) => string | null;
|
|
1258
|
+
/** The page's headings, with their anchor ids (see `collectHeadings`). */
|
|
1259
|
+
headings: PageHeading[];
|
|
1260
|
+
components: BlockComponents;
|
|
1261
|
+
/** Rewrites URLs of files uploaded to Notion (see `NotionRendererProps`). */
|
|
1262
|
+
transformFileUrl?: (file: HostedFile) => string;
|
|
1263
|
+
/** Your demo components, by name (see `NotionRendererProps`). */
|
|
1264
|
+
demos?: Demos;
|
|
1265
|
+
};
|
|
1266
|
+
/** Props of a demo component: what its embed's URL says. */
|
|
1267
|
+
type DemoProps = {
|
|
1268
|
+
/** The demo's name, from the embed's URL: `…/demos/<name>`. */
|
|
1269
|
+
name: string;
|
|
1270
|
+
/** The URL's query parameters: `?speed=slow` is `{ speed: "slow" }`. */
|
|
1271
|
+
params: Record<string, string>;
|
|
1272
|
+
};
|
|
1273
|
+
/** Demo components by name, rendered in place of embeds of `…/demos/<name>`. */
|
|
1274
|
+
type Demos = Record<string, ComponentType<DemoProps>>;
|
|
1275
|
+
/** Props of the frame around a demo. */
|
|
1276
|
+
type DemoFrameProps = {
|
|
1277
|
+
name: string;
|
|
1278
|
+
/** The embed's caption. */
|
|
1279
|
+
caption: RichText;
|
|
1280
|
+
context: RenderContext;
|
|
1281
|
+
/** The demo, rendered. */
|
|
1282
|
+
children: ReactNode;
|
|
1283
|
+
};
|
|
1284
|
+
type BlockProps<T extends NotionBlockType> = {
|
|
1285
|
+
block: BlockOf<T>;
|
|
1286
|
+
context: RenderContext;
|
|
1287
|
+
/** The block's nested blocks, rendered; undefined when it has none. */
|
|
1288
|
+
children?: ReactNode;
|
|
1289
|
+
};
|
|
1290
|
+
type InlineEquationProps = {
|
|
1291
|
+
/** The equation's LaTeX source. */
|
|
1292
|
+
expression: string;
|
|
1293
|
+
context: RenderContext;
|
|
1294
|
+
};
|
|
1295
|
+
/**
|
|
1296
|
+
* Replacements for the built-in components: one per block type, plus
|
|
1297
|
+
* `inline_equation` for equations inside text and `demo` for the frame
|
|
1298
|
+
* around demos.
|
|
1299
|
+
*/
|
|
1300
|
+
type BlockComponents = { [T in NotionBlockType]?: ComponentType<BlockProps<T>>; } & {
|
|
1301
|
+
inline_equation?: ComponentType<InlineEquationProps>;
|
|
1302
|
+
demo?: ComponentType<DemoFrameProps>;
|
|
1303
|
+
};
|
|
1304
|
+
//#endregion
|
|
1305
|
+
export { IdRequest as C, ListBlockChildrenResponse as S, PartialPageObjectResponse as T, PageHeading as _, DemoFrameProps as a, resolveFileUrl as b, InlineEquationProps as c, NotionBlockType as d, NotionPage as f, RichText as g, ResolvedLink as h, BookmarkPreview as i, LinkedPage as l, RenderContext as m, BlockOf as n, DemoProps as o, PageIcon as p, BlockProps as r, Demos as s, BlockComponents as t, NotionBlock as u, collectHeadings as v, PageObjectResponse as w, ListBlockChildrenParameters as x, HostedFile as y };
|