document-model.js 3.3.0 → 4.1.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 (47) hide show
  1. package/README.md +141 -30
  2. package/dist/codec.d.cts +2 -7
  3. package/dist/codec.d.ts +2 -7
  4. package/dist/construct-CdQuI9f5.d.cts +204 -0
  5. package/dist/construct-CdQuI9f5.d.ts +204 -0
  6. package/dist/construct.cjs +106 -0
  7. package/dist/construct.d.cts +2 -0
  8. package/dist/construct.d.ts +2 -0
  9. package/dist/construct.js +93 -0
  10. package/dist/content-BN0PWqpt.d.cts +2393 -0
  11. package/dist/content-CiZf6Fqn.d.ts +2393 -0
  12. package/dist/content-json-schema-defs.cjs +1227 -0
  13. package/dist/content-json-schema-defs.js +1227 -0
  14. package/dist/content.cjs +1 -7
  15. package/dist/content.d.cts +2 -2354
  16. package/dist/content.d.ts +2 -2354
  17. package/dist/content.js +1 -7
  18. package/dist/definitions.cjs +109 -0
  19. package/dist/definitions.d.cts +115 -0
  20. package/dist/definitions.d.ts +115 -0
  21. package/dist/definitions.js +99 -0
  22. package/dist/index.cjs +60 -18
  23. package/dist/index.d.cts +8 -6
  24. package/dist/index.d.ts +8 -6
  25. package/dist/index.js +7 -5
  26. package/dist/package-node-BiUEzIzl.d.cts +456 -0
  27. package/dist/package-node-DLUobcDQ.d.ts +456 -0
  28. package/dist/package-node.cjs +133 -0
  29. package/dist/package-node.d.cts +2 -0
  30. package/dist/package-node.d.ts +2 -0
  31. package/dist/package-node.js +102 -0
  32. package/dist/package.cjs +40 -7
  33. package/dist/package.d.cts +497 -755
  34. package/dist/package.d.ts +497 -755
  35. package/dist/package.js +42 -8
  36. package/dist/schema-io.cjs +55 -25
  37. package/dist/schema-io.d.cts +13 -11
  38. package/dist/schema-io.d.ts +13 -11
  39. package/dist/schema-io.js +54 -25
  40. package/package.json +2 -2
  41. package/schemas/content-document.schema.json +1813 -68
  42. package/schemas/document-package.schema.json +3528 -30
  43. package/dist/layout.cjs +0 -150
  44. package/dist/layout.d.cts +0 -684
  45. package/dist/layout.d.ts +0 -684
  46. package/dist/layout.js +0 -136
  47. package/schemas/layout-document.schema.json +0 -760
@@ -0,0 +1,456 @@
1
+ import { G as ContentSheetImage, gt as ContentVector, p as ContentEmbeddedObject, t as ContentBlock, v as ContentFormula } from "./content-CiZf6Fqn.js";
2
+ import { a as ConstructDescriptor } from "./construct-CdQuI9f5.js";
3
+ import { z } from "zod";
4
+ //#region src/package-node.d.ts
5
+ declare const SectionDescriptorSchema: z.ZodObject<{
6
+ pageSize: z.ZodObject<{
7
+ widthPt: z.ZodNumber;
8
+ heightPt: z.ZodNumber;
9
+ }, z.core.$strip>;
10
+ margins: z.ZodObject<{
11
+ topPt: z.ZodNumber;
12
+ rightPt: z.ZodNumber;
13
+ bottomPt: z.ZodNumber;
14
+ leftPt: z.ZodNumber;
15
+ }, z.core.$strip>;
16
+ kind: z.ZodLiteral<"section">;
17
+ }, z.core.$strict>;
18
+ type SectionDescriptor = z.infer<typeof SectionDescriptorSchema>;
19
+ declare const SlideDescriptorSchema: z.ZodObject<{
20
+ size: z.ZodObject<{
21
+ widthPt: z.ZodNumber;
22
+ heightPt: z.ZodNumber;
23
+ }, z.core.$strip>;
24
+ notes: z.ZodString;
25
+ kind: z.ZodLiteral<"slide">;
26
+ }, z.core.$strict>;
27
+ type SlideDescriptor = z.infer<typeof SlideDescriptorSchema>;
28
+ declare const SheetDescriptorSchema: z.ZodObject<{
29
+ name: z.ZodString;
30
+ cells: z.ZodArray<z.ZodObject<{
31
+ row: z.ZodNumber;
32
+ column: z.ZodNumber;
33
+ value: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ kind: z.ZodLiteral<"number">;
35
+ value: z.ZodNumber;
36
+ exactValue: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"percentage">;
39
+ value: z.ZodNumber;
40
+ exactValue: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ kind: z.ZodLiteral<"currency">;
43
+ value: z.ZodNumber;
44
+ currency: z.ZodOptional<z.ZodString>;
45
+ exactValue: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ kind: z.ZodLiteral<"boolean">;
48
+ value: z.ZodBoolean;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ kind: z.ZodLiteral<"date">;
51
+ value: z.ZodString;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ kind: z.ZodLiteral<"time">;
54
+ value: z.ZodString;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ kind: z.ZodLiteral<"dateTime">;
57
+ value: z.ZodString;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ kind: z.ZodLiteral<"string">;
60
+ value: z.ZodString;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ kind: z.ZodLiteral<"error">;
63
+ value: z.ZodString;
64
+ }, z.core.$strip>, z.ZodObject<{
65
+ kind: z.ZodLiteral<"empty">;
66
+ }, z.core.$strip>], "kind">;
67
+ formula: z.ZodOptional<z.ZodString>;
68
+ displayText: z.ZodString;
69
+ runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
+ text: z.ZodString;
71
+ bold: z.ZodOptional<z.ZodBoolean>;
72
+ italic: z.ZodOptional<z.ZodBoolean>;
73
+ underline: z.ZodOptional<z.ZodBoolean>;
74
+ strike: z.ZodOptional<z.ZodBoolean>;
75
+ fontFamily: z.ZodOptional<z.ZodString>;
76
+ sizePt: z.ZodOptional<z.ZodNumber>;
77
+ color: z.ZodOptional<z.ZodObject<{
78
+ r: z.ZodNumber;
79
+ g: z.ZodNumber;
80
+ b: z.ZodNumber;
81
+ }, z.core.$strip>>;
82
+ hyperlink: z.ZodOptional<z.ZodString>;
83
+ sourcePath: z.ZodOptional<z.ZodString>;
84
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
+ pageIndex: z.ZodNumber;
86
+ xPt: z.ZodNumber;
87
+ yPt: z.ZodNumber;
88
+ widthPt: z.ZodNumber;
89
+ heightPt: z.ZodNumber;
90
+ }, z.core.$strip>>>;
91
+ }, z.core.$strip>>>;
92
+ colSpan: z.ZodOptional<z.ZodNumber>;
93
+ rowSpan: z.ZodOptional<z.ZodNumber>;
94
+ background: z.ZodOptional<z.ZodObject<{
95
+ r: z.ZodNumber;
96
+ g: z.ZodNumber;
97
+ b: z.ZodNumber;
98
+ }, z.core.$strip>>;
99
+ borders: z.ZodOptional<z.ZodObject<{
100
+ left: z.ZodOptional<z.ZodObject<{
101
+ color: z.ZodObject<{
102
+ r: z.ZodNumber;
103
+ g: z.ZodNumber;
104
+ b: z.ZodNumber;
105
+ }, z.core.$strip>;
106
+ widthPt: z.ZodNumber;
107
+ style: z.ZodOptional<z.ZodEnum<{
108
+ solid: "solid";
109
+ dashed: "dashed";
110
+ dotted: "dotted";
111
+ double: "double";
112
+ }>>;
113
+ }, z.core.$strip>>;
114
+ right: z.ZodOptional<z.ZodObject<{
115
+ color: z.ZodObject<{
116
+ r: z.ZodNumber;
117
+ g: z.ZodNumber;
118
+ b: z.ZodNumber;
119
+ }, z.core.$strip>;
120
+ widthPt: z.ZodNumber;
121
+ style: z.ZodOptional<z.ZodEnum<{
122
+ solid: "solid";
123
+ dashed: "dashed";
124
+ dotted: "dotted";
125
+ double: "double";
126
+ }>>;
127
+ }, z.core.$strip>>;
128
+ top: z.ZodOptional<z.ZodObject<{
129
+ color: z.ZodObject<{
130
+ r: z.ZodNumber;
131
+ g: z.ZodNumber;
132
+ b: z.ZodNumber;
133
+ }, z.core.$strip>;
134
+ widthPt: z.ZodNumber;
135
+ style: z.ZodOptional<z.ZodEnum<{
136
+ solid: "solid";
137
+ dashed: "dashed";
138
+ dotted: "dotted";
139
+ double: "double";
140
+ }>>;
141
+ }, z.core.$strip>>;
142
+ bottom: z.ZodOptional<z.ZodObject<{
143
+ color: z.ZodObject<{
144
+ r: z.ZodNumber;
145
+ g: z.ZodNumber;
146
+ b: z.ZodNumber;
147
+ }, z.core.$strip>;
148
+ widthPt: z.ZodNumber;
149
+ style: z.ZodOptional<z.ZodEnum<{
150
+ solid: "solid";
151
+ dashed: "dashed";
152
+ dotted: "dotted";
153
+ double: "double";
154
+ }>>;
155
+ }, z.core.$strip>>;
156
+ }, z.core.$strip>>;
157
+ alignment: z.ZodOptional<z.ZodEnum<{
158
+ left: "left";
159
+ center: "center";
160
+ right: "right";
161
+ justify: "justify";
162
+ }>>;
163
+ verticalAlignment: z.ZodOptional<z.ZodEnum<{
164
+ top: "top";
165
+ bottom: "bottom";
166
+ middle: "middle";
167
+ }>>;
168
+ comment: z.ZodOptional<z.ZodObject<{
169
+ text: z.ZodString;
170
+ author: z.ZodOptional<z.ZodString>;
171
+ createdAt: z.ZodOptional<z.ZodString>;
172
+ replies: z.ZodOptional<z.ZodArray<z.ZodObject<{
173
+ text: z.ZodString;
174
+ author: z.ZodOptional<z.ZodString>;
175
+ }, z.core.$strip>>>;
176
+ }, z.core.$strip>>;
177
+ sourcePath: z.ZodOptional<z.ZodString>;
178
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
179
+ pageIndex: z.ZodNumber;
180
+ xPt: z.ZodNumber;
181
+ yPt: z.ZodNumber;
182
+ widthPt: z.ZodNumber;
183
+ heightPt: z.ZodNumber;
184
+ }, z.core.$strip>>>;
185
+ }, z.core.$strip>>;
186
+ rows: z.ZodArray<z.ZodObject<{
187
+ index: z.ZodNumber;
188
+ heightPt: z.ZodOptional<z.ZodNumber>;
189
+ hidden: z.ZodOptional<z.ZodBoolean>;
190
+ }, z.core.$strip>>;
191
+ columns: z.ZodArray<z.ZodObject<{
192
+ index: z.ZodNumber;
193
+ widthPt: z.ZodOptional<z.ZodNumber>;
194
+ hidden: z.ZodOptional<z.ZodBoolean>;
195
+ }, z.core.$strip>>;
196
+ printSettings: z.ZodObject<{
197
+ pageSize: z.ZodObject<{
198
+ widthPt: z.ZodNumber;
199
+ heightPt: z.ZodNumber;
200
+ }, z.core.$strip>;
201
+ margins: z.ZodObject<{
202
+ topPt: z.ZodNumber;
203
+ rightPt: z.ZodNumber;
204
+ bottomPt: z.ZodNumber;
205
+ leftPt: z.ZodNumber;
206
+ }, z.core.$strip>;
207
+ printRange: z.ZodOptional<z.ZodObject<{
208
+ startRow: z.ZodNumber;
209
+ startColumn: z.ZodNumber;
210
+ endRow: z.ZodNumber;
211
+ endColumn: z.ZodNumber;
212
+ }, z.core.$strip>>;
213
+ scalePercent: z.ZodOptional<z.ZodNumber>;
214
+ fitToPages: z.ZodOptional<z.ZodObject<{
215
+ width: z.ZodNumber;
216
+ height: z.ZodNumber;
217
+ }, z.core.$strip>>;
218
+ repeatRows: z.ZodOptional<z.ZodObject<{
219
+ start: z.ZodNumber;
220
+ end: z.ZodNumber;
221
+ }, z.core.$strip>>;
222
+ repeatColumns: z.ZodOptional<z.ZodObject<{
223
+ start: z.ZodNumber;
224
+ end: z.ZodNumber;
225
+ }, z.core.$strip>>;
226
+ gridlines: z.ZodBoolean;
227
+ headers: z.ZodBoolean;
228
+ pageOrder: z.ZodEnum<{
229
+ downThenOver: "downThenOver";
230
+ overThenDown: "overThenDown";
231
+ }>;
232
+ manualBreaks: z.ZodOptional<z.ZodObject<{
233
+ rows: z.ZodArray<z.ZodNumber>;
234
+ columns: z.ZodArray<z.ZodNumber>;
235
+ }, z.core.$strip>>;
236
+ }, z.core.$strip>;
237
+ kind: z.ZodLiteral<"sheet">;
238
+ }, z.core.$strict>;
239
+ type SheetDescriptor = z.infer<typeof SheetDescriptorSchema>;
240
+ declare const DrawPageDescriptorSchema: z.ZodObject<{
241
+ size: z.ZodObject<{
242
+ widthPt: z.ZodNumber;
243
+ heightPt: z.ZodNumber;
244
+ }, z.core.$strip>;
245
+ kind: z.ZodLiteral<"drawPage">;
246
+ }, z.core.$strict>;
247
+ type DrawPageDescriptor = z.infer<typeof DrawPageDescriptorSchema>;
248
+ declare const ShapeDescriptorSchema: z.ZodObject<{
249
+ name: z.ZodOptional<z.ZodString>;
250
+ sourcePath: z.ZodOptional<z.ZodString>;
251
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
252
+ pageIndex: z.ZodNumber;
253
+ xPt: z.ZodNumber;
254
+ yPt: z.ZodNumber;
255
+ widthPt: z.ZodNumber;
256
+ heightPt: z.ZodNumber;
257
+ }, z.core.$strip>>>;
258
+ frame: z.ZodObject<{
259
+ xPt: z.ZodNumber;
260
+ yPt: z.ZodNumber;
261
+ widthPt: z.ZodNumber;
262
+ heightPt: z.ZodNumber;
263
+ }, z.core.$strip>;
264
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
265
+ insetLeftPt: z.ZodNumber;
266
+ insetTopPt: z.ZodNumber;
267
+ insetRightPt: z.ZodNumber;
268
+ insetBottomPt: z.ZodNumber;
269
+ fontScale: z.ZodOptional<z.ZodNumber>;
270
+ lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
271
+ paintOrder: z.ZodOptional<z.ZodNumber>;
272
+ }, z.core.$strict>;
273
+ type ShapeDescriptor = z.infer<typeof ShapeDescriptorSchema>;
274
+ declare const HeadingParagraphSchema: z.ZodObject<{
275
+ kind: z.ZodLiteral<"paragraph">;
276
+ runs: z.ZodArray<z.ZodObject<{
277
+ text: z.ZodString;
278
+ bold: z.ZodOptional<z.ZodBoolean>;
279
+ italic: z.ZodOptional<z.ZodBoolean>;
280
+ underline: z.ZodOptional<z.ZodBoolean>;
281
+ strike: z.ZodOptional<z.ZodBoolean>;
282
+ fontFamily: z.ZodOptional<z.ZodString>;
283
+ sizePt: z.ZodOptional<z.ZodNumber>;
284
+ color: z.ZodOptional<z.ZodObject<{
285
+ r: z.ZodNumber;
286
+ g: z.ZodNumber;
287
+ b: z.ZodNumber;
288
+ }, z.core.$strip>>;
289
+ hyperlink: z.ZodOptional<z.ZodString>;
290
+ sourcePath: z.ZodOptional<z.ZodString>;
291
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
292
+ pageIndex: z.ZodNumber;
293
+ xPt: z.ZodNumber;
294
+ yPt: z.ZodNumber;
295
+ widthPt: z.ZodNumber;
296
+ heightPt: z.ZodNumber;
297
+ }, z.core.$strip>>>;
298
+ }, z.core.$strip>>;
299
+ styleId: z.ZodOptional<z.ZodString>;
300
+ alignment: z.ZodOptional<z.ZodEnum<{
301
+ left: "left";
302
+ center: "center";
303
+ right: "right";
304
+ justify: "justify";
305
+ }>>;
306
+ list: z.ZodOptional<z.ZodObject<{
307
+ numId: z.ZodOptional<z.ZodString>;
308
+ level: z.ZodNumber;
309
+ }, z.core.$strip>>;
310
+ spacingBeforePt: z.ZodOptional<z.ZodNumber>;
311
+ spacingAfterPt: z.ZodOptional<z.ZodNumber>;
312
+ lineSpacing: z.ZodOptional<z.ZodNumber>;
313
+ indentLeftPt: z.ZodOptional<z.ZodNumber>;
314
+ indentFirstLinePt: z.ZodOptional<z.ZodNumber>;
315
+ sourcePath: z.ZodOptional<z.ZodString>;
316
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
317
+ pageIndex: z.ZodNumber;
318
+ xPt: z.ZodNumber;
319
+ yPt: z.ZodNumber;
320
+ widthPt: z.ZodNumber;
321
+ heightPt: z.ZodNumber;
322
+ }, z.core.$strip>>>;
323
+ headingLevel: z.ZodNumber;
324
+ }, z.core.$strip>;
325
+ type HeadingParagraph = z.infer<typeof HeadingParagraphSchema>;
326
+ declare const ListParagraphSchema: z.ZodObject<{
327
+ kind: z.ZodLiteral<"paragraph">;
328
+ runs: z.ZodArray<z.ZodObject<{
329
+ text: z.ZodString;
330
+ bold: z.ZodOptional<z.ZodBoolean>;
331
+ italic: z.ZodOptional<z.ZodBoolean>;
332
+ underline: z.ZodOptional<z.ZodBoolean>;
333
+ strike: z.ZodOptional<z.ZodBoolean>;
334
+ fontFamily: z.ZodOptional<z.ZodString>;
335
+ sizePt: z.ZodOptional<z.ZodNumber>;
336
+ color: z.ZodOptional<z.ZodObject<{
337
+ r: z.ZodNumber;
338
+ g: z.ZodNumber;
339
+ b: z.ZodNumber;
340
+ }, z.core.$strip>>;
341
+ hyperlink: z.ZodOptional<z.ZodString>;
342
+ sourcePath: z.ZodOptional<z.ZodString>;
343
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
344
+ pageIndex: z.ZodNumber;
345
+ xPt: z.ZodNumber;
346
+ yPt: z.ZodNumber;
347
+ widthPt: z.ZodNumber;
348
+ heightPt: z.ZodNumber;
349
+ }, z.core.$strip>>>;
350
+ }, z.core.$strip>>;
351
+ styleId: z.ZodOptional<z.ZodString>;
352
+ headingLevel: z.ZodOptional<z.ZodNumber>;
353
+ alignment: z.ZodOptional<z.ZodEnum<{
354
+ left: "left";
355
+ center: "center";
356
+ right: "right";
357
+ justify: "justify";
358
+ }>>;
359
+ spacingBeforePt: z.ZodOptional<z.ZodNumber>;
360
+ spacingAfterPt: z.ZodOptional<z.ZodNumber>;
361
+ lineSpacing: z.ZodOptional<z.ZodNumber>;
362
+ indentLeftPt: z.ZodOptional<z.ZodNumber>;
363
+ indentFirstLinePt: z.ZodOptional<z.ZodNumber>;
364
+ sourcePath: z.ZodOptional<z.ZodString>;
365
+ frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
366
+ pageIndex: z.ZodNumber;
367
+ xPt: z.ZodNumber;
368
+ yPt: z.ZodNumber;
369
+ widthPt: z.ZodNumber;
370
+ heightPt: z.ZodNumber;
371
+ }, z.core.$strip>>>;
372
+ list: z.ZodObject<{
373
+ numId: z.ZodOptional<z.ZodString>;
374
+ level: z.ZodNumber;
375
+ }, z.core.$strip>;
376
+ }, z.core.$strip>;
377
+ type ListParagraph = z.infer<typeof ListParagraphSchema>;
378
+ type PackageLeaf = ContentBlock | ContentSheetImage | ContentEmbeddedObject | ContentVector | ContentFormula;
379
+ type SectionChild = HeadingGroupNode | ListGroupNode | SectionConstructGroupNode | ContentBlock;
380
+ type ShapeChild = ListGroupNode | ShapeConstructGroupNode | ContentBlock;
381
+ type ListChild = ListGroupNode | ShapeConstructGroupNode | ContentBlock;
382
+ type SheetChild = ContentSheetImage | ContentEmbeddedObject;
383
+ type DrawPageChild = ShapeGroupNode | ContentVector;
384
+ interface SectionGroupNode {
385
+ readonly node: SectionDescriptor;
386
+ style?: string;
387
+ children: SectionChild[];
388
+ }
389
+ interface SlideGroupNode {
390
+ readonly node: SlideDescriptor;
391
+ style?: string;
392
+ children: ShapeGroupNode[];
393
+ }
394
+ interface SheetGroupNode {
395
+ readonly node: SheetDescriptor;
396
+ style?: string;
397
+ children: SheetChild[];
398
+ }
399
+ interface DrawPageGroupNode {
400
+ readonly node: DrawPageDescriptor;
401
+ style?: string;
402
+ children: DrawPageChild[];
403
+ }
404
+ interface ShapeGroupNode {
405
+ readonly node: ShapeDescriptor;
406
+ style?: string;
407
+ children: ShapeChild[];
408
+ }
409
+ interface HeadingGroupNode {
410
+ readonly node: HeadingParagraph;
411
+ style?: string;
412
+ children: SectionChild[];
413
+ }
414
+ interface ListGroupNode {
415
+ readonly node: ListParagraph;
416
+ style?: string;
417
+ children: ListChild[];
418
+ }
419
+ interface SectionConstructGroupNode {
420
+ readonly node: ConstructDescriptor;
421
+ style?: string;
422
+ children: SectionChild[];
423
+ }
424
+ interface ShapeConstructGroupNode {
425
+ readonly node: ConstructDescriptor;
426
+ style?: string;
427
+ children: ShapeChild[];
428
+ }
429
+ type PackageGroup = SectionGroupNode | SlideGroupNode | SheetGroupNode | DrawPageGroupNode | ShapeGroupNode | HeadingGroupNode | ListGroupNode | SectionConstructGroupNode | ShapeConstructGroupNode;
430
+ type PackageNode = PackageGroup | PackageLeaf;
431
+ declare function isSectionGroupNode(value: unknown): value is SectionGroupNode;
432
+ declare function isSlideGroupNode(value: unknown): value is SlideGroupNode;
433
+ declare function isSheetGroupNode(value: unknown): value is SheetGroupNode;
434
+ declare function isDrawPageGroupNode(value: unknown): value is DrawPageGroupNode;
435
+ declare function isShapeGroupNode(value: unknown): value is ShapeGroupNode;
436
+ declare function isHeadingGroupNode(value: unknown): value is HeadingGroupNode;
437
+ declare function isListGroupNode(value: unknown): value is ListGroupNode;
438
+ declare function isSectionConstructGroupNode(value: unknown): value is SectionConstructGroupNode;
439
+ declare function isShapeConstructGroupNode(value: unknown): value is ShapeConstructGroupNode;
440
+ declare function isPackageLeaf(value: unknown): value is PackageLeaf;
441
+ declare function isPackageGroup(value: unknown): value is PackageGroup;
442
+ declare function isPackageNode(value: unknown): value is PackageNode;
443
+ declare const SectionGroupSchema: z.ZodCustom<SectionGroupNode, SectionGroupNode>;
444
+ declare const SlideGroupSchema: z.ZodCustom<SlideGroupNode, SlideGroupNode>;
445
+ declare const SheetGroupSchema: z.ZodCustom<SheetGroupNode, SheetGroupNode>;
446
+ declare const DrawPageGroupSchema: z.ZodCustom<DrawPageGroupNode, DrawPageGroupNode>;
447
+ declare const ShapeGroupSchema: z.ZodCustom<ShapeGroupNode, ShapeGroupNode>;
448
+ declare const HeadingGroupSchema: z.ZodCustom<HeadingGroupNode, HeadingGroupNode>;
449
+ declare const ListGroupSchema: z.ZodCustom<ListGroupNode, ListGroupNode>;
450
+ declare const SectionConstructGroupSchema: z.ZodCustom<SectionConstructGroupNode, SectionConstructGroupNode>;
451
+ declare const ShapeConstructGroupSchema: z.ZodCustom<ShapeConstructGroupNode, ShapeConstructGroupNode>;
452
+ declare const PackageGroupSchema: z.ZodCustom<PackageGroup, PackageGroup>;
453
+ declare const PackageLeafSchema: z.ZodCustom<PackageLeaf, PackageLeaf>;
454
+ declare const PackageNodeSchema: z.ZodCustom<PackageNode, PackageNode>;
455
+ //#endregion
456
+ export { isShapeGroupNode as $, ShapeConstructGroupSchema as A, SlideDescriptor as B, SectionConstructGroupSchema as C, SectionGroupSchema as D, SectionGroupNode as E, SheetChild as F, isHeadingGroupNode as G, SlideGroupNode as H, SheetDescriptor as I, isPackageLeaf as J, isListGroupNode as K, SheetDescriptorSchema as L, ShapeDescriptorSchema as M, ShapeGroupNode as N, ShapeChild as O, ShapeGroupSchema as P, isShapeConstructGroupNode as Q, SheetGroupNode as R, SectionConstructGroupNode as S, SectionDescriptorSchema as T, SlideGroupSchema as U, SlideDescriptorSchema as V, isDrawPageGroupNode as W, isSectionConstructGroupNode as X, isPackageNode as Y, isSectionGroupNode as Z, PackageLeaf as _, DrawPageGroupSchema as a, PackageNodeSchema as b, HeadingParagraph as c, ListGroupNode as d, isSheetGroupNode as et, ListGroupSchema as f, PackageGroupSchema as g, PackageGroup as h, DrawPageGroupNode as i, ShapeDescriptor as j, ShapeConstructGroupNode as k, HeadingParagraphSchema as l, ListParagraphSchema as m, DrawPageDescriptor as n, HeadingGroupNode as o, ListParagraph as p, isPackageGroup as q, DrawPageDescriptorSchema as r, HeadingGroupSchema as s, DrawPageChild as t, isSlideGroupNode as tt, ListChild as u, PackageLeafSchema as v, SectionDescriptor as w, SectionChild as x, PackageNode as y, SheetGroupSchema as z };
@@ -0,0 +1,133 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_construct = require("./construct.cjs");
3
+ const require_content = require("./content.cjs");
4
+ let zod = require("zod");
5
+ //#region src/package-node.ts
6
+ const SectionDescriptorSchema = require_content.ContentSectionSchema.omit({ blocks: true }).extend({ kind: zod.z.literal("section") }).strict();
7
+ const SlideDescriptorSchema = require_content.ContentSlideSchema.omit({ shapes: true }).extend({ kind: zod.z.literal("slide") }).strict();
8
+ const SheetDescriptorSchema = require_content.ContentSheetSchema.omit({
9
+ images: true,
10
+ embeddedObjects: true
11
+ }).extend({ kind: zod.z.literal("sheet") }).strict();
12
+ const DrawPageDescriptorSchema = require_content.ContentDrawPageSchema.omit({
13
+ shapes: true,
14
+ vectors: true
15
+ }).extend({ kind: zod.z.literal("drawPage") }).strict();
16
+ const ShapeDescriptorSchema = require_content.ContentShapeSchema.omit({ blocks: true }).strict();
17
+ const HeadingParagraphSchema = require_content.ContentParagraphSchema.extend({ headingLevel: zod.z.number().int().positive() });
18
+ const ListParagraphSchema = require_content.ContentParagraphSchema.extend({ list: require_content.ContentListMembershipSchema });
19
+ function isRecord(value) {
20
+ return typeof value === "object" && value !== null && !Array.isArray(value);
21
+ }
22
+ function isGroupWrapper(value, isChild) {
23
+ if (!isRecord(value.node)) return false;
24
+ if (value.style !== void 0 && typeof value.style !== "string") return false;
25
+ if (!Object.keys(value).every((key) => key === "node" || key === "style" || key === "children")) return false;
26
+ return Array.isArray(value.children) && value.children.every(isChild);
27
+ }
28
+ function isLeafChild(schema, value) {
29
+ if (isRecord(value) && "style" in value) return false;
30
+ return schema.safeParse(value).success;
31
+ }
32
+ function isSectionChild(value) {
33
+ return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(require_content.ContentBlockSchema, value);
34
+ }
35
+ function isShapeChild(value) {
36
+ return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(require_content.ContentBlockSchema, value);
37
+ }
38
+ function isListChild(value) {
39
+ return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(require_content.ContentBlockSchema, value);
40
+ }
41
+ function isSheetChild(value) {
42
+ return isLeafChild(require_content.ContentSheetImageSchema, value) || isLeafChild(require_content.ContentEmbeddedObjectSchema, value);
43
+ }
44
+ function isDrawPageChild(value) {
45
+ return isShapeGroupNode(value) || isLeafChild(require_content.ContentVectorSchema, value);
46
+ }
47
+ function isSectionGroupNode(value) {
48
+ return isRecord(value) && SectionDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
49
+ }
50
+ function isSlideGroupNode(value) {
51
+ return isRecord(value) && SlideDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeGroupNode);
52
+ }
53
+ function isSheetGroupNode(value) {
54
+ return isRecord(value) && SheetDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSheetChild);
55
+ }
56
+ function isDrawPageGroupNode(value) {
57
+ return isRecord(value) && DrawPageDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isDrawPageChild);
58
+ }
59
+ function isShapeGroupNode(value) {
60
+ return isRecord(value) && ShapeDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
61
+ }
62
+ function isHeadingGroupNode(value) {
63
+ return isRecord(value) && HeadingParagraphSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
64
+ }
65
+ function isListGroupNode(value) {
66
+ return isRecord(value) && ListParagraphSchema.safeParse(value.node).success && isGroupWrapper(value, isListChild);
67
+ }
68
+ function isSectionConstructGroupNode(value) {
69
+ return isRecord(value) && require_construct.ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
70
+ }
71
+ function isShapeConstructGroupNode(value) {
72
+ return isRecord(value) && require_construct.ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
73
+ }
74
+ const packageLeafUnion = zod.z.union([
75
+ require_content.ContentBlockSchema,
76
+ require_content.ContentSheetImageSchema,
77
+ require_content.ContentEmbeddedObjectSchema,
78
+ require_content.ContentVectorSchema,
79
+ require_content.ContentFormulaSchema
80
+ ]);
81
+ function isPackageLeaf(value) {
82
+ return packageLeafUnion.safeParse(value).success;
83
+ }
84
+ function isPackageGroup(value) {
85
+ return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isShapeConstructGroupNode(value);
86
+ }
87
+ function isPackageNode(value) {
88
+ return isPackageGroup(value) || isPackageLeaf(value);
89
+ }
90
+ const SectionGroupSchema = zod.z.custom(isSectionGroupNode);
91
+ const SlideGroupSchema = zod.z.custom(isSlideGroupNode);
92
+ const SheetGroupSchema = zod.z.custom(isSheetGroupNode);
93
+ const DrawPageGroupSchema = zod.z.custom(isDrawPageGroupNode);
94
+ const ShapeGroupSchema = zod.z.custom(isShapeGroupNode);
95
+ const HeadingGroupSchema = zod.z.custom(isHeadingGroupNode);
96
+ const ListGroupSchema = zod.z.custom(isListGroupNode);
97
+ const SectionConstructGroupSchema = zod.z.custom(isSectionConstructGroupNode);
98
+ const ShapeConstructGroupSchema = zod.z.custom(isShapeConstructGroupNode);
99
+ const PackageGroupSchema = zod.z.custom(isPackageGroup);
100
+ const PackageLeafSchema = zod.z.custom(isPackageLeaf);
101
+ const PackageNodeSchema = zod.z.custom(isPackageNode);
102
+ //#endregion
103
+ exports.DrawPageDescriptorSchema = DrawPageDescriptorSchema;
104
+ exports.DrawPageGroupSchema = DrawPageGroupSchema;
105
+ exports.HeadingGroupSchema = HeadingGroupSchema;
106
+ exports.HeadingParagraphSchema = HeadingParagraphSchema;
107
+ exports.ListGroupSchema = ListGroupSchema;
108
+ exports.ListParagraphSchema = ListParagraphSchema;
109
+ exports.PackageGroupSchema = PackageGroupSchema;
110
+ exports.PackageLeafSchema = PackageLeafSchema;
111
+ exports.PackageNodeSchema = PackageNodeSchema;
112
+ exports.SectionConstructGroupSchema = SectionConstructGroupSchema;
113
+ exports.SectionDescriptorSchema = SectionDescriptorSchema;
114
+ exports.SectionGroupSchema = SectionGroupSchema;
115
+ exports.ShapeConstructGroupSchema = ShapeConstructGroupSchema;
116
+ exports.ShapeDescriptorSchema = ShapeDescriptorSchema;
117
+ exports.ShapeGroupSchema = ShapeGroupSchema;
118
+ exports.SheetDescriptorSchema = SheetDescriptorSchema;
119
+ exports.SheetGroupSchema = SheetGroupSchema;
120
+ exports.SlideDescriptorSchema = SlideDescriptorSchema;
121
+ exports.SlideGroupSchema = SlideGroupSchema;
122
+ exports.isDrawPageGroupNode = isDrawPageGroupNode;
123
+ exports.isHeadingGroupNode = isHeadingGroupNode;
124
+ exports.isListGroupNode = isListGroupNode;
125
+ exports.isPackageGroup = isPackageGroup;
126
+ exports.isPackageLeaf = isPackageLeaf;
127
+ exports.isPackageNode = isPackageNode;
128
+ exports.isSectionConstructGroupNode = isSectionConstructGroupNode;
129
+ exports.isSectionGroupNode = isSectionGroupNode;
130
+ exports.isShapeConstructGroupNode = isShapeConstructGroupNode;
131
+ exports.isShapeGroupNode = isShapeGroupNode;
132
+ exports.isSheetGroupNode = isSheetGroupNode;
133
+ exports.isSlideGroupNode = isSlideGroupNode;
@@ -0,0 +1,2 @@
1
+ import { $ as isShapeGroupNode, A as ShapeConstructGroupSchema, B as SlideDescriptor, C as SectionConstructGroupSchema, D as SectionGroupSchema, E as SectionGroupNode, F as SheetChild, G as isHeadingGroupNode, H as SlideGroupNode, I as SheetDescriptor, J as isPackageLeaf, K as isListGroupNode, L as SheetDescriptorSchema, M as ShapeDescriptorSchema, N as ShapeGroupNode, O as ShapeChild, P as ShapeGroupSchema, Q as isShapeConstructGroupNode, R as SheetGroupNode, S as SectionConstructGroupNode, T as SectionDescriptorSchema, U as SlideGroupSchema, V as SlideDescriptorSchema, W as isDrawPageGroupNode, X as isSectionConstructGroupNode, Y as isPackageNode, Z as isSectionGroupNode, _ as PackageLeaf, a as DrawPageGroupSchema, b as PackageNodeSchema, c as HeadingParagraph, d as ListGroupNode, et as isSheetGroupNode, f as ListGroupSchema, g as PackageGroupSchema, h as PackageGroup, i as DrawPageGroupNode, j as ShapeDescriptor, k as ShapeConstructGroupNode, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, o as HeadingGroupNode, p as ListParagraph, q as isPackageGroup, r as DrawPageDescriptorSchema, s as HeadingGroupSchema, t as DrawPageChild, tt as isSlideGroupNode, u as ListChild, v as PackageLeafSchema, w as SectionDescriptor, x as SectionChild, y as PackageNode, z as SheetGroupSchema } from "./package-node-BiUEzIzl.cjs";
2
+ export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
@@ -0,0 +1,2 @@
1
+ import { $ as isShapeGroupNode, A as ShapeConstructGroupSchema, B as SlideDescriptor, C as SectionConstructGroupSchema, D as SectionGroupSchema, E as SectionGroupNode, F as SheetChild, G as isHeadingGroupNode, H as SlideGroupNode, I as SheetDescriptor, J as isPackageLeaf, K as isListGroupNode, L as SheetDescriptorSchema, M as ShapeDescriptorSchema, N as ShapeGroupNode, O as ShapeChild, P as ShapeGroupSchema, Q as isShapeConstructGroupNode, R as SheetGroupNode, S as SectionConstructGroupNode, T as SectionDescriptorSchema, U as SlideGroupSchema, V as SlideDescriptorSchema, W as isDrawPageGroupNode, X as isSectionConstructGroupNode, Y as isPackageNode, Z as isSectionGroupNode, _ as PackageLeaf, a as DrawPageGroupSchema, b as PackageNodeSchema, c as HeadingParagraph, d as ListGroupNode, et as isSheetGroupNode, f as ListGroupSchema, g as PackageGroupSchema, h as PackageGroup, i as DrawPageGroupNode, j as ShapeDescriptor, k as ShapeConstructGroupNode, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, o as HeadingGroupNode, p as ListParagraph, q as isPackageGroup, r as DrawPageDescriptorSchema, s as HeadingGroupSchema, t as DrawPageChild, tt as isSlideGroupNode, u as ListChild, v as PackageLeafSchema, w as SectionDescriptor, x as SectionChild, y as PackageNode, z as SheetGroupSchema } from "./package-node-DLUobcDQ.js";
2
+ export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };