@blocknote/xl-pdf-exporter 0.19.0

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.
Files changed (78) hide show
  1. package/LICENSE +661 -0
  2. package/dist/Inter_18pt-Bold-BOnnSImi.js +5 -0
  3. package/dist/Inter_18pt-Bold-BOnnSImi.js.map +1 -0
  4. package/dist/Inter_18pt-BoldItalic-DPKIpVzB.js +5 -0
  5. package/dist/Inter_18pt-BoldItalic-DPKIpVzB.js.map +1 -0
  6. package/dist/Inter_18pt-Italic-BVnfHlUD.js +5 -0
  7. package/dist/Inter_18pt-Italic-BVnfHlUD.js.map +1 -0
  8. package/dist/Inter_18pt-Regular-byxnNS-8.js +5 -0
  9. package/dist/Inter_18pt-Regular-byxnNS-8.js.map +1 -0
  10. package/dist/blocknote-xl-pdf-exporter.js +2503 -0
  11. package/dist/blocknote-xl-pdf-exporter.js.map +1 -0
  12. package/dist/blocknote-xl-pdf-exporter.umd.cjs +69 -0
  13. package/dist/blocknote-xl-pdf-exporter.umd.cjs.map +1 -0
  14. package/dist/webpack-stats.json +1 -0
  15. package/package.json +88 -0
  16. package/src/index.ts +1 -0
  17. package/src/pdf/__snapshots__/example.jsx +592 -0
  18. package/src/pdf/__snapshots__/exampleWithHeaderAndFooter.jsx +602 -0
  19. package/src/pdf/defaultSchema/blocks.tsx +177 -0
  20. package/src/pdf/defaultSchema/index.ts +9 -0
  21. package/src/pdf/defaultSchema/inlinecontent.tsx +23 -0
  22. package/src/pdf/defaultSchema/styles.tsx +68 -0
  23. package/src/pdf/index.ts +2 -0
  24. package/src/pdf/pdfExporter.test.tsx +208 -0
  25. package/src/pdf/pdfExporter.tsx +297 -0
  26. package/src/pdf/types.ts +3 -0
  27. package/src/pdf/util/listItem.tsx +70 -0
  28. package/src/pdf/util/table/Table.tsx +76 -0
  29. package/src/vite-env.d.ts +11 -0
  30. package/types/src/Exporter.d.ts +26 -0
  31. package/types/src/context/BlockNoteContext.d.ts +59 -0
  32. package/types/src/context/BlockNoteContext.test.d.ts +1 -0
  33. package/types/src/context/ServerBlockNoteEditor.d.ts +137 -0
  34. package/types/src/context/ServerBlockNoteEditor.test.d.ts +1 -0
  35. package/types/src/context/react/ReactServer.test.d.ts +2 -0
  36. package/types/src/docx/blocks.d.ts +433 -0
  37. package/types/src/docx/defaultSchema/blocks.d.ts +4 -0
  38. package/types/src/docx/defaultSchema/index.d.ts +559 -0
  39. package/types/src/docx/defaultSchema/inlinecontent.d.ts +4 -0
  40. package/types/src/docx/defaultSchema/styles.d.ts +4 -0
  41. package/types/src/docx/docxExporter.d.ts +14 -0
  42. package/types/src/docx/docxExporter.test.d.ts +1 -0
  43. package/types/src/docx/imageUtil.d.ts +4 -0
  44. package/types/src/docx/index.d.ts +2 -0
  45. package/types/src/docx/inlinecontent.d.ts +12 -0
  46. package/types/src/docx/styles.d.ts +55 -0
  47. package/types/src/docx/util/Table.d.ts +4 -0
  48. package/types/src/docxExporter.d.ts +255 -0
  49. package/types/src/docxExporter.test.d.ts +1 -0
  50. package/types/src/index.d.ts +1 -0
  51. package/types/src/mapping.d.ts +29 -0
  52. package/types/src/pdf/blocks.d.ts +434 -0
  53. package/types/src/pdf/defaultSchema/blocks.d.ts +4 -0
  54. package/types/src/pdf/defaultSchema/index.d.ts +510 -0
  55. package/types/src/pdf/defaultSchema/inlinecontent.d.ts +4 -0
  56. package/types/src/pdf/defaultSchema/styles.d.ts +3 -0
  57. package/types/src/pdf/index.d.ts +2 -0
  58. package/types/src/pdf/inlinecontent.d.ts +13 -0
  59. package/types/src/pdf/pdfExporter.d.ts +81 -0
  60. package/types/src/pdf/pdfExporter.test.d.ts +1 -0
  61. package/types/src/pdf/styles.d.ts +55 -0
  62. package/types/src/pdf/types.d.ts +2 -0
  63. package/types/src/pdf/util/listItem.d.ts +9 -0
  64. package/types/src/pdf/util/loadFontDataUrl.d.ts +3 -0
  65. package/types/src/pdf/util/table/Table.d.ts +5 -0
  66. package/types/src/pdfExporter.d.ts +256 -0
  67. package/types/src/pdfExporter.test.d.ts +1 -0
  68. package/types/src/react-email/defaultSchema/blocks.d.ts +5 -0
  69. package/types/src/react-email/defaultSchema/index.d.ts +560 -0
  70. package/types/src/react-email/defaultSchema/inlinecontent.d.ts +5 -0
  71. package/types/src/react-email/defaultSchema/styles.d.ts +4 -0
  72. package/types/src/react-email/reactEmailExporter.d.ts +13 -0
  73. package/types/src/react-email/reactEmailExporter.test.d.ts +8 -0
  74. package/types/src/testDocument.d.ts +505 -0
  75. package/types/src/transformer.d.ts +20 -0
  76. package/types/src/util/fileUtil.d.ts +22 -0
  77. package/types/src/util/imageUtil.d.ts +4 -0
  78. package/types/src/yjs/index.d.ts +2 -0
@@ -0,0 +1,510 @@
1
+ /// <reference types="react" />
2
+ export declare const pdfDefaultSchemaMappings: {
3
+ blockMapping: import("@blocknote/core").BlockMapping<import("@blocknote/core").BlockSchemaFromSpecs<{
4
+ paragraph: {
5
+ config: {
6
+ type: "paragraph";
7
+ content: "inline";
8
+ propSchema: {
9
+ backgroundColor: {
10
+ default: "default";
11
+ };
12
+ textColor: {
13
+ default: "default";
14
+ };
15
+ textAlignment: {
16
+ default: "left";
17
+ values: readonly ["left", "center", "right", "justify"];
18
+ };
19
+ };
20
+ };
21
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
22
+ type: "paragraph";
23
+ content: "inline";
24
+ propSchema: {
25
+ backgroundColor: {
26
+ default: "default";
27
+ };
28
+ textColor: {
29
+ default: "default";
30
+ };
31
+ textAlignment: {
32
+ default: "left";
33
+ values: readonly ["left", "center", "right", "justify"];
34
+ };
35
+ };
36
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
37
+ };
38
+ heading: {
39
+ config: {
40
+ type: "heading";
41
+ content: "inline";
42
+ propSchema: {
43
+ level: {
44
+ default: number;
45
+ values: readonly [1, 2, 3];
46
+ };
47
+ backgroundColor: {
48
+ default: "default";
49
+ };
50
+ textColor: {
51
+ default: "default";
52
+ };
53
+ textAlignment: {
54
+ default: "left";
55
+ values: readonly ["left", "center", "right", "justify"];
56
+ };
57
+ };
58
+ };
59
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
60
+ type: "heading";
61
+ content: "inline";
62
+ propSchema: {
63
+ level: {
64
+ default: number;
65
+ values: readonly [1, 2, 3];
66
+ };
67
+ backgroundColor: {
68
+ default: "default";
69
+ };
70
+ textColor: {
71
+ default: "default";
72
+ };
73
+ textAlignment: {
74
+ default: "left";
75
+ values: readonly ["left", "center", "right", "justify"];
76
+ };
77
+ };
78
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
79
+ };
80
+ codeBlock: {
81
+ config: {
82
+ type: "codeBlock";
83
+ content: "inline";
84
+ propSchema: {
85
+ language: {
86
+ default: string;
87
+ values: string[];
88
+ };
89
+ };
90
+ };
91
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
92
+ type: "codeBlock";
93
+ content: "inline";
94
+ propSchema: {
95
+ language: {
96
+ default: string;
97
+ values: string[];
98
+ };
99
+ };
100
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
101
+ };
102
+ bulletListItem: {
103
+ config: {
104
+ type: "bulletListItem";
105
+ content: "inline";
106
+ propSchema: {
107
+ backgroundColor: {
108
+ default: "default";
109
+ };
110
+ textColor: {
111
+ default: "default";
112
+ };
113
+ textAlignment: {
114
+ default: "left";
115
+ values: readonly ["left", "center", "right", "justify"];
116
+ };
117
+ };
118
+ };
119
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
120
+ type: "bulletListItem";
121
+ content: "inline";
122
+ propSchema: {
123
+ backgroundColor: {
124
+ default: "default";
125
+ };
126
+ textColor: {
127
+ default: "default";
128
+ };
129
+ textAlignment: {
130
+ default: "left";
131
+ values: readonly ["left", "center", "right", "justify"];
132
+ };
133
+ };
134
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
135
+ };
136
+ numberedListItem: {
137
+ config: {
138
+ type: "numberedListItem";
139
+ content: "inline";
140
+ propSchema: {
141
+ backgroundColor: {
142
+ default: "default";
143
+ };
144
+ textColor: {
145
+ default: "default";
146
+ };
147
+ textAlignment: {
148
+ default: "left";
149
+ values: readonly ["left", "center", "right", "justify"];
150
+ };
151
+ };
152
+ };
153
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
154
+ type: "numberedListItem";
155
+ content: "inline";
156
+ propSchema: {
157
+ backgroundColor: {
158
+ default: "default";
159
+ };
160
+ textColor: {
161
+ default: "default";
162
+ };
163
+ textAlignment: {
164
+ default: "left";
165
+ values: readonly ["left", "center", "right", "justify"];
166
+ };
167
+ };
168
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
169
+ };
170
+ checkListItem: {
171
+ config: {
172
+ type: "checkListItem";
173
+ content: "inline";
174
+ propSchema: {
175
+ checked: {
176
+ default: false;
177
+ };
178
+ backgroundColor: {
179
+ default: "default";
180
+ };
181
+ textColor: {
182
+ default: "default";
183
+ };
184
+ textAlignment: {
185
+ default: "left";
186
+ values: readonly ["left", "center", "right", "justify"];
187
+ };
188
+ };
189
+ };
190
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
191
+ type: "checkListItem";
192
+ content: "inline";
193
+ propSchema: {
194
+ checked: {
195
+ default: false;
196
+ };
197
+ backgroundColor: {
198
+ default: "default";
199
+ };
200
+ textColor: {
201
+ default: "default";
202
+ };
203
+ textAlignment: {
204
+ default: "left";
205
+ values: readonly ["left", "center", "right", "justify"];
206
+ };
207
+ };
208
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
209
+ };
210
+ table: {
211
+ config: {
212
+ type: "table";
213
+ content: "table";
214
+ propSchema: {
215
+ backgroundColor: {
216
+ default: "default";
217
+ };
218
+ textColor: {
219
+ default: "default";
220
+ };
221
+ };
222
+ };
223
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
224
+ type: "table";
225
+ content: "table";
226
+ propSchema: {
227
+ backgroundColor: {
228
+ default: "default";
229
+ };
230
+ textColor: {
231
+ default: "default";
232
+ };
233
+ };
234
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
235
+ };
236
+ file: {
237
+ config: {
238
+ type: "file";
239
+ propSchema: {
240
+ backgroundColor: {
241
+ default: "default";
242
+ };
243
+ name: {
244
+ default: "";
245
+ };
246
+ url: {
247
+ default: "";
248
+ };
249
+ caption: {
250
+ default: "";
251
+ };
252
+ };
253
+ content: "none";
254
+ isFileBlock: true;
255
+ };
256
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
257
+ type: "file";
258
+ propSchema: {
259
+ backgroundColor: {
260
+ default: "default";
261
+ };
262
+ name: {
263
+ default: "";
264
+ };
265
+ url: {
266
+ default: "";
267
+ };
268
+ caption: {
269
+ default: "";
270
+ };
271
+ };
272
+ content: "none";
273
+ isFileBlock: true;
274
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
275
+ };
276
+ image: {
277
+ config: {
278
+ type: "image";
279
+ propSchema: {
280
+ textAlignment: {
281
+ default: "left";
282
+ values: readonly ["left", "center", "right", "justify"];
283
+ };
284
+ backgroundColor: {
285
+ default: "default";
286
+ };
287
+ name: {
288
+ default: "";
289
+ };
290
+ url: {
291
+ default: "";
292
+ };
293
+ caption: {
294
+ default: "";
295
+ };
296
+ showPreview: {
297
+ default: true;
298
+ };
299
+ previewWidth: {
300
+ default: number;
301
+ };
302
+ };
303
+ content: "none";
304
+ isFileBlock: true;
305
+ fileBlockAccept: string[];
306
+ };
307
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
308
+ type: "image";
309
+ propSchema: {
310
+ textAlignment: {
311
+ default: "left";
312
+ values: readonly ["left", "center", "right", "justify"];
313
+ };
314
+ backgroundColor: {
315
+ default: "default";
316
+ };
317
+ name: {
318
+ default: "";
319
+ };
320
+ url: {
321
+ default: "";
322
+ };
323
+ caption: {
324
+ default: "";
325
+ };
326
+ showPreview: {
327
+ default: true;
328
+ };
329
+ previewWidth: {
330
+ default: number;
331
+ };
332
+ };
333
+ content: "none";
334
+ isFileBlock: true;
335
+ fileBlockAccept: string[];
336
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
337
+ };
338
+ video: {
339
+ config: {
340
+ type: "video";
341
+ propSchema: {
342
+ textAlignment: {
343
+ default: "left";
344
+ values: readonly ["left", "center", "right", "justify"];
345
+ };
346
+ backgroundColor: {
347
+ default: "default";
348
+ };
349
+ name: {
350
+ default: "";
351
+ };
352
+ url: {
353
+ default: "";
354
+ };
355
+ caption: {
356
+ default: "";
357
+ };
358
+ showPreview: {
359
+ default: true;
360
+ };
361
+ previewWidth: {
362
+ default: number;
363
+ };
364
+ };
365
+ content: "none";
366
+ isFileBlock: true;
367
+ fileBlockAccept: string[];
368
+ };
369
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
370
+ type: "video";
371
+ propSchema: {
372
+ textAlignment: {
373
+ default: "left";
374
+ values: readonly ["left", "center", "right", "justify"];
375
+ };
376
+ backgroundColor: {
377
+ default: "default";
378
+ };
379
+ name: {
380
+ default: "";
381
+ };
382
+ url: {
383
+ default: "";
384
+ };
385
+ caption: {
386
+ default: "";
387
+ };
388
+ showPreview: {
389
+ default: true;
390
+ };
391
+ previewWidth: {
392
+ default: number;
393
+ };
394
+ };
395
+ content: "none";
396
+ isFileBlock: true;
397
+ fileBlockAccept: string[];
398
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
399
+ };
400
+ audio: {
401
+ config: {
402
+ type: "audio";
403
+ propSchema: {
404
+ backgroundColor: {
405
+ default: "default";
406
+ };
407
+ name: {
408
+ default: "";
409
+ };
410
+ url: {
411
+ default: "";
412
+ };
413
+ caption: {
414
+ default: "";
415
+ };
416
+ showPreview: {
417
+ default: true;
418
+ };
419
+ };
420
+ content: "none";
421
+ isFileBlock: true;
422
+ fileBlockAccept: string[];
423
+ };
424
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
425
+ type: "audio";
426
+ propSchema: {
427
+ backgroundColor: {
428
+ default: "default";
429
+ };
430
+ name: {
431
+ default: "";
432
+ };
433
+ url: {
434
+ default: "";
435
+ };
436
+ caption: {
437
+ default: "";
438
+ };
439
+ showPreview: {
440
+ default: true;
441
+ };
442
+ };
443
+ content: "none";
444
+ isFileBlock: true;
445
+ fileBlockAccept: string[];
446
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
447
+ };
448
+ }>, any, any, import("react").ReactElement<import("@react-pdf/renderer").Text, string | import("react").JSXElementConstructor<any>>, import("react").ReactElement<import("@react-pdf/renderer").Text, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<import("@react-pdf/renderer").Link, string | import("react").JSXElementConstructor<any>>>;
449
+ inlineContentMapping: import("@blocknote/core").InlineContentMapping<import("@blocknote/core").InlineContentSchemaFromSpecs<{
450
+ text: {
451
+ config: "text";
452
+ implementation: any;
453
+ };
454
+ link: {
455
+ config: "link";
456
+ implementation: any;
457
+ };
458
+ }>, any, import("react").ReactElement<import("@react-pdf/renderer").Text, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<import("@react-pdf/renderer").Link, string | import("react").JSXElementConstructor<any>>, import("react").ReactElement<import("@react-pdf/renderer").Text, string | import("react").JSXElementConstructor<any>>>;
459
+ styleMapping: import("@blocknote/core").StyleMapping<import("@blocknote/core").StyleSchemaFromSpecs<{
460
+ bold: {
461
+ config: {
462
+ type: string;
463
+ propSchema: "boolean";
464
+ };
465
+ implementation: import("@blocknote/core").StyleImplementation;
466
+ };
467
+ italic: {
468
+ config: {
469
+ type: string;
470
+ propSchema: "boolean";
471
+ };
472
+ implementation: import("@blocknote/core").StyleImplementation;
473
+ };
474
+ underline: {
475
+ config: {
476
+ type: string;
477
+ propSchema: "boolean";
478
+ };
479
+ implementation: import("@blocknote/core").StyleImplementation;
480
+ };
481
+ strike: {
482
+ config: {
483
+ type: string;
484
+ propSchema: "boolean";
485
+ };
486
+ implementation: import("@blocknote/core").StyleImplementation;
487
+ };
488
+ code: {
489
+ config: {
490
+ type: string;
491
+ propSchema: "boolean";
492
+ };
493
+ implementation: import("@blocknote/core").StyleImplementation;
494
+ };
495
+ textColor: {
496
+ config: {
497
+ type: string;
498
+ propSchema: "string";
499
+ };
500
+ implementation: import("@blocknote/core").StyleImplementation;
501
+ };
502
+ backgroundColor: {
503
+ config: {
504
+ type: string;
505
+ propSchema: "string";
506
+ };
507
+ implementation: import("@blocknote/core").StyleImplementation;
508
+ };
509
+ }>, import("@react-pdf/types").Style | import("@react-pdf/types").Style[] | undefined>;
510
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { DefaultInlineContentSchema, InlineContentMapping } from "@blocknote/core";
3
+ import { Link, Text } from "@react-pdf/renderer";
4
+ export declare const pdfInlineContentMappingForDefaultSchema: InlineContentMapping<DefaultInlineContentSchema, any, React.ReactElement<Link> | React.ReactElement<Text>, React.ReactElement<Text>>;
@@ -0,0 +1,3 @@
1
+ import { DefaultStyleSchema, StyleMapping } from "@blocknote/core";
2
+ import { TextProps } from "@react-pdf/renderer";
3
+ export declare const pdfStyleMappingForDefaultSchema: StyleMapping<DefaultStyleSchema, TextProps["style"]>;
@@ -0,0 +1,2 @@
1
+ export * from "./defaultSchema/index.js";
2
+ export * from "./pdfExporter.jsx";
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { StyleSchema, StyledText } from "@blocknote/core";
3
+ import { Link, Text } from "@react-pdf/renderer";
4
+ export declare function docxInlineContentMappingForDefaultSchema(styledTextTransformer: (styledText: StyledText<StyleSchema>) => React.ReactElement<Text>): import("../mapping").InlineContentMapping<import("@blocknote/core").InlineContentSchemaFromSpecs<{
5
+ text: {
6
+ config: "text";
7
+ implementation: any;
8
+ };
9
+ link: {
10
+ config: "link";
11
+ implementation: any;
12
+ };
13
+ }>, StyleSchema, import("react").ReactElement<Text, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<Link, string | import("react").JSXElementConstructor<any>>>;
@@ -0,0 +1,81 @@
1
+ /// <reference types="react" />
2
+ import { Block, BlockNoteSchema, BlockSchema, DefaultProps, Exporter, ExporterOptions, InlineContentSchema, StyleSchema, StyledText } from "@blocknote/core";
3
+ import { Font, Link, Text, TextProps } from "@react-pdf/renderer";
4
+ import { Style } from "./types.js";
5
+ type Options = ExporterOptions & {
6
+ /**
7
+ *
8
+ * @default uses the remote emoji source hosted on cloudflare (https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/)
9
+ */
10
+ emojiSource: false | ReturnType<typeof Font.getEmojiSource>;
11
+ };
12
+ /**
13
+ * Exports a BlockNote document to a .pdf file using the react-pdf library.
14
+ */
15
+ export declare class PDFExporter<B extends BlockSchema, S extends StyleSchema, I extends InlineContentSchema> extends Exporter<B, I, S, React.ReactElement<Text>, React.ReactElement<Link> | React.ReactElement<Text>, TextProps["style"], React.ReactElement<Text>> {
16
+ /**
17
+ * The schema of your editor. The mappings are automatically typed checked against this schema.
18
+ */
19
+ protected readonly schema: BlockNoteSchema<B, I, S>;
20
+ private fontsRegistered;
21
+ styles: {
22
+ page: {
23
+ paddingTop: number;
24
+ paddingBottom: number;
25
+ paddingHorizontal: number;
26
+ fontFamily: string;
27
+ fontSize: number;
28
+ lineHeight: number;
29
+ };
30
+ section: {};
31
+ block: {};
32
+ blockChildren: {};
33
+ header: {};
34
+ footer: {
35
+ position: "absolute";
36
+ };
37
+ };
38
+ readonly options: Options;
39
+ constructor(
40
+ /**
41
+ * The schema of your editor. The mappings are automatically typed checked against this schema.
42
+ */
43
+ schema: BlockNoteSchema<B, I, S>,
44
+ /**
45
+ * The mappings that map the BlockNote schema to the react-pdf content.
46
+ *
47
+ * Pass {@link pdfDefaultSchemaMappings} for the default schema.
48
+ */
49
+ mappings: Exporter<NoInfer<B>, NoInfer<I>, NoInfer<S>, React.ReactElement<Text>, // RB
50
+ // RB
51
+ React.ReactElement<Link> | React.ReactElement<Text>, // RI
52
+ TextProps["style"], // RS
53
+ React.ReactElement<Text>>["mappings"], options?: Partial<Options>);
54
+ /**
55
+ * Mostly for internal use, you probably want to use `toBlob` or `toReactPDFDocument` instead.
56
+ */
57
+ transformStyledText(styledText: StyledText<S>): import("react/jsx-runtime").JSX.Element;
58
+ /**
59
+ * Mostly for internal use, you probably want to use `toBlob` or `toReactPDFDocument` instead.
60
+ */
61
+ transformBlocks(blocks: Block<B, I, S>[], // Or BlockFromConfig<B[keyof B], I, S>?
62
+ nestingLevel?: number): Promise<React.ReactElement<Text>[]>;
63
+ protected registerFonts(): Promise<void>;
64
+ /**
65
+ * Convert a document (array of Blocks) to a react-pdf Document.
66
+ */
67
+ toReactPDFDocument(blocks: Block<B, I, S>[], options?: {
68
+ /**
69
+ * Add a header to every page.
70
+ * The React component passed must be a React-PDF component
71
+ */
72
+ header?: React.ReactElement;
73
+ /**
74
+ * Add a footer to every page.
75
+ * The React component passed must be a React-PDF component
76
+ */
77
+ footer?: React.ReactElement;
78
+ }): Promise<import("react/jsx-runtime").JSX.Element>;
79
+ protected blocknoteDefaultPropsToReactPDFStyle(props: Partial<DefaultProps>): Style;
80
+ }
81
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import { StyleSchema, StyledText } from "@blocknote/core";
2
+ import { TextProps } from "@react-pdf/renderer";
3
+ import { StyleMapping } from "../mapping";
4
+ export declare const docxStyleMappingForDefaultSchema: StyleMapping<import("@blocknote/core").StyleSchemaFromSpecs<{
5
+ bold: {
6
+ config: {
7
+ type: string;
8
+ propSchema: "boolean";
9
+ };
10
+ implementation: import("@blocknote/core").StyleImplementation;
11
+ };
12
+ italic: {
13
+ config: {
14
+ type: string;
15
+ propSchema: "boolean";
16
+ };
17
+ implementation: import("@blocknote/core").StyleImplementation;
18
+ };
19
+ underline: {
20
+ config: {
21
+ type: string;
22
+ propSchema: "boolean";
23
+ };
24
+ implementation: import("@blocknote/core").StyleImplementation;
25
+ };
26
+ strike: {
27
+ config: {
28
+ type: string;
29
+ propSchema: "boolean";
30
+ };
31
+ implementation: import("@blocknote/core").StyleImplementation;
32
+ };
33
+ code: {
34
+ config: {
35
+ type: string;
36
+ propSchema: "boolean";
37
+ };
38
+ implementation: import("@blocknote/core").StyleImplementation;
39
+ };
40
+ textColor: {
41
+ config: {
42
+ type: string;
43
+ propSchema: "string";
44
+ };
45
+ implementation: import("@blocknote/core").StyleImplementation;
46
+ };
47
+ backgroundColor: {
48
+ config: {
49
+ type: string;
50
+ propSchema: "string";
51
+ };
52
+ implementation: import("@blocknote/core").StyleImplementation;
53
+ };
54
+ }>, Style>;
55
+ export declare function createDocxStyledTextTransformer<S extends StyleSchema>(mapping: StyleMapping<S, TextProps>): (styledText: StyledText<S>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { Styles } from "@react-pdf/renderer";
2
+ export type Style = Styles[keyof Styles];