@studio8collective/patent-render 0.0.0-stage → 1.0.1

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.
@@ -0,0 +1,1295 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { z } from 'zod';
4
+
5
+ declare const Item: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
+ type: z.ZodLiteral<"line">;
7
+ a: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
8
+ b: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
9
+ stroke: z.ZodDefault<z.ZodObject<{
10
+ width: z.ZodDefault<z.ZodNumber>;
11
+ style: z.ZodDefault<z.ZodEnum<{
12
+ solid: "solid";
13
+ dashed: "dashed";
14
+ centre: "centre";
15
+ phantom: "phantom";
16
+ }>>;
17
+ }, z.core.$strip>>;
18
+ id: z.ZodString;
19
+ name: z.ZodOptional<z.ZodString>;
20
+ rotation: z.ZodDefault<z.ZodNumber>;
21
+ locked: z.ZodDefault<z.ZodBoolean>;
22
+ hidden: z.ZodDefault<z.ZodBoolean>;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ type: z.ZodLiteral<"polyline">;
25
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
26
+ closed: z.ZodDefault<z.ZodBoolean>;
27
+ fill: z.ZodDefault<z.ZodEnum<{
28
+ none: "none";
29
+ black: "black";
30
+ white: "white";
31
+ }>>;
32
+ stroke: z.ZodDefault<z.ZodObject<{
33
+ width: z.ZodDefault<z.ZodNumber>;
34
+ style: z.ZodDefault<z.ZodEnum<{
35
+ solid: "solid";
36
+ dashed: "dashed";
37
+ centre: "centre";
38
+ phantom: "phantom";
39
+ }>>;
40
+ }, z.core.$strip>>;
41
+ id: z.ZodString;
42
+ name: z.ZodOptional<z.ZodString>;
43
+ rotation: z.ZodDefault<z.ZodNumber>;
44
+ locked: z.ZodDefault<z.ZodBoolean>;
45
+ hidden: z.ZodDefault<z.ZodBoolean>;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<"path">;
48
+ d: z.ZodString;
49
+ fill: z.ZodDefault<z.ZodEnum<{
50
+ none: "none";
51
+ black: "black";
52
+ white: "white";
53
+ }>>;
54
+ stroke: z.ZodDefault<z.ZodObject<{
55
+ width: z.ZodDefault<z.ZodNumber>;
56
+ style: z.ZodDefault<z.ZodEnum<{
57
+ solid: "solid";
58
+ dashed: "dashed";
59
+ centre: "centre";
60
+ phantom: "phantom";
61
+ }>>;
62
+ }, z.core.$strip>>;
63
+ id: z.ZodString;
64
+ name: z.ZodOptional<z.ZodString>;
65
+ rotation: z.ZodDefault<z.ZodNumber>;
66
+ locked: z.ZodDefault<z.ZodBoolean>;
67
+ hidden: z.ZodDefault<z.ZodBoolean>;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ type: z.ZodLiteral<"rect">;
70
+ x: z.ZodNumber;
71
+ y: z.ZodNumber;
72
+ w: z.ZodNumber;
73
+ h: z.ZodNumber;
74
+ radius: z.ZodDefault<z.ZodNumber>;
75
+ fill: z.ZodDefault<z.ZodEnum<{
76
+ none: "none";
77
+ black: "black";
78
+ white: "white";
79
+ }>>;
80
+ stroke: z.ZodDefault<z.ZodObject<{
81
+ width: z.ZodDefault<z.ZodNumber>;
82
+ style: z.ZodDefault<z.ZodEnum<{
83
+ solid: "solid";
84
+ dashed: "dashed";
85
+ centre: "centre";
86
+ phantom: "phantom";
87
+ }>>;
88
+ }, z.core.$strip>>;
89
+ id: z.ZodString;
90
+ name: z.ZodOptional<z.ZodString>;
91
+ rotation: z.ZodDefault<z.ZodNumber>;
92
+ locked: z.ZodDefault<z.ZodBoolean>;
93
+ hidden: z.ZodDefault<z.ZodBoolean>;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ type: z.ZodLiteral<"ellipse">;
96
+ cx: z.ZodNumber;
97
+ cy: z.ZodNumber;
98
+ rx: z.ZodNumber;
99
+ ry: z.ZodNumber;
100
+ fill: z.ZodDefault<z.ZodEnum<{
101
+ none: "none";
102
+ black: "black";
103
+ white: "white";
104
+ }>>;
105
+ stroke: z.ZodDefault<z.ZodObject<{
106
+ width: z.ZodDefault<z.ZodNumber>;
107
+ style: z.ZodDefault<z.ZodEnum<{
108
+ solid: "solid";
109
+ dashed: "dashed";
110
+ centre: "centre";
111
+ phantom: "phantom";
112
+ }>>;
113
+ }, z.core.$strip>>;
114
+ id: z.ZodString;
115
+ name: z.ZodOptional<z.ZodString>;
116
+ rotation: z.ZodDefault<z.ZodNumber>;
117
+ locked: z.ZodDefault<z.ZodBoolean>;
118
+ hidden: z.ZodDefault<z.ZodBoolean>;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ type: z.ZodLiteral<"arc">;
121
+ cx: z.ZodNumber;
122
+ cy: z.ZodNumber;
123
+ r: z.ZodNumber;
124
+ start: z.ZodNumber;
125
+ end: z.ZodNumber;
126
+ stroke: z.ZodDefault<z.ZodObject<{
127
+ width: z.ZodDefault<z.ZodNumber>;
128
+ style: z.ZodDefault<z.ZodEnum<{
129
+ solid: "solid";
130
+ dashed: "dashed";
131
+ centre: "centre";
132
+ phantom: "phantom";
133
+ }>>;
134
+ }, z.core.$strip>>;
135
+ id: z.ZodString;
136
+ name: z.ZodOptional<z.ZodString>;
137
+ rotation: z.ZodDefault<z.ZodNumber>;
138
+ locked: z.ZodDefault<z.ZodBoolean>;
139
+ hidden: z.ZodDefault<z.ZodBoolean>;
140
+ }, z.core.$strip>, z.ZodObject<{
141
+ type: z.ZodLiteral<"text">;
142
+ x: z.ZodNumber;
143
+ y: z.ZodNumber;
144
+ text: z.ZodString;
145
+ size: z.ZodDefault<z.ZodNumber>;
146
+ anchor: z.ZodDefault<z.ZodEnum<{
147
+ start: "start";
148
+ end: "end";
149
+ middle: "middle";
150
+ }>>;
151
+ id: z.ZodString;
152
+ name: z.ZodOptional<z.ZodString>;
153
+ rotation: z.ZodDefault<z.ZodNumber>;
154
+ locked: z.ZodDefault<z.ZodBoolean>;
155
+ hidden: z.ZodDefault<z.ZodBoolean>;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ type: z.ZodLiteral<"numeral">;
158
+ n: z.ZodString;
159
+ at: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
160
+ target: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
161
+ leader: z.ZodDefault<z.ZodEnum<{
162
+ none: "none";
163
+ straight: "straight";
164
+ curved: "curved";
165
+ }>>;
166
+ underline: z.ZodDefault<z.ZodBoolean>;
167
+ size: z.ZodDefault<z.ZodNumber>;
168
+ id: z.ZodString;
169
+ name: z.ZodOptional<z.ZodString>;
170
+ rotation: z.ZodDefault<z.ZodNumber>;
171
+ locked: z.ZodDefault<z.ZodBoolean>;
172
+ hidden: z.ZodDefault<z.ZodBoolean>;
173
+ }, z.core.$strip>, z.ZodObject<{
174
+ type: z.ZodLiteral<"figLabel">;
175
+ x: z.ZodNumber;
176
+ y: z.ZodNumber;
177
+ size: z.ZodDefault<z.ZodNumber>;
178
+ id: z.ZodString;
179
+ name: z.ZodOptional<z.ZodString>;
180
+ rotation: z.ZodDefault<z.ZodNumber>;
181
+ locked: z.ZodDefault<z.ZodBoolean>;
182
+ hidden: z.ZodDefault<z.ZodBoolean>;
183
+ }, z.core.$strip>, z.ZodObject<{
184
+ type: z.ZodLiteral<"connector">;
185
+ from: z.ZodUnion<readonly [z.ZodObject<{
186
+ itemId: z.ZodString;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ point: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
189
+ }, z.core.$strip>]>;
190
+ to: z.ZodUnion<readonly [z.ZodObject<{
191
+ itemId: z.ZodString;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ point: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
194
+ }, z.core.$strip>]>;
195
+ routing: z.ZodDefault<z.ZodEnum<{
196
+ straight: "straight";
197
+ curved: "curved";
198
+ orthogonal: "orthogonal";
199
+ }>>;
200
+ fromSide: z.ZodOptional<z.ZodEnum<{
201
+ top: "top";
202
+ bottom: "bottom";
203
+ left: "left";
204
+ right: "right";
205
+ }>>;
206
+ toSide: z.ZodOptional<z.ZodEnum<{
207
+ top: "top";
208
+ bottom: "bottom";
209
+ left: "left";
210
+ right: "right";
211
+ }>>;
212
+ arrow: z.ZodDefault<z.ZodEnum<{
213
+ none: "none";
214
+ start: "start";
215
+ end: "end";
216
+ both: "both";
217
+ }>>;
218
+ arrowStyle: z.ZodDefault<z.ZodEnum<{
219
+ filled: "filled";
220
+ open: "open";
221
+ }>>;
222
+ label: z.ZodOptional<z.ZodString>;
223
+ stroke: z.ZodDefault<z.ZodObject<{
224
+ width: z.ZodDefault<z.ZodNumber>;
225
+ style: z.ZodDefault<z.ZodEnum<{
226
+ solid: "solid";
227
+ dashed: "dashed";
228
+ centre: "centre";
229
+ phantom: "phantom";
230
+ }>>;
231
+ }, z.core.$strip>>;
232
+ id: z.ZodString;
233
+ name: z.ZodOptional<z.ZodString>;
234
+ rotation: z.ZodDefault<z.ZodNumber>;
235
+ locked: z.ZodDefault<z.ZodBoolean>;
236
+ hidden: z.ZodDefault<z.ZodBoolean>;
237
+ }, z.core.$strip>, z.ZodObject<{
238
+ type: z.ZodLiteral<"hatch">;
239
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
240
+ angle: z.ZodDefault<z.ZodNumber>;
241
+ spacing: z.ZodDefault<z.ZodNumber>;
242
+ lineWidth: z.ZodDefault<z.ZodNumber>;
243
+ id: z.ZodString;
244
+ name: z.ZodOptional<z.ZodString>;
245
+ rotation: z.ZodDefault<z.ZodNumber>;
246
+ locked: z.ZodDefault<z.ZodBoolean>;
247
+ hidden: z.ZodDefault<z.ZodBoolean>;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ type: z.ZodLiteral<"sectionLine">;
250
+ a: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
251
+ b: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
252
+ label: z.ZodString;
253
+ stroke: z.ZodDefault<z.ZodObject<{
254
+ width: z.ZodDefault<z.ZodNumber>;
255
+ style: z.ZodDefault<z.ZodEnum<{
256
+ solid: "solid";
257
+ dashed: "dashed";
258
+ centre: "centre";
259
+ phantom: "phantom";
260
+ }>>;
261
+ }, z.core.$strip>>;
262
+ id: z.ZodString;
263
+ name: z.ZodOptional<z.ZodString>;
264
+ rotation: z.ZodDefault<z.ZodNumber>;
265
+ locked: z.ZodDefault<z.ZodBoolean>;
266
+ hidden: z.ZodDefault<z.ZodBoolean>;
267
+ }, z.core.$strip>], "type">;
268
+ type Item = z.infer<typeof Item>;
269
+ declare const Layer: z.ZodObject<{
270
+ id: z.ZodString;
271
+ name: z.ZodString;
272
+ visible: z.ZodDefault<z.ZodBoolean>;
273
+ locked: z.ZodDefault<z.ZodBoolean>;
274
+ explode: z.ZodOptional<z.ZodObject<{
275
+ dx: z.ZodNumber;
276
+ dy: z.ZodNumber;
277
+ }, z.core.$strip>>;
278
+ items: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
279
+ type: z.ZodLiteral<"line">;
280
+ a: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
281
+ b: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
282
+ stroke: z.ZodDefault<z.ZodObject<{
283
+ width: z.ZodDefault<z.ZodNumber>;
284
+ style: z.ZodDefault<z.ZodEnum<{
285
+ solid: "solid";
286
+ dashed: "dashed";
287
+ centre: "centre";
288
+ phantom: "phantom";
289
+ }>>;
290
+ }, z.core.$strip>>;
291
+ id: z.ZodString;
292
+ name: z.ZodOptional<z.ZodString>;
293
+ rotation: z.ZodDefault<z.ZodNumber>;
294
+ locked: z.ZodDefault<z.ZodBoolean>;
295
+ hidden: z.ZodDefault<z.ZodBoolean>;
296
+ }, z.core.$strip>, z.ZodObject<{
297
+ type: z.ZodLiteral<"polyline">;
298
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
299
+ closed: z.ZodDefault<z.ZodBoolean>;
300
+ fill: z.ZodDefault<z.ZodEnum<{
301
+ none: "none";
302
+ black: "black";
303
+ white: "white";
304
+ }>>;
305
+ stroke: z.ZodDefault<z.ZodObject<{
306
+ width: z.ZodDefault<z.ZodNumber>;
307
+ style: z.ZodDefault<z.ZodEnum<{
308
+ solid: "solid";
309
+ dashed: "dashed";
310
+ centre: "centre";
311
+ phantom: "phantom";
312
+ }>>;
313
+ }, z.core.$strip>>;
314
+ id: z.ZodString;
315
+ name: z.ZodOptional<z.ZodString>;
316
+ rotation: z.ZodDefault<z.ZodNumber>;
317
+ locked: z.ZodDefault<z.ZodBoolean>;
318
+ hidden: z.ZodDefault<z.ZodBoolean>;
319
+ }, z.core.$strip>, z.ZodObject<{
320
+ type: z.ZodLiteral<"path">;
321
+ d: z.ZodString;
322
+ fill: z.ZodDefault<z.ZodEnum<{
323
+ none: "none";
324
+ black: "black";
325
+ white: "white";
326
+ }>>;
327
+ stroke: z.ZodDefault<z.ZodObject<{
328
+ width: z.ZodDefault<z.ZodNumber>;
329
+ style: z.ZodDefault<z.ZodEnum<{
330
+ solid: "solid";
331
+ dashed: "dashed";
332
+ centre: "centre";
333
+ phantom: "phantom";
334
+ }>>;
335
+ }, z.core.$strip>>;
336
+ id: z.ZodString;
337
+ name: z.ZodOptional<z.ZodString>;
338
+ rotation: z.ZodDefault<z.ZodNumber>;
339
+ locked: z.ZodDefault<z.ZodBoolean>;
340
+ hidden: z.ZodDefault<z.ZodBoolean>;
341
+ }, z.core.$strip>, z.ZodObject<{
342
+ type: z.ZodLiteral<"rect">;
343
+ x: z.ZodNumber;
344
+ y: z.ZodNumber;
345
+ w: z.ZodNumber;
346
+ h: z.ZodNumber;
347
+ radius: z.ZodDefault<z.ZodNumber>;
348
+ fill: z.ZodDefault<z.ZodEnum<{
349
+ none: "none";
350
+ black: "black";
351
+ white: "white";
352
+ }>>;
353
+ stroke: z.ZodDefault<z.ZodObject<{
354
+ width: z.ZodDefault<z.ZodNumber>;
355
+ style: z.ZodDefault<z.ZodEnum<{
356
+ solid: "solid";
357
+ dashed: "dashed";
358
+ centre: "centre";
359
+ phantom: "phantom";
360
+ }>>;
361
+ }, z.core.$strip>>;
362
+ id: z.ZodString;
363
+ name: z.ZodOptional<z.ZodString>;
364
+ rotation: z.ZodDefault<z.ZodNumber>;
365
+ locked: z.ZodDefault<z.ZodBoolean>;
366
+ hidden: z.ZodDefault<z.ZodBoolean>;
367
+ }, z.core.$strip>, z.ZodObject<{
368
+ type: z.ZodLiteral<"ellipse">;
369
+ cx: z.ZodNumber;
370
+ cy: z.ZodNumber;
371
+ rx: z.ZodNumber;
372
+ ry: z.ZodNumber;
373
+ fill: z.ZodDefault<z.ZodEnum<{
374
+ none: "none";
375
+ black: "black";
376
+ white: "white";
377
+ }>>;
378
+ stroke: z.ZodDefault<z.ZodObject<{
379
+ width: z.ZodDefault<z.ZodNumber>;
380
+ style: z.ZodDefault<z.ZodEnum<{
381
+ solid: "solid";
382
+ dashed: "dashed";
383
+ centre: "centre";
384
+ phantom: "phantom";
385
+ }>>;
386
+ }, z.core.$strip>>;
387
+ id: z.ZodString;
388
+ name: z.ZodOptional<z.ZodString>;
389
+ rotation: z.ZodDefault<z.ZodNumber>;
390
+ locked: z.ZodDefault<z.ZodBoolean>;
391
+ hidden: z.ZodDefault<z.ZodBoolean>;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ type: z.ZodLiteral<"arc">;
394
+ cx: z.ZodNumber;
395
+ cy: z.ZodNumber;
396
+ r: z.ZodNumber;
397
+ start: z.ZodNumber;
398
+ end: z.ZodNumber;
399
+ stroke: z.ZodDefault<z.ZodObject<{
400
+ width: z.ZodDefault<z.ZodNumber>;
401
+ style: z.ZodDefault<z.ZodEnum<{
402
+ solid: "solid";
403
+ dashed: "dashed";
404
+ centre: "centre";
405
+ phantom: "phantom";
406
+ }>>;
407
+ }, z.core.$strip>>;
408
+ id: z.ZodString;
409
+ name: z.ZodOptional<z.ZodString>;
410
+ rotation: z.ZodDefault<z.ZodNumber>;
411
+ locked: z.ZodDefault<z.ZodBoolean>;
412
+ hidden: z.ZodDefault<z.ZodBoolean>;
413
+ }, z.core.$strip>, z.ZodObject<{
414
+ type: z.ZodLiteral<"text">;
415
+ x: z.ZodNumber;
416
+ y: z.ZodNumber;
417
+ text: z.ZodString;
418
+ size: z.ZodDefault<z.ZodNumber>;
419
+ anchor: z.ZodDefault<z.ZodEnum<{
420
+ start: "start";
421
+ end: "end";
422
+ middle: "middle";
423
+ }>>;
424
+ id: z.ZodString;
425
+ name: z.ZodOptional<z.ZodString>;
426
+ rotation: z.ZodDefault<z.ZodNumber>;
427
+ locked: z.ZodDefault<z.ZodBoolean>;
428
+ hidden: z.ZodDefault<z.ZodBoolean>;
429
+ }, z.core.$strip>, z.ZodObject<{
430
+ type: z.ZodLiteral<"numeral">;
431
+ n: z.ZodString;
432
+ at: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
433
+ target: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
434
+ leader: z.ZodDefault<z.ZodEnum<{
435
+ none: "none";
436
+ straight: "straight";
437
+ curved: "curved";
438
+ }>>;
439
+ underline: z.ZodDefault<z.ZodBoolean>;
440
+ size: z.ZodDefault<z.ZodNumber>;
441
+ id: z.ZodString;
442
+ name: z.ZodOptional<z.ZodString>;
443
+ rotation: z.ZodDefault<z.ZodNumber>;
444
+ locked: z.ZodDefault<z.ZodBoolean>;
445
+ hidden: z.ZodDefault<z.ZodBoolean>;
446
+ }, z.core.$strip>, z.ZodObject<{
447
+ type: z.ZodLiteral<"figLabel">;
448
+ x: z.ZodNumber;
449
+ y: z.ZodNumber;
450
+ size: z.ZodDefault<z.ZodNumber>;
451
+ id: z.ZodString;
452
+ name: z.ZodOptional<z.ZodString>;
453
+ rotation: z.ZodDefault<z.ZodNumber>;
454
+ locked: z.ZodDefault<z.ZodBoolean>;
455
+ hidden: z.ZodDefault<z.ZodBoolean>;
456
+ }, z.core.$strip>, z.ZodObject<{
457
+ type: z.ZodLiteral<"connector">;
458
+ from: z.ZodUnion<readonly [z.ZodObject<{
459
+ itemId: z.ZodString;
460
+ }, z.core.$strip>, z.ZodObject<{
461
+ point: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
462
+ }, z.core.$strip>]>;
463
+ to: z.ZodUnion<readonly [z.ZodObject<{
464
+ itemId: z.ZodString;
465
+ }, z.core.$strip>, z.ZodObject<{
466
+ point: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
467
+ }, z.core.$strip>]>;
468
+ routing: z.ZodDefault<z.ZodEnum<{
469
+ straight: "straight";
470
+ curved: "curved";
471
+ orthogonal: "orthogonal";
472
+ }>>;
473
+ fromSide: z.ZodOptional<z.ZodEnum<{
474
+ top: "top";
475
+ bottom: "bottom";
476
+ left: "left";
477
+ right: "right";
478
+ }>>;
479
+ toSide: z.ZodOptional<z.ZodEnum<{
480
+ top: "top";
481
+ bottom: "bottom";
482
+ left: "left";
483
+ right: "right";
484
+ }>>;
485
+ arrow: z.ZodDefault<z.ZodEnum<{
486
+ none: "none";
487
+ start: "start";
488
+ end: "end";
489
+ both: "both";
490
+ }>>;
491
+ arrowStyle: z.ZodDefault<z.ZodEnum<{
492
+ filled: "filled";
493
+ open: "open";
494
+ }>>;
495
+ label: z.ZodOptional<z.ZodString>;
496
+ stroke: z.ZodDefault<z.ZodObject<{
497
+ width: z.ZodDefault<z.ZodNumber>;
498
+ style: z.ZodDefault<z.ZodEnum<{
499
+ solid: "solid";
500
+ dashed: "dashed";
501
+ centre: "centre";
502
+ phantom: "phantom";
503
+ }>>;
504
+ }, z.core.$strip>>;
505
+ id: z.ZodString;
506
+ name: z.ZodOptional<z.ZodString>;
507
+ rotation: z.ZodDefault<z.ZodNumber>;
508
+ locked: z.ZodDefault<z.ZodBoolean>;
509
+ hidden: z.ZodDefault<z.ZodBoolean>;
510
+ }, z.core.$strip>, z.ZodObject<{
511
+ type: z.ZodLiteral<"hatch">;
512
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
513
+ angle: z.ZodDefault<z.ZodNumber>;
514
+ spacing: z.ZodDefault<z.ZodNumber>;
515
+ lineWidth: z.ZodDefault<z.ZodNumber>;
516
+ id: z.ZodString;
517
+ name: z.ZodOptional<z.ZodString>;
518
+ rotation: z.ZodDefault<z.ZodNumber>;
519
+ locked: z.ZodDefault<z.ZodBoolean>;
520
+ hidden: z.ZodDefault<z.ZodBoolean>;
521
+ }, z.core.$strip>, z.ZodObject<{
522
+ type: z.ZodLiteral<"sectionLine">;
523
+ a: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
524
+ b: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
525
+ label: z.ZodString;
526
+ stroke: z.ZodDefault<z.ZodObject<{
527
+ width: z.ZodDefault<z.ZodNumber>;
528
+ style: z.ZodDefault<z.ZodEnum<{
529
+ solid: "solid";
530
+ dashed: "dashed";
531
+ centre: "centre";
532
+ phantom: "phantom";
533
+ }>>;
534
+ }, z.core.$strip>>;
535
+ id: z.ZodString;
536
+ name: z.ZodOptional<z.ZodString>;
537
+ rotation: z.ZodDefault<z.ZodNumber>;
538
+ locked: z.ZodDefault<z.ZodBoolean>;
539
+ hidden: z.ZodDefault<z.ZodBoolean>;
540
+ }, z.core.$strip>], "type">>>;
541
+ }, z.core.$strip>;
542
+ type Layer = z.infer<typeof Layer>;
543
+ declare const JurisdictionId: z.ZodEnum<{
544
+ uspto: "uspto";
545
+ pct: "pct";
546
+ epo: "epo";
547
+ ipo: "ipo";
548
+ }>;
549
+ type JurisdictionId = z.infer<typeof JurisdictionId>;
550
+ declare const Sheet: z.ZodObject<{
551
+ size: z.ZodDefault<z.ZodEnum<{
552
+ a4: "a4";
553
+ letter: "letter";
554
+ }>>;
555
+ orientation: z.ZodDefault<z.ZodEnum<{
556
+ portrait: "portrait";
557
+ landscape: "landscape";
558
+ }>>;
559
+ }, z.core.$strip>;
560
+ type Sheet = z.infer<typeof Sheet>;
561
+ /** Lettering style, e.g. bold numerals and an italic serif "FIG. 1" as in many US filings. */
562
+ declare const LetteringStyle: z.ZodObject<{
563
+ numeralWeight: z.ZodDefault<z.ZodEnum<{
564
+ regular: "regular";
565
+ bold: "bold";
566
+ }>>;
567
+ figLabel: z.ZodDefault<z.ZodEnum<{
568
+ "sans-bold": "sans-bold";
569
+ "serif-italic": "serif-italic";
570
+ }>>;
571
+ }, z.core.$strip>;
572
+ type LetteringStyle = z.infer<typeof LetteringStyle>;
573
+ /** Reference numeral registry: "102" -> "housing". Shared with the spec. */
574
+ declare const NumeralRegistry: z.ZodRecord<z.ZodString, z.ZodString>;
575
+ type NumeralRegistry = z.infer<typeof NumeralRegistry>;
576
+ declare const PatentDocument: z.ZodObject<{
577
+ version: z.ZodDefault<z.ZodLiteral<1>>;
578
+ id: z.ZodString;
579
+ figureNumber: z.ZodString;
580
+ jurisdiction: z.ZodDefault<z.ZodEnum<{
581
+ uspto: "uspto";
582
+ pct: "pct";
583
+ epo: "epo";
584
+ ipo: "ipo";
585
+ }>>;
586
+ sheet: z.ZodDefault<z.ZodObject<{
587
+ size: z.ZodDefault<z.ZodEnum<{
588
+ a4: "a4";
589
+ letter: "letter";
590
+ }>>;
591
+ orientation: z.ZodDefault<z.ZodEnum<{
592
+ portrait: "portrait";
593
+ landscape: "landscape";
594
+ }>>;
595
+ }, z.core.$strip>>;
596
+ layers: z.ZodDefault<z.ZodArray<z.ZodObject<{
597
+ id: z.ZodString;
598
+ name: z.ZodString;
599
+ visible: z.ZodDefault<z.ZodBoolean>;
600
+ locked: z.ZodDefault<z.ZodBoolean>;
601
+ explode: z.ZodOptional<z.ZodObject<{
602
+ dx: z.ZodNumber;
603
+ dy: z.ZodNumber;
604
+ }, z.core.$strip>>;
605
+ items: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
606
+ type: z.ZodLiteral<"line">;
607
+ a: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
608
+ b: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
609
+ stroke: z.ZodDefault<z.ZodObject<{
610
+ width: z.ZodDefault<z.ZodNumber>;
611
+ style: z.ZodDefault<z.ZodEnum<{
612
+ solid: "solid";
613
+ dashed: "dashed";
614
+ centre: "centre";
615
+ phantom: "phantom";
616
+ }>>;
617
+ }, z.core.$strip>>;
618
+ id: z.ZodString;
619
+ name: z.ZodOptional<z.ZodString>;
620
+ rotation: z.ZodDefault<z.ZodNumber>;
621
+ locked: z.ZodDefault<z.ZodBoolean>;
622
+ hidden: z.ZodDefault<z.ZodBoolean>;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ type: z.ZodLiteral<"polyline">;
625
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
626
+ closed: z.ZodDefault<z.ZodBoolean>;
627
+ fill: z.ZodDefault<z.ZodEnum<{
628
+ none: "none";
629
+ black: "black";
630
+ white: "white";
631
+ }>>;
632
+ stroke: z.ZodDefault<z.ZodObject<{
633
+ width: z.ZodDefault<z.ZodNumber>;
634
+ style: z.ZodDefault<z.ZodEnum<{
635
+ solid: "solid";
636
+ dashed: "dashed";
637
+ centre: "centre";
638
+ phantom: "phantom";
639
+ }>>;
640
+ }, z.core.$strip>>;
641
+ id: z.ZodString;
642
+ name: z.ZodOptional<z.ZodString>;
643
+ rotation: z.ZodDefault<z.ZodNumber>;
644
+ locked: z.ZodDefault<z.ZodBoolean>;
645
+ hidden: z.ZodDefault<z.ZodBoolean>;
646
+ }, z.core.$strip>, z.ZodObject<{
647
+ type: z.ZodLiteral<"path">;
648
+ d: z.ZodString;
649
+ fill: z.ZodDefault<z.ZodEnum<{
650
+ none: "none";
651
+ black: "black";
652
+ white: "white";
653
+ }>>;
654
+ stroke: z.ZodDefault<z.ZodObject<{
655
+ width: z.ZodDefault<z.ZodNumber>;
656
+ style: z.ZodDefault<z.ZodEnum<{
657
+ solid: "solid";
658
+ dashed: "dashed";
659
+ centre: "centre";
660
+ phantom: "phantom";
661
+ }>>;
662
+ }, z.core.$strip>>;
663
+ id: z.ZodString;
664
+ name: z.ZodOptional<z.ZodString>;
665
+ rotation: z.ZodDefault<z.ZodNumber>;
666
+ locked: z.ZodDefault<z.ZodBoolean>;
667
+ hidden: z.ZodDefault<z.ZodBoolean>;
668
+ }, z.core.$strip>, z.ZodObject<{
669
+ type: z.ZodLiteral<"rect">;
670
+ x: z.ZodNumber;
671
+ y: z.ZodNumber;
672
+ w: z.ZodNumber;
673
+ h: z.ZodNumber;
674
+ radius: z.ZodDefault<z.ZodNumber>;
675
+ fill: z.ZodDefault<z.ZodEnum<{
676
+ none: "none";
677
+ black: "black";
678
+ white: "white";
679
+ }>>;
680
+ stroke: z.ZodDefault<z.ZodObject<{
681
+ width: z.ZodDefault<z.ZodNumber>;
682
+ style: z.ZodDefault<z.ZodEnum<{
683
+ solid: "solid";
684
+ dashed: "dashed";
685
+ centre: "centre";
686
+ phantom: "phantom";
687
+ }>>;
688
+ }, z.core.$strip>>;
689
+ id: z.ZodString;
690
+ name: z.ZodOptional<z.ZodString>;
691
+ rotation: z.ZodDefault<z.ZodNumber>;
692
+ locked: z.ZodDefault<z.ZodBoolean>;
693
+ hidden: z.ZodDefault<z.ZodBoolean>;
694
+ }, z.core.$strip>, z.ZodObject<{
695
+ type: z.ZodLiteral<"ellipse">;
696
+ cx: z.ZodNumber;
697
+ cy: z.ZodNumber;
698
+ rx: z.ZodNumber;
699
+ ry: z.ZodNumber;
700
+ fill: z.ZodDefault<z.ZodEnum<{
701
+ none: "none";
702
+ black: "black";
703
+ white: "white";
704
+ }>>;
705
+ stroke: z.ZodDefault<z.ZodObject<{
706
+ width: z.ZodDefault<z.ZodNumber>;
707
+ style: z.ZodDefault<z.ZodEnum<{
708
+ solid: "solid";
709
+ dashed: "dashed";
710
+ centre: "centre";
711
+ phantom: "phantom";
712
+ }>>;
713
+ }, z.core.$strip>>;
714
+ id: z.ZodString;
715
+ name: z.ZodOptional<z.ZodString>;
716
+ rotation: z.ZodDefault<z.ZodNumber>;
717
+ locked: z.ZodDefault<z.ZodBoolean>;
718
+ hidden: z.ZodDefault<z.ZodBoolean>;
719
+ }, z.core.$strip>, z.ZodObject<{
720
+ type: z.ZodLiteral<"arc">;
721
+ cx: z.ZodNumber;
722
+ cy: z.ZodNumber;
723
+ r: z.ZodNumber;
724
+ start: z.ZodNumber;
725
+ end: z.ZodNumber;
726
+ stroke: z.ZodDefault<z.ZodObject<{
727
+ width: z.ZodDefault<z.ZodNumber>;
728
+ style: z.ZodDefault<z.ZodEnum<{
729
+ solid: "solid";
730
+ dashed: "dashed";
731
+ centre: "centre";
732
+ phantom: "phantom";
733
+ }>>;
734
+ }, z.core.$strip>>;
735
+ id: z.ZodString;
736
+ name: z.ZodOptional<z.ZodString>;
737
+ rotation: z.ZodDefault<z.ZodNumber>;
738
+ locked: z.ZodDefault<z.ZodBoolean>;
739
+ hidden: z.ZodDefault<z.ZodBoolean>;
740
+ }, z.core.$strip>, z.ZodObject<{
741
+ type: z.ZodLiteral<"text">;
742
+ x: z.ZodNumber;
743
+ y: z.ZodNumber;
744
+ text: z.ZodString;
745
+ size: z.ZodDefault<z.ZodNumber>;
746
+ anchor: z.ZodDefault<z.ZodEnum<{
747
+ start: "start";
748
+ end: "end";
749
+ middle: "middle";
750
+ }>>;
751
+ id: z.ZodString;
752
+ name: z.ZodOptional<z.ZodString>;
753
+ rotation: z.ZodDefault<z.ZodNumber>;
754
+ locked: z.ZodDefault<z.ZodBoolean>;
755
+ hidden: z.ZodDefault<z.ZodBoolean>;
756
+ }, z.core.$strip>, z.ZodObject<{
757
+ type: z.ZodLiteral<"numeral">;
758
+ n: z.ZodString;
759
+ at: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
760
+ target: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
761
+ leader: z.ZodDefault<z.ZodEnum<{
762
+ none: "none";
763
+ straight: "straight";
764
+ curved: "curved";
765
+ }>>;
766
+ underline: z.ZodDefault<z.ZodBoolean>;
767
+ size: z.ZodDefault<z.ZodNumber>;
768
+ id: z.ZodString;
769
+ name: z.ZodOptional<z.ZodString>;
770
+ rotation: z.ZodDefault<z.ZodNumber>;
771
+ locked: z.ZodDefault<z.ZodBoolean>;
772
+ hidden: z.ZodDefault<z.ZodBoolean>;
773
+ }, z.core.$strip>, z.ZodObject<{
774
+ type: z.ZodLiteral<"figLabel">;
775
+ x: z.ZodNumber;
776
+ y: z.ZodNumber;
777
+ size: z.ZodDefault<z.ZodNumber>;
778
+ id: z.ZodString;
779
+ name: z.ZodOptional<z.ZodString>;
780
+ rotation: z.ZodDefault<z.ZodNumber>;
781
+ locked: z.ZodDefault<z.ZodBoolean>;
782
+ hidden: z.ZodDefault<z.ZodBoolean>;
783
+ }, z.core.$strip>, z.ZodObject<{
784
+ type: z.ZodLiteral<"connector">;
785
+ from: z.ZodUnion<readonly [z.ZodObject<{
786
+ itemId: z.ZodString;
787
+ }, z.core.$strip>, z.ZodObject<{
788
+ point: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
789
+ }, z.core.$strip>]>;
790
+ to: z.ZodUnion<readonly [z.ZodObject<{
791
+ itemId: z.ZodString;
792
+ }, z.core.$strip>, z.ZodObject<{
793
+ point: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
794
+ }, z.core.$strip>]>;
795
+ routing: z.ZodDefault<z.ZodEnum<{
796
+ straight: "straight";
797
+ curved: "curved";
798
+ orthogonal: "orthogonal";
799
+ }>>;
800
+ fromSide: z.ZodOptional<z.ZodEnum<{
801
+ top: "top";
802
+ bottom: "bottom";
803
+ left: "left";
804
+ right: "right";
805
+ }>>;
806
+ toSide: z.ZodOptional<z.ZodEnum<{
807
+ top: "top";
808
+ bottom: "bottom";
809
+ left: "left";
810
+ right: "right";
811
+ }>>;
812
+ arrow: z.ZodDefault<z.ZodEnum<{
813
+ none: "none";
814
+ start: "start";
815
+ end: "end";
816
+ both: "both";
817
+ }>>;
818
+ arrowStyle: z.ZodDefault<z.ZodEnum<{
819
+ filled: "filled";
820
+ open: "open";
821
+ }>>;
822
+ label: z.ZodOptional<z.ZodString>;
823
+ stroke: z.ZodDefault<z.ZodObject<{
824
+ width: z.ZodDefault<z.ZodNumber>;
825
+ style: z.ZodDefault<z.ZodEnum<{
826
+ solid: "solid";
827
+ dashed: "dashed";
828
+ centre: "centre";
829
+ phantom: "phantom";
830
+ }>>;
831
+ }, z.core.$strip>>;
832
+ id: z.ZodString;
833
+ name: z.ZodOptional<z.ZodString>;
834
+ rotation: z.ZodDefault<z.ZodNumber>;
835
+ locked: z.ZodDefault<z.ZodBoolean>;
836
+ hidden: z.ZodDefault<z.ZodBoolean>;
837
+ }, z.core.$strip>, z.ZodObject<{
838
+ type: z.ZodLiteral<"hatch">;
839
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
840
+ angle: z.ZodDefault<z.ZodNumber>;
841
+ spacing: z.ZodDefault<z.ZodNumber>;
842
+ lineWidth: z.ZodDefault<z.ZodNumber>;
843
+ id: z.ZodString;
844
+ name: z.ZodOptional<z.ZodString>;
845
+ rotation: z.ZodDefault<z.ZodNumber>;
846
+ locked: z.ZodDefault<z.ZodBoolean>;
847
+ hidden: z.ZodDefault<z.ZodBoolean>;
848
+ }, z.core.$strip>, z.ZodObject<{
849
+ type: z.ZodLiteral<"sectionLine">;
850
+ a: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
851
+ b: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
852
+ label: z.ZodString;
853
+ stroke: z.ZodDefault<z.ZodObject<{
854
+ width: z.ZodDefault<z.ZodNumber>;
855
+ style: z.ZodDefault<z.ZodEnum<{
856
+ solid: "solid";
857
+ dashed: "dashed";
858
+ centre: "centre";
859
+ phantom: "phantom";
860
+ }>>;
861
+ }, z.core.$strip>>;
862
+ id: z.ZodString;
863
+ name: z.ZodOptional<z.ZodString>;
864
+ rotation: z.ZodDefault<z.ZodNumber>;
865
+ locked: z.ZodDefault<z.ZodBoolean>;
866
+ hidden: z.ZodDefault<z.ZodBoolean>;
867
+ }, z.core.$strip>], "type">>>;
868
+ }, z.core.$strip>>>;
869
+ numerals: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
870
+ lettering: z.ZodDefault<z.ZodObject<{
871
+ numeralWeight: z.ZodDefault<z.ZodEnum<{
872
+ regular: "regular";
873
+ bold: "bold";
874
+ }>>;
875
+ figLabel: z.ZodDefault<z.ZodEnum<{
876
+ "sans-bold": "sans-bold";
877
+ "serif-italic": "serif-italic";
878
+ }>>;
879
+ }, z.core.$strip>>;
880
+ view: z.ZodDefault<z.ZodEnum<{
881
+ composite: "composite";
882
+ exploded: "exploded";
883
+ }>>;
884
+ explodeLines: z.ZodDefault<z.ZodBoolean>;
885
+ sheetLabel: z.ZodOptional<z.ZodString>;
886
+ chat: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
887
+ }, z.core.$strip>;
888
+ type PatentDocument = z.infer<typeof PatentDocument>;
889
+ /**
890
+ * Brings a stored document up to the current schema: fills defaults for
891
+ * fields added since it was saved (e.g. `lettering`) and validates it.
892
+ * Call this on anything loaded from storage before handing it to the editor.
893
+ */
894
+ declare function normalizeDocument(input: unknown): PatentDocument;
895
+ declare function createDocument(init: {
896
+ id: string;
897
+ figureNumber: string;
898
+ jurisdiction?: JurisdictionId;
899
+ numerals?: NumeralRegistry;
900
+ }): PatentDocument;
901
+
902
+ declare const Patch: z.ZodType<Patch, unknown>;
903
+ type Patch = {
904
+ op: "addLayer";
905
+ layer: Layer;
906
+ index?: number;
907
+ } | {
908
+ op: "updateLayer";
909
+ id: string;
910
+ changes: Partial<Omit<Layer, "id" | "items">>;
911
+ } | {
912
+ op: "removeLayer";
913
+ id: string;
914
+ } | {
915
+ op: "moveLayer";
916
+ id: string;
917
+ toIndex: number;
918
+ } | {
919
+ op: "addItem";
920
+ layerId: string;
921
+ item: Item;
922
+ index?: number;
923
+ } | {
924
+ op: "updateItem";
925
+ id: string;
926
+ changes: Record<string, unknown>;
927
+ } | {
928
+ op: "removeItem";
929
+ id: string;
930
+ } | {
931
+ op: "moveItem";
932
+ id: string;
933
+ toLayerId: string;
934
+ toIndex?: number;
935
+ } | {
936
+ op: "setNumeral";
937
+ n: string;
938
+ label: string | null;
939
+ } | {
940
+ op: "setSheet";
941
+ sheet: Sheet;
942
+ } | {
943
+ op: "setJurisdiction";
944
+ jurisdiction: JurisdictionId;
945
+ } | {
946
+ op: "setLettering";
947
+ lettering: LetteringStyle;
948
+ } | {
949
+ op: "setView";
950
+ view: "composite" | "exploded";
951
+ explodeLines?: boolean;
952
+ } | {
953
+ op: "setSheetLabel";
954
+ sheetLabel: string | null;
955
+ } | {
956
+ op: "batch";
957
+ patches: Patch[];
958
+ };
959
+
960
+ /** Structured output of the prompt-enhancer agent, shown as a plan card in chat. */
961
+ declare const FigureType: z.ZodEnum<{
962
+ flowchart: "flowchart";
963
+ blockDiagram: "blockDiagram";
964
+ mechanical2d: "mechanical2d";
965
+ uiScreen: "uiScreen";
966
+ perspective3d: "perspective3d";
967
+ circuit: "circuit";
968
+ chemical: "chemical";
969
+ }>;
970
+ type FigureType = z.infer<typeof FigureType>;
971
+ declare const FigurePlan: z.ZodObject<{
972
+ figureType: z.ZodEnum<{
973
+ flowchart: "flowchart";
974
+ blockDiagram: "blockDiagram";
975
+ mechanical2d: "mechanical2d";
976
+ uiScreen: "uiScreen";
977
+ perspective3d: "perspective3d";
978
+ circuit: "circuit";
979
+ chemical: "chemical";
980
+ }>;
981
+ view: z.ZodString;
982
+ summary: z.ZodString;
983
+ spec: z.ZodDefault<z.ZodString>;
984
+ components: z.ZodArray<z.ZodObject<{
985
+ numeral: z.ZodString;
986
+ name: z.ZodString;
987
+ description: z.ZodOptional<z.ZodString>;
988
+ reused: z.ZodDefault<z.ZodBoolean>;
989
+ }, z.core.$strip>>;
990
+ layers: z.ZodArray<z.ZodObject<{
991
+ id: z.ZodString;
992
+ name: z.ZodString;
993
+ }, z.core.$strip>>;
994
+ notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
995
+ }, z.core.$strip>;
996
+ type FigurePlan = z.infer<typeof FigurePlan>;
997
+ /** Per-message generation preferences from the composer pickers. */
998
+ declare const GenerationPrefs: z.ZodObject<{
999
+ figureType: z.ZodOptional<z.ZodEnum<{
1000
+ flowchart: "flowchart";
1001
+ blockDiagram: "blockDiagram";
1002
+ mechanical2d: "mechanical2d";
1003
+ uiScreen: "uiScreen";
1004
+ perspective3d: "perspective3d";
1005
+ circuit: "circuit";
1006
+ chemical: "chemical";
1007
+ }>>;
1008
+ style: z.ZodDefault<z.ZodEnum<{
1009
+ standard: "standard";
1010
+ detailed: "detailed";
1011
+ minimal: "minimal";
1012
+ }>>;
1013
+ }, z.core.$strip>;
1014
+ type GenerationPrefs = z.infer<typeof GenerationPrefs>;
1015
+
1016
+ /**
1017
+ * Wire contract between the PatentRender client and its server handler.
1018
+ * Imported by both sides, so it must stay free of server-only code.
1019
+ */
1020
+ /** Context patent-os passes about the application the figure belongs to. */
1021
+ interface PatentContext {
1022
+ title?: string;
1023
+ claims?: string;
1024
+ specExcerpt?: string;
1025
+ /** Existing reference numerals across the application, e.g. { "102": "housing" }. */
1026
+ numeralRegistry?: NumeralRegistry;
1027
+ }
1028
+ /** Sent with every chat request as `forwardedProps` (via sendMessage `body`). */
1029
+ interface PatentRenderRequestBody {
1030
+ document: PatentDocument;
1031
+ selection: string[];
1032
+ context?: PatentContext;
1033
+ /** Figure type and drawing style picked in the composer. */
1034
+ preferences?: GenerationPrefs;
1035
+ }
1036
+
1037
+ interface Margins {
1038
+ top: number;
1039
+ left: number;
1040
+ right: number;
1041
+ bottom: number;
1042
+ }
1043
+ interface TextPolicy {
1044
+ /**
1045
+ * "lenient": short legends allowed broadly (USPTO 1.84(o) legends).
1046
+ * "strict": text only when indispensable; flowchart/block catchwords allowed
1047
+ * (PCT Rule 11.11, EPC Rule 46(2)(j)).
1048
+ */
1049
+ mode: "lenient" | "strict";
1050
+ /** Max words in a single free text item before a warning. */
1051
+ maxWordsPerText: number;
1052
+ /** Max words in a connector/flowchart label before a warning. */
1053
+ maxWordsPerCatchword: number;
1054
+ }
1055
+ interface JurisdictionProfile {
1056
+ id: JurisdictionId;
1057
+ name: string;
1058
+ citation: string;
1059
+ sheetSizes: Array<"a4" | "letter">;
1060
+ /** Minimum margins in mm, defined for a portrait sheet. */
1061
+ margins: Margins;
1062
+ /** Minimum cap height for numerals, letters, figure labels (mm). */
1063
+ minCapHeight: number;
1064
+ /** Below this line width, warn that lines may not reproduce (mm). */
1065
+ minStrokeWidth: number;
1066
+ text: TextPolicy;
1067
+ }
1068
+ declare const PROFILES: Record<JurisdictionId, JurisdictionProfile>;
1069
+
1070
+ type Severity = "error" | "warning";
1071
+ interface Issue {
1072
+ rule: string;
1073
+ severity: Severity;
1074
+ message: string;
1075
+ itemId?: string;
1076
+ layerId?: string;
1077
+ }
1078
+ interface ComplianceReport {
1079
+ jurisdiction: PatentDocument["jurisdiction"];
1080
+ ok: boolean;
1081
+ errors: Issue[];
1082
+ warnings: Issue[];
1083
+ }
1084
+ /** Visible items only: hidden layers/items are excluded from export. */
1085
+ interface VisibleItem {
1086
+ item: Item;
1087
+ layerId: string;
1088
+ }
1089
+ interface RuleContext {
1090
+ doc: PatentDocument;
1091
+ profile: JurisdictionProfile;
1092
+ items: VisibleItem[];
1093
+ }
1094
+ type Rule = (ctx: RuleContext) => Issue[];
1095
+ declare function validate(model: PatentDocument, rules?: Rule[]): ComplianceReport;
1096
+
1097
+ /**
1098
+ * Flowchart / block-diagram shape library (draw.io-style), shared by the
1099
+ * toolbar palette and the agent's layout_graph tool so both draw identically.
1100
+ */
1101
+ declare const SHAPE_KINDS: readonly ["process", "block", "decision", "terminal", "io", "document", "database", "subroutine", "manualInput", "preparation", "manualOperation", "delay", "display", "storedData", "connector", "offPage", "annotation"];
1102
+ type ShapeKind = (typeof SHAPE_KINDS)[number];
1103
+
1104
+ type ToolId = "select" | "pan" | "line" | "rect" | "ellipse" | "polyline" | "shape" | "connector" | "numeral" | "text" | "hatch" | "sectionLine";
1105
+ interface ViewState {
1106
+ zoom: number;
1107
+ panX: number;
1108
+ panY: number;
1109
+ }
1110
+ type AgentStatus = "idle" | "enhancing" | "drawing" | "critiquing";
1111
+ interface EditorState {
1112
+ doc: PatentDocument;
1113
+ selection: string[];
1114
+ activeLayerId: string | null;
1115
+ tool: ToolId;
1116
+ view: ViewState | null;
1117
+ snap: boolean;
1118
+ undo: Patch[];
1119
+ redo: Patch[];
1120
+ agent: AgentStatus;
1121
+ /** Flowchart shape armed by the shape palette (used by the "shape" tool). */
1122
+ shapeKind: ShapeKind;
1123
+ /** Inverses of patches applied during the current agent run (one undo step). */
1124
+ agentUndo: Patch[];
1125
+ }
1126
+ interface EditorApi {
1127
+ state: EditorState;
1128
+ report: ComplianceReport;
1129
+ /**
1130
+ * Apply a patch. record=false skips undo (transient); record="agent" groups
1131
+ * the patch into the current agent run's single undo step.
1132
+ */
1133
+ apply: (patch: Patch, opts?: {
1134
+ record?: boolean | "agent";
1135
+ }) => void;
1136
+ undo: () => void;
1137
+ redo: () => void;
1138
+ select: (ids: string[]) => void;
1139
+ setTool: (tool: ToolId) => void;
1140
+ /** Arm the shape tool with a flowchart shape. */
1141
+ setShape: (kind: ShapeKind) => void;
1142
+ setActiveLayer: (id: string) => void;
1143
+ setView: (view: ViewState) => void;
1144
+ setSnap: (on: boolean) => void;
1145
+ setAgent: (status: AgentStatus) => void;
1146
+ replace: (doc: PatentDocument) => void;
1147
+ readOnly: boolean;
1148
+ }
1149
+ declare function EditorProvider({ doc, initial, children, }: {
1150
+ doc: PatentDocument;
1151
+ /** Story/test hook to start in a particular state. */
1152
+ initial?: Partial<EditorState>;
1153
+ children: ReactNode;
1154
+ }): react.JSX.Element;
1155
+ declare function useEditor(): EditorApi;
1156
+
1157
+ /** UI-level chat model. The TanStack AI stream is mapped onto this later. */
1158
+ type ChatPart = {
1159
+ type: "text";
1160
+ text: string;
1161
+ } | {
1162
+ type: "image";
1163
+ url: string;
1164
+ name: string;
1165
+ } | {
1166
+ type: "plan";
1167
+ plan: FigurePlan;
1168
+ } | {
1169
+ type: "progress";
1170
+ steps: Array<{
1171
+ label: string;
1172
+ status: "done" | "active" | "pending";
1173
+ }>;
1174
+ } | {
1175
+ type: "edits";
1176
+ summary: string;
1177
+ count: number;
1178
+ } | {
1179
+ type: "error";
1180
+ message: string;
1181
+ };
1182
+ interface ChatUIMessage {
1183
+ id: string;
1184
+ role: "user" | "assistant";
1185
+ parts: ChatPart[];
1186
+ }
1187
+ interface Attachment {
1188
+ id: string;
1189
+ name: string;
1190
+ url: string;
1191
+ file?: File;
1192
+ }
1193
+ interface ChatDockProps {
1194
+ messages: ChatUIMessage[];
1195
+ status: AgentStatus;
1196
+ onSend: (text: string, attachments: Attachment[], prefs: GenerationPrefs) => void;
1197
+ onStop?: () => void;
1198
+ onEditPlan?: (plan: FigurePlan) => void;
1199
+ /** Height of the message history in px (resizable dock); defaults to a capped auto height. */
1200
+ historyHeight?: number;
1201
+ /** Controlled collapse: hides history and suggestions, keeps the composer. */
1202
+ collapsed?: boolean;
1203
+ onCollapsedChange?: (collapsed: boolean) => void;
1204
+ /** Number of items currently selected on the canvas; sent as context with edits. */
1205
+ selectionCount?: number;
1206
+ className?: string;
1207
+ }
1208
+
1209
+ interface EmbedResult {
1210
+ /** Full editable state; pass back as the initial document to reopen. */
1211
+ document: PatentDocument;
1212
+ svg: string;
1213
+ /** Both views when the figure has explode offsets (file them as separate figures if needed). */
1214
+ views?: {
1215
+ composite: string;
1216
+ exploded: string;
1217
+ };
1218
+ /** 300 dpi PNG data URL, when the host provided an exporter. */
1219
+ png?: string;
1220
+ numerals: PatentDocument["numerals"];
1221
+ complianceReport: ComplianceReport;
1222
+ }
1223
+ interface PatentRenderShellProps {
1224
+ chat: Omit<ChatDockProps, "status" | "selectionCount" | "className">;
1225
+ agentStatus?: AgentStatus;
1226
+ onEmbed?: (result: EmbedResult) => void | Promise<void>;
1227
+ onCancel?: () => void;
1228
+ onChange?: (doc: PatentDocument) => void;
1229
+ className?: string;
1230
+ }
1231
+ interface PatentRenderEditorProps {
1232
+ document: PatentDocument;
1233
+ chat: Omit<ChatDockProps, "status" | "selectionCount" | "className">;
1234
+ agentStatus?: AgentStatus;
1235
+ onEmbed?: (result: EmbedResult) => void | Promise<void>;
1236
+ onCancel?: () => void;
1237
+ onChange?: (doc: PatentDocument) => void;
1238
+ className?: string;
1239
+ /** Start in a given editor state (stories, tests). */
1240
+ initialState?: Partial<EditorState>;
1241
+ /** Rendered inside the editor context, e.g. the agent bridge. */
1242
+ children?: ReactNode;
1243
+ }
1244
+ /**
1245
+ * Presentational editor: canvas, toolbox, layers, inspector, chat dock.
1246
+ * Agent wiring lives outside and drives it through `agentStatus`, `chat` and
1247
+ * patches applied via the editor context.
1248
+ */
1249
+ declare function PatentRenderEditor(props: PatentRenderEditorProps): react.JSX.Element;
1250
+ /** The editor layout. Must be rendered inside <EditorProvider>. */
1251
+ declare function PatentRenderShell({ chat, agentStatus, onEmbed, onCancel, onChange, className }: PatentRenderShellProps): react.JSX.Element;
1252
+
1253
+ interface PatentRenderProps {
1254
+ /** Route where the host mounted createPatentRenderHandler(), e.g. "/api/patent-render". */
1255
+ endpoint: string;
1256
+ /** Existing figure to reopen (from a previous embed or autosave). */
1257
+ document?: PatentDocument;
1258
+ /** Required for new figures: "3", "4A"... */
1259
+ figureNumber?: string;
1260
+ /** Patent office rules to apply to new figures. Defaults to "ipo" (India). */
1261
+ jurisdiction?: JurisdictionId;
1262
+ /** Sheet number for new figures, e.g. "2/5" (patent-os knows the sheet count). */
1263
+ sheetLabel?: string;
1264
+ /** Claims, spec excerpt and numeral registry of the application. */
1265
+ context?: PatentContext;
1266
+ onEmbed: (result: EmbedResult) => void | Promise<void>;
1267
+ onCancel?: () => void;
1268
+ /** Autosave hook: the full document including chat history. */
1269
+ onChange?: (doc: PatentDocument) => void;
1270
+ /**
1271
+ * Server action that renders a 300 dpi PNG (pass `exportPatentPng` from the
1272
+ * server entry). When omitted, the embed result has no PNG.
1273
+ */
1274
+ exportPng?: (document: PatentDocument) => Promise<{
1275
+ dataUrl: string;
1276
+ }>;
1277
+ className?: string;
1278
+ }
1279
+ /**
1280
+ * Patent drawing editor with the AI assistant wired in. Fills its container;
1281
+ * the host wraps it in a dialog.
1282
+ */
1283
+ declare function PatentRender(props: PatentRenderProps): react.JSX.Element;
1284
+
1285
+ interface RenderOptions {
1286
+ /** Include layers/items flagged hidden (editor shows them dimmed; export never). */
1287
+ includeHidden?: boolean;
1288
+ /** Add data-* attributes for hit-testing in the editor. */
1289
+ editorAttrs?: boolean;
1290
+ }
1291
+
1292
+ /** Export-ready SVG: hidden layers/items excluded, no editor attributes. */
1293
+ declare function renderSvg(doc: PatentDocument, opts?: Omit<RenderOptions, "editorAttrs">): string;
1294
+
1295
+ export { type AgentStatus, type ComplianceReport, EditorProvider, type EmbedResult, FigurePlan, FigureType, type Issue, Item, JurisdictionId, Layer, PROFILES, Patch, type PatentContext, PatentDocument, PatentRender, PatentRenderEditor, type PatentRenderEditorProps, type PatentRenderProps, type PatentRenderRequestBody, PatentRenderShell, createDocument, normalizeDocument, renderSvg, useEditor, validate };