@inkbar/react 0.0.0-stage → 0.2.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.
@@ -0,0 +1,1992 @@
1
+ import { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
2
+ import { Annotation, AnnotationChange, AnnotationDefaults, AnnotationDocument, AnnotationInput, ConfidenceBucket, DocumentSource, ImportOptions, InkDocument, InkError, InkStatus, PageInfo, PdfAssets, Readable } from "@inkbar/core";
3
+ import { AnnotationSlotProps, AnnotationSlotProps as AnnotationSlotProps$1, AnnotationState, LayoutMode, NotePopoverSlotProps, NotePopoverSlotProps as NotePopoverSlotProps$1, PageMount, SuggestionCardSlotProps, SuggestionCardSlotProps as SuggestionCardSlotProps$1, ToolController, ToolId, ViewRotation, Viewport, ZoomValue } from "@inkbar/core/dom";
4
+ import { Select } from "radix-ui";
5
+ import { IconNode } from "@inkbar/icons";
6
+ //#region src/context.d.ts
7
+ /** Undo and redo for the current document, whichever mode its annotations are in. */
8
+ interface InkHistory {
9
+ canUndo: boolean;
10
+ canRedo: boolean;
11
+ undo: () => void;
12
+ redo: () => void;
13
+ clear: () => void;
14
+ /**
15
+ * Runs `fn` and records what it changes as one undo step. The host still receives one change
16
+ * per add. Controlled, the history groups the resulting list changes into one step, and
17
+ * `canUndo` updates once the current task ends. Any other change the host applies in that
18
+ * same window joins the step.
19
+ */
20
+ batch: (fn: () => void) => void;
21
+ }
22
+ interface InkContext {
23
+ assets: PdfAssets;
24
+ document: InkDocument | null;
25
+ /** `loading` from the moment a document starts opening, then the document's own status. */
26
+ status: InkStatus;
27
+ annotations: readonly Annotation[];
28
+ selection: readonly string[];
29
+ /** Set by InkViewport once it has built its viewport and tool controller. */
30
+ viewport: Viewport | null;
31
+ tools: ToolController | null;
32
+ /** Desired tool; InkViewport applies it to the controller. */
33
+ tool: ToolId;
34
+ setTool: (id: ToolId) => void;
35
+ /** Desired zoom and page from the host's props; InkViewport applies and reports back. */
36
+ zoomModel: ZoomValue | undefined;
37
+ pageModel: number | undefined;
38
+ reportZoom: (z: ZoomValue) => void;
39
+ reportPage: (p: number) => void;
40
+ /** Last activated annotation (Enter, click with the note tool, etc.). Popovers key off this. */
41
+ activated: string | null;
42
+ setActivated: (id: string | null) => void;
43
+ history: InkHistory;
44
+ rootEl: HTMLElement | null;
45
+ setViewport: (viewport: Viewport | null, tools: ToolController | null) => void;
46
+ }
47
+ /**
48
+ * The context for hooks: throws a readable error when called outside a component rendered
49
+ * inside `InkRoot`.
50
+ */
51
+ export declare function useInkContext(consumer: string): InkContext;
52
+ //#endregion
53
+ //#region src/use-readable.d.ts
54
+ /**
55
+ * Mirrors a core `Readable` into React. A missing readable yields `fallback`, which must be a
56
+ * stable reference (a module constant): `useSyncExternalStore` compares snapshots by identity
57
+ * and loops on a fresh value. On the server the fallback is rendered.
58
+ */
59
+ export declare function useReadable<T>(readable: Readable<T> | null | undefined, fallback: T): T;
60
+ //#endregion
61
+ //#region src/hooks/useDocument.d.ts
62
+ export declare function useDocument(): {
63
+ document: import("@inkbar/core").InkDocument | null;
64
+ status: import("@inkbar/core").InkStatus;
65
+ isReady: boolean;
66
+ error: import("@inkbar/core").InkError | null;
67
+ pages: readonly PageInfo[];
68
+ info: import("@inkbar/core").DocumentInfo | null;
69
+ exportAnnotations: () => AnnotationDocument | undefined;
70
+ importAnnotations: (data: AnnotationDocument | string, opts?: ImportOptions) => import("@inkbar/core").ImportResult | undefined;
71
+ };
72
+ //#endregion
73
+ //#region src/hooks/useAnnotations.d.ts
74
+ export declare function useAnnotations(): {
75
+ add: (input: AnnotationInput) => {
76
+ id: string;
77
+ page: number;
78
+ rect: {
79
+ x: number;
80
+ y: number;
81
+ width: number;
82
+ height: number;
83
+ };
84
+ color: string;
85
+ opacity: number;
86
+ createdAt: string;
87
+ modifiedAt: string;
88
+ source: "session" | "pdf";
89
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
90
+ quads: {
91
+ p1: {
92
+ x: number;
93
+ y: number;
94
+ };
95
+ p2: {
96
+ x: number;
97
+ y: number;
98
+ };
99
+ p3: {
100
+ x: number;
101
+ y: number;
102
+ };
103
+ p4: {
104
+ x: number;
105
+ y: number;
106
+ };
107
+ }[];
108
+ author?: string | undefined;
109
+ contents?: string | undefined;
110
+ inReplyTo?: string | undefined;
111
+ locked?: boolean | undefined;
112
+ custom?: Record<string, unknown> | undefined;
113
+ } | {
114
+ id: string;
115
+ page: number;
116
+ rect: {
117
+ x: number;
118
+ y: number;
119
+ width: number;
120
+ height: number;
121
+ };
122
+ color: string;
123
+ opacity: number;
124
+ createdAt: string;
125
+ modifiedAt: string;
126
+ source: "session" | "pdf";
127
+ type: "note";
128
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
129
+ author?: string | undefined;
130
+ contents?: string | undefined;
131
+ inReplyTo?: string | undefined;
132
+ locked?: boolean | undefined;
133
+ custom?: Record<string, unknown> | undefined;
134
+ } | {
135
+ id: string;
136
+ page: number;
137
+ rect: {
138
+ x: number;
139
+ y: number;
140
+ width: number;
141
+ height: number;
142
+ };
143
+ color: string;
144
+ opacity: number;
145
+ createdAt: string;
146
+ modifiedAt: string;
147
+ source: "session" | "pdf";
148
+ type: "freeText";
149
+ text: string;
150
+ fontSize: number;
151
+ fontFamily: string;
152
+ align: "left" | "center" | "right";
153
+ author?: string | undefined;
154
+ contents?: string | undefined;
155
+ inReplyTo?: string | undefined;
156
+ locked?: boolean | undefined;
157
+ custom?: Record<string, unknown> | undefined;
158
+ callout?: {
159
+ x: number;
160
+ y: number;
161
+ }[] | undefined;
162
+ } | {
163
+ id: string;
164
+ page: number;
165
+ rect: {
166
+ x: number;
167
+ y: number;
168
+ width: number;
169
+ height: number;
170
+ };
171
+ color: string;
172
+ opacity: number;
173
+ createdAt: string;
174
+ modifiedAt: string;
175
+ source: "session" | "pdf";
176
+ type: "square" | "circle";
177
+ strokeWidth: number;
178
+ author?: string | undefined;
179
+ contents?: string | undefined;
180
+ inReplyTo?: string | undefined;
181
+ locked?: boolean | undefined;
182
+ custom?: Record<string, unknown> | undefined;
183
+ fill?: string | undefined;
184
+ } | {
185
+ id: string;
186
+ page: number;
187
+ rect: {
188
+ x: number;
189
+ y: number;
190
+ width: number;
191
+ height: number;
192
+ };
193
+ color: string;
194
+ opacity: number;
195
+ createdAt: string;
196
+ modifiedAt: string;
197
+ source: "session" | "pdf";
198
+ type: "line";
199
+ start: {
200
+ x: number;
201
+ y: number;
202
+ };
203
+ end: {
204
+ x: number;
205
+ y: number;
206
+ };
207
+ strokeWidth: number;
208
+ author?: string | undefined;
209
+ contents?: string | undefined;
210
+ inReplyTo?: string | undefined;
211
+ locked?: boolean | undefined;
212
+ custom?: Record<string, unknown> | undefined;
213
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
214
+ } | {
215
+ id: string;
216
+ page: number;
217
+ rect: {
218
+ x: number;
219
+ y: number;
220
+ width: number;
221
+ height: number;
222
+ };
223
+ color: string;
224
+ opacity: number;
225
+ createdAt: string;
226
+ modifiedAt: string;
227
+ source: "session" | "pdf";
228
+ type: "polyline" | "polygon";
229
+ vertices: {
230
+ x: number;
231
+ y: number;
232
+ }[];
233
+ strokeWidth: number;
234
+ author?: string | undefined;
235
+ contents?: string | undefined;
236
+ inReplyTo?: string | undefined;
237
+ locked?: boolean | undefined;
238
+ custom?: Record<string, unknown> | undefined;
239
+ fill?: string | undefined;
240
+ } | {
241
+ id: string;
242
+ page: number;
243
+ rect: {
244
+ x: number;
245
+ y: number;
246
+ width: number;
247
+ height: number;
248
+ };
249
+ color: string;
250
+ opacity: number;
251
+ createdAt: string;
252
+ modifiedAt: string;
253
+ source: "session" | "pdf";
254
+ type: "ink";
255
+ paths: {
256
+ x: number;
257
+ y: number;
258
+ }[][];
259
+ strokeWidth: number;
260
+ author?: string | undefined;
261
+ contents?: string | undefined;
262
+ inReplyTo?: string | undefined;
263
+ locked?: boolean | undefined;
264
+ custom?: Record<string, unknown> | undefined;
265
+ } | {
266
+ id: string;
267
+ page: number;
268
+ rect: {
269
+ x: number;
270
+ y: number;
271
+ width: number;
272
+ height: number;
273
+ };
274
+ color: string;
275
+ opacity: number;
276
+ createdAt: string;
277
+ modifiedAt: string;
278
+ source: "session" | "pdf";
279
+ type: "redact";
280
+ origin: "user" | "suggested";
281
+ fill: string;
282
+ author?: string | undefined;
283
+ contents?: string | undefined;
284
+ inReplyTo?: string | undefined;
285
+ locked?: boolean | undefined;
286
+ custom?: Record<string, unknown> | undefined;
287
+ quads?: {
288
+ p1: {
289
+ x: number;
290
+ y: number;
291
+ };
292
+ p2: {
293
+ x: number;
294
+ y: number;
295
+ };
296
+ p3: {
297
+ x: number;
298
+ y: number;
299
+ };
300
+ p4: {
301
+ x: number;
302
+ y: number;
303
+ };
304
+ }[] | undefined;
305
+ suggestion?: {
306
+ confidence: number;
307
+ jobId?: string | undefined;
308
+ reason?: string | undefined;
309
+ explanation?: string | undefined;
310
+ recommendation?: "redact" | "review" | "keep" | undefined;
311
+ } | undefined;
312
+ overlayText?: string | undefined;
313
+ } | undefined;
314
+ update: (id: string, patch: Partial<Annotation>) => {
315
+ id: string;
316
+ page: number;
317
+ rect: {
318
+ x: number;
319
+ y: number;
320
+ width: number;
321
+ height: number;
322
+ };
323
+ color: string;
324
+ opacity: number;
325
+ createdAt: string;
326
+ modifiedAt: string;
327
+ source: "session" | "pdf";
328
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
329
+ quads: {
330
+ p1: {
331
+ x: number;
332
+ y: number;
333
+ };
334
+ p2: {
335
+ x: number;
336
+ y: number;
337
+ };
338
+ p3: {
339
+ x: number;
340
+ y: number;
341
+ };
342
+ p4: {
343
+ x: number;
344
+ y: number;
345
+ };
346
+ }[];
347
+ author?: string | undefined;
348
+ contents?: string | undefined;
349
+ inReplyTo?: string | undefined;
350
+ locked?: boolean | undefined;
351
+ custom?: Record<string, unknown> | undefined;
352
+ } | {
353
+ id: string;
354
+ page: number;
355
+ rect: {
356
+ x: number;
357
+ y: number;
358
+ width: number;
359
+ height: number;
360
+ };
361
+ color: string;
362
+ opacity: number;
363
+ createdAt: string;
364
+ modifiedAt: string;
365
+ source: "session" | "pdf";
366
+ type: "note";
367
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
368
+ author?: string | undefined;
369
+ contents?: string | undefined;
370
+ inReplyTo?: string | undefined;
371
+ locked?: boolean | undefined;
372
+ custom?: Record<string, unknown> | undefined;
373
+ } | {
374
+ id: string;
375
+ page: number;
376
+ rect: {
377
+ x: number;
378
+ y: number;
379
+ width: number;
380
+ height: number;
381
+ };
382
+ color: string;
383
+ opacity: number;
384
+ createdAt: string;
385
+ modifiedAt: string;
386
+ source: "session" | "pdf";
387
+ type: "freeText";
388
+ text: string;
389
+ fontSize: number;
390
+ fontFamily: string;
391
+ align: "left" | "center" | "right";
392
+ author?: string | undefined;
393
+ contents?: string | undefined;
394
+ inReplyTo?: string | undefined;
395
+ locked?: boolean | undefined;
396
+ custom?: Record<string, unknown> | undefined;
397
+ callout?: {
398
+ x: number;
399
+ y: number;
400
+ }[] | undefined;
401
+ } | {
402
+ id: string;
403
+ page: number;
404
+ rect: {
405
+ x: number;
406
+ y: number;
407
+ width: number;
408
+ height: number;
409
+ };
410
+ color: string;
411
+ opacity: number;
412
+ createdAt: string;
413
+ modifiedAt: string;
414
+ source: "session" | "pdf";
415
+ type: "square" | "circle";
416
+ strokeWidth: number;
417
+ author?: string | undefined;
418
+ contents?: string | undefined;
419
+ inReplyTo?: string | undefined;
420
+ locked?: boolean | undefined;
421
+ custom?: Record<string, unknown> | undefined;
422
+ fill?: string | undefined;
423
+ } | {
424
+ id: string;
425
+ page: number;
426
+ rect: {
427
+ x: number;
428
+ y: number;
429
+ width: number;
430
+ height: number;
431
+ };
432
+ color: string;
433
+ opacity: number;
434
+ createdAt: string;
435
+ modifiedAt: string;
436
+ source: "session" | "pdf";
437
+ type: "line";
438
+ start: {
439
+ x: number;
440
+ y: number;
441
+ };
442
+ end: {
443
+ x: number;
444
+ y: number;
445
+ };
446
+ strokeWidth: number;
447
+ author?: string | undefined;
448
+ contents?: string | undefined;
449
+ inReplyTo?: string | undefined;
450
+ locked?: boolean | undefined;
451
+ custom?: Record<string, unknown> | undefined;
452
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
453
+ } | {
454
+ id: string;
455
+ page: number;
456
+ rect: {
457
+ x: number;
458
+ y: number;
459
+ width: number;
460
+ height: number;
461
+ };
462
+ color: string;
463
+ opacity: number;
464
+ createdAt: string;
465
+ modifiedAt: string;
466
+ source: "session" | "pdf";
467
+ type: "polyline" | "polygon";
468
+ vertices: {
469
+ x: number;
470
+ y: number;
471
+ }[];
472
+ strokeWidth: number;
473
+ author?: string | undefined;
474
+ contents?: string | undefined;
475
+ inReplyTo?: string | undefined;
476
+ locked?: boolean | undefined;
477
+ custom?: Record<string, unknown> | undefined;
478
+ fill?: string | undefined;
479
+ } | {
480
+ id: string;
481
+ page: number;
482
+ rect: {
483
+ x: number;
484
+ y: number;
485
+ width: number;
486
+ height: number;
487
+ };
488
+ color: string;
489
+ opacity: number;
490
+ createdAt: string;
491
+ modifiedAt: string;
492
+ source: "session" | "pdf";
493
+ type: "ink";
494
+ paths: {
495
+ x: number;
496
+ y: number;
497
+ }[][];
498
+ strokeWidth: number;
499
+ author?: string | undefined;
500
+ contents?: string | undefined;
501
+ inReplyTo?: string | undefined;
502
+ locked?: boolean | undefined;
503
+ custom?: Record<string, unknown> | undefined;
504
+ } | {
505
+ id: string;
506
+ page: number;
507
+ rect: {
508
+ x: number;
509
+ y: number;
510
+ width: number;
511
+ height: number;
512
+ };
513
+ color: string;
514
+ opacity: number;
515
+ createdAt: string;
516
+ modifiedAt: string;
517
+ source: "session" | "pdf";
518
+ type: "redact";
519
+ origin: "user" | "suggested";
520
+ fill: string;
521
+ author?: string | undefined;
522
+ contents?: string | undefined;
523
+ inReplyTo?: string | undefined;
524
+ locked?: boolean | undefined;
525
+ custom?: Record<string, unknown> | undefined;
526
+ quads?: {
527
+ p1: {
528
+ x: number;
529
+ y: number;
530
+ };
531
+ p2: {
532
+ x: number;
533
+ y: number;
534
+ };
535
+ p3: {
536
+ x: number;
537
+ y: number;
538
+ };
539
+ p4: {
540
+ x: number;
541
+ y: number;
542
+ };
543
+ }[] | undefined;
544
+ suggestion?: {
545
+ confidence: number;
546
+ jobId?: string | undefined;
547
+ reason?: string | undefined;
548
+ explanation?: string | undefined;
549
+ recommendation?: "redact" | "review" | "keep" | undefined;
550
+ } | undefined;
551
+ overlayText?: string | undefined;
552
+ } | undefined;
553
+ remove: (id: string) => boolean;
554
+ select: (ids: string[]) => void | undefined;
555
+ /** Keeps a suggested redaction as the user's own, in the default redaction colour. */
556
+ accept: (id: string) => {
557
+ id: string;
558
+ page: number;
559
+ rect: {
560
+ x: number;
561
+ y: number;
562
+ width: number;
563
+ height: number;
564
+ };
565
+ color: string;
566
+ opacity: number;
567
+ createdAt: string;
568
+ modifiedAt: string;
569
+ source: "session" | "pdf";
570
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
571
+ quads: {
572
+ p1: {
573
+ x: number;
574
+ y: number;
575
+ };
576
+ p2: {
577
+ x: number;
578
+ y: number;
579
+ };
580
+ p3: {
581
+ x: number;
582
+ y: number;
583
+ };
584
+ p4: {
585
+ x: number;
586
+ y: number;
587
+ };
588
+ }[];
589
+ author?: string | undefined;
590
+ contents?: string | undefined;
591
+ inReplyTo?: string | undefined;
592
+ locked?: boolean | undefined;
593
+ custom?: Record<string, unknown> | undefined;
594
+ } | {
595
+ id: string;
596
+ page: number;
597
+ rect: {
598
+ x: number;
599
+ y: number;
600
+ width: number;
601
+ height: number;
602
+ };
603
+ color: string;
604
+ opacity: number;
605
+ createdAt: string;
606
+ modifiedAt: string;
607
+ source: "session" | "pdf";
608
+ type: "note";
609
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
610
+ author?: string | undefined;
611
+ contents?: string | undefined;
612
+ inReplyTo?: string | undefined;
613
+ locked?: boolean | undefined;
614
+ custom?: Record<string, unknown> | undefined;
615
+ } | {
616
+ id: string;
617
+ page: number;
618
+ rect: {
619
+ x: number;
620
+ y: number;
621
+ width: number;
622
+ height: number;
623
+ };
624
+ color: string;
625
+ opacity: number;
626
+ createdAt: string;
627
+ modifiedAt: string;
628
+ source: "session" | "pdf";
629
+ type: "freeText";
630
+ text: string;
631
+ fontSize: number;
632
+ fontFamily: string;
633
+ align: "left" | "center" | "right";
634
+ author?: string | undefined;
635
+ contents?: string | undefined;
636
+ inReplyTo?: string | undefined;
637
+ locked?: boolean | undefined;
638
+ custom?: Record<string, unknown> | undefined;
639
+ callout?: {
640
+ x: number;
641
+ y: number;
642
+ }[] | undefined;
643
+ } | {
644
+ id: string;
645
+ page: number;
646
+ rect: {
647
+ x: number;
648
+ y: number;
649
+ width: number;
650
+ height: number;
651
+ };
652
+ color: string;
653
+ opacity: number;
654
+ createdAt: string;
655
+ modifiedAt: string;
656
+ source: "session" | "pdf";
657
+ type: "square" | "circle";
658
+ strokeWidth: number;
659
+ author?: string | undefined;
660
+ contents?: string | undefined;
661
+ inReplyTo?: string | undefined;
662
+ locked?: boolean | undefined;
663
+ custom?: Record<string, unknown> | undefined;
664
+ fill?: string | undefined;
665
+ } | {
666
+ id: string;
667
+ page: number;
668
+ rect: {
669
+ x: number;
670
+ y: number;
671
+ width: number;
672
+ height: number;
673
+ };
674
+ color: string;
675
+ opacity: number;
676
+ createdAt: string;
677
+ modifiedAt: string;
678
+ source: "session" | "pdf";
679
+ type: "line";
680
+ start: {
681
+ x: number;
682
+ y: number;
683
+ };
684
+ end: {
685
+ x: number;
686
+ y: number;
687
+ };
688
+ strokeWidth: number;
689
+ author?: string | undefined;
690
+ contents?: string | undefined;
691
+ inReplyTo?: string | undefined;
692
+ locked?: boolean | undefined;
693
+ custom?: Record<string, unknown> | undefined;
694
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
695
+ } | {
696
+ id: string;
697
+ page: number;
698
+ rect: {
699
+ x: number;
700
+ y: number;
701
+ width: number;
702
+ height: number;
703
+ };
704
+ color: string;
705
+ opacity: number;
706
+ createdAt: string;
707
+ modifiedAt: string;
708
+ source: "session" | "pdf";
709
+ type: "polyline" | "polygon";
710
+ vertices: {
711
+ x: number;
712
+ y: number;
713
+ }[];
714
+ strokeWidth: number;
715
+ author?: string | undefined;
716
+ contents?: string | undefined;
717
+ inReplyTo?: string | undefined;
718
+ locked?: boolean | undefined;
719
+ custom?: Record<string, unknown> | undefined;
720
+ fill?: string | undefined;
721
+ } | {
722
+ id: string;
723
+ page: number;
724
+ rect: {
725
+ x: number;
726
+ y: number;
727
+ width: number;
728
+ height: number;
729
+ };
730
+ color: string;
731
+ opacity: number;
732
+ createdAt: string;
733
+ modifiedAt: string;
734
+ source: "session" | "pdf";
735
+ type: "ink";
736
+ paths: {
737
+ x: number;
738
+ y: number;
739
+ }[][];
740
+ strokeWidth: number;
741
+ author?: string | undefined;
742
+ contents?: string | undefined;
743
+ inReplyTo?: string | undefined;
744
+ locked?: boolean | undefined;
745
+ custom?: Record<string, unknown> | undefined;
746
+ } | {
747
+ id: string;
748
+ page: number;
749
+ rect: {
750
+ x: number;
751
+ y: number;
752
+ width: number;
753
+ height: number;
754
+ };
755
+ color: string;
756
+ opacity: number;
757
+ createdAt: string;
758
+ modifiedAt: string;
759
+ source: "session" | "pdf";
760
+ type: "redact";
761
+ origin: "user" | "suggested";
762
+ fill: string;
763
+ author?: string | undefined;
764
+ contents?: string | undefined;
765
+ inReplyTo?: string | undefined;
766
+ locked?: boolean | undefined;
767
+ custom?: Record<string, unknown> | undefined;
768
+ quads?: {
769
+ p1: {
770
+ x: number;
771
+ y: number;
772
+ };
773
+ p2: {
774
+ x: number;
775
+ y: number;
776
+ };
777
+ p3: {
778
+ x: number;
779
+ y: number;
780
+ };
781
+ p4: {
782
+ x: number;
783
+ y: number;
784
+ };
785
+ }[] | undefined;
786
+ suggestion?: {
787
+ confidence: number;
788
+ jobId?: string | undefined;
789
+ reason?: string | undefined;
790
+ explanation?: string | undefined;
791
+ recommendation?: "redact" | "review" | "keep" | undefined;
792
+ } | undefined;
793
+ overlayText?: string | undefined;
794
+ } | undefined;
795
+ dismiss: (id: string) => boolean;
796
+ annotations: readonly ({
797
+ id: string;
798
+ page: number;
799
+ rect: {
800
+ x: number;
801
+ y: number;
802
+ width: number;
803
+ height: number;
804
+ };
805
+ color: string;
806
+ opacity: number;
807
+ createdAt: string;
808
+ modifiedAt: string;
809
+ source: "session" | "pdf";
810
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
811
+ quads: {
812
+ p1: {
813
+ x: number;
814
+ y: number;
815
+ };
816
+ p2: {
817
+ x: number;
818
+ y: number;
819
+ };
820
+ p3: {
821
+ x: number;
822
+ y: number;
823
+ };
824
+ p4: {
825
+ x: number;
826
+ y: number;
827
+ };
828
+ }[];
829
+ author?: string | undefined;
830
+ contents?: string | undefined;
831
+ inReplyTo?: string | undefined;
832
+ locked?: boolean | undefined;
833
+ custom?: Record<string, unknown> | undefined;
834
+ } | {
835
+ id: string;
836
+ page: number;
837
+ rect: {
838
+ x: number;
839
+ y: number;
840
+ width: number;
841
+ height: number;
842
+ };
843
+ color: string;
844
+ opacity: number;
845
+ createdAt: string;
846
+ modifiedAt: string;
847
+ source: "session" | "pdf";
848
+ type: "note";
849
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
850
+ author?: string | undefined;
851
+ contents?: string | undefined;
852
+ inReplyTo?: string | undefined;
853
+ locked?: boolean | undefined;
854
+ custom?: Record<string, unknown> | undefined;
855
+ } | {
856
+ id: string;
857
+ page: number;
858
+ rect: {
859
+ x: number;
860
+ y: number;
861
+ width: number;
862
+ height: number;
863
+ };
864
+ color: string;
865
+ opacity: number;
866
+ createdAt: string;
867
+ modifiedAt: string;
868
+ source: "session" | "pdf";
869
+ type: "freeText";
870
+ text: string;
871
+ fontSize: number;
872
+ fontFamily: string;
873
+ align: "left" | "center" | "right";
874
+ author?: string | undefined;
875
+ contents?: string | undefined;
876
+ inReplyTo?: string | undefined;
877
+ locked?: boolean | undefined;
878
+ custom?: Record<string, unknown> | undefined;
879
+ callout?: {
880
+ x: number;
881
+ y: number;
882
+ }[] | undefined;
883
+ } | {
884
+ id: string;
885
+ page: number;
886
+ rect: {
887
+ x: number;
888
+ y: number;
889
+ width: number;
890
+ height: number;
891
+ };
892
+ color: string;
893
+ opacity: number;
894
+ createdAt: string;
895
+ modifiedAt: string;
896
+ source: "session" | "pdf";
897
+ type: "square" | "circle";
898
+ strokeWidth: number;
899
+ author?: string | undefined;
900
+ contents?: string | undefined;
901
+ inReplyTo?: string | undefined;
902
+ locked?: boolean | undefined;
903
+ custom?: Record<string, unknown> | undefined;
904
+ fill?: string | undefined;
905
+ } | {
906
+ id: string;
907
+ page: number;
908
+ rect: {
909
+ x: number;
910
+ y: number;
911
+ width: number;
912
+ height: number;
913
+ };
914
+ color: string;
915
+ opacity: number;
916
+ createdAt: string;
917
+ modifiedAt: string;
918
+ source: "session" | "pdf";
919
+ type: "line";
920
+ start: {
921
+ x: number;
922
+ y: number;
923
+ };
924
+ end: {
925
+ x: number;
926
+ y: number;
927
+ };
928
+ strokeWidth: number;
929
+ author?: string | undefined;
930
+ contents?: string | undefined;
931
+ inReplyTo?: string | undefined;
932
+ locked?: boolean | undefined;
933
+ custom?: Record<string, unknown> | undefined;
934
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
935
+ } | {
936
+ id: string;
937
+ page: number;
938
+ rect: {
939
+ x: number;
940
+ y: number;
941
+ width: number;
942
+ height: number;
943
+ };
944
+ color: string;
945
+ opacity: number;
946
+ createdAt: string;
947
+ modifiedAt: string;
948
+ source: "session" | "pdf";
949
+ type: "polyline" | "polygon";
950
+ vertices: {
951
+ x: number;
952
+ y: number;
953
+ }[];
954
+ strokeWidth: number;
955
+ author?: string | undefined;
956
+ contents?: string | undefined;
957
+ inReplyTo?: string | undefined;
958
+ locked?: boolean | undefined;
959
+ custom?: Record<string, unknown> | undefined;
960
+ fill?: string | undefined;
961
+ } | {
962
+ id: string;
963
+ page: number;
964
+ rect: {
965
+ x: number;
966
+ y: number;
967
+ width: number;
968
+ height: number;
969
+ };
970
+ color: string;
971
+ opacity: number;
972
+ createdAt: string;
973
+ modifiedAt: string;
974
+ source: "session" | "pdf";
975
+ type: "ink";
976
+ paths: {
977
+ x: number;
978
+ y: number;
979
+ }[][];
980
+ strokeWidth: number;
981
+ author?: string | undefined;
982
+ contents?: string | undefined;
983
+ inReplyTo?: string | undefined;
984
+ locked?: boolean | undefined;
985
+ custom?: Record<string, unknown> | undefined;
986
+ } | {
987
+ id: string;
988
+ page: number;
989
+ rect: {
990
+ x: number;
991
+ y: number;
992
+ width: number;
993
+ height: number;
994
+ };
995
+ color: string;
996
+ opacity: number;
997
+ createdAt: string;
998
+ modifiedAt: string;
999
+ source: "session" | "pdf";
1000
+ type: "redact";
1001
+ origin: "user" | "suggested";
1002
+ fill: string;
1003
+ author?: string | undefined;
1004
+ contents?: string | undefined;
1005
+ inReplyTo?: string | undefined;
1006
+ locked?: boolean | undefined;
1007
+ custom?: Record<string, unknown> | undefined;
1008
+ quads?: {
1009
+ p1: {
1010
+ x: number;
1011
+ y: number;
1012
+ };
1013
+ p2: {
1014
+ x: number;
1015
+ y: number;
1016
+ };
1017
+ p3: {
1018
+ x: number;
1019
+ y: number;
1020
+ };
1021
+ p4: {
1022
+ x: number;
1023
+ y: number;
1024
+ };
1025
+ }[] | undefined;
1026
+ suggestion?: {
1027
+ confidence: number;
1028
+ jobId?: string | undefined;
1029
+ reason?: string | undefined;
1030
+ explanation?: string | undefined;
1031
+ recommendation?: "redact" | "review" | "keep" | undefined;
1032
+ } | undefined;
1033
+ overlayText?: string | undefined;
1034
+ })[];
1035
+ selection: readonly string[];
1036
+ selected: ({
1037
+ id: string;
1038
+ page: number;
1039
+ rect: {
1040
+ x: number;
1041
+ y: number;
1042
+ width: number;
1043
+ height: number;
1044
+ };
1045
+ color: string;
1046
+ opacity: number;
1047
+ createdAt: string;
1048
+ modifiedAt: string;
1049
+ source: "session" | "pdf";
1050
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
1051
+ quads: {
1052
+ p1: {
1053
+ x: number;
1054
+ y: number;
1055
+ };
1056
+ p2: {
1057
+ x: number;
1058
+ y: number;
1059
+ };
1060
+ p3: {
1061
+ x: number;
1062
+ y: number;
1063
+ };
1064
+ p4: {
1065
+ x: number;
1066
+ y: number;
1067
+ };
1068
+ }[];
1069
+ author?: string | undefined;
1070
+ contents?: string | undefined;
1071
+ inReplyTo?: string | undefined;
1072
+ locked?: boolean | undefined;
1073
+ custom?: Record<string, unknown> | undefined;
1074
+ } | {
1075
+ id: string;
1076
+ page: number;
1077
+ rect: {
1078
+ x: number;
1079
+ y: number;
1080
+ width: number;
1081
+ height: number;
1082
+ };
1083
+ color: string;
1084
+ opacity: number;
1085
+ createdAt: string;
1086
+ modifiedAt: string;
1087
+ source: "session" | "pdf";
1088
+ type: "note";
1089
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
1090
+ author?: string | undefined;
1091
+ contents?: string | undefined;
1092
+ inReplyTo?: string | undefined;
1093
+ locked?: boolean | undefined;
1094
+ custom?: Record<string, unknown> | undefined;
1095
+ } | {
1096
+ id: string;
1097
+ page: number;
1098
+ rect: {
1099
+ x: number;
1100
+ y: number;
1101
+ width: number;
1102
+ height: number;
1103
+ };
1104
+ color: string;
1105
+ opacity: number;
1106
+ createdAt: string;
1107
+ modifiedAt: string;
1108
+ source: "session" | "pdf";
1109
+ type: "freeText";
1110
+ text: string;
1111
+ fontSize: number;
1112
+ fontFamily: string;
1113
+ align: "left" | "center" | "right";
1114
+ author?: string | undefined;
1115
+ contents?: string | undefined;
1116
+ inReplyTo?: string | undefined;
1117
+ locked?: boolean | undefined;
1118
+ custom?: Record<string, unknown> | undefined;
1119
+ callout?: {
1120
+ x: number;
1121
+ y: number;
1122
+ }[] | undefined;
1123
+ } | {
1124
+ id: string;
1125
+ page: number;
1126
+ rect: {
1127
+ x: number;
1128
+ y: number;
1129
+ width: number;
1130
+ height: number;
1131
+ };
1132
+ color: string;
1133
+ opacity: number;
1134
+ createdAt: string;
1135
+ modifiedAt: string;
1136
+ source: "session" | "pdf";
1137
+ type: "square" | "circle";
1138
+ strokeWidth: number;
1139
+ author?: string | undefined;
1140
+ contents?: string | undefined;
1141
+ inReplyTo?: string | undefined;
1142
+ locked?: boolean | undefined;
1143
+ custom?: Record<string, unknown> | undefined;
1144
+ fill?: string | undefined;
1145
+ } | {
1146
+ id: string;
1147
+ page: number;
1148
+ rect: {
1149
+ x: number;
1150
+ y: number;
1151
+ width: number;
1152
+ height: number;
1153
+ };
1154
+ color: string;
1155
+ opacity: number;
1156
+ createdAt: string;
1157
+ modifiedAt: string;
1158
+ source: "session" | "pdf";
1159
+ type: "line";
1160
+ start: {
1161
+ x: number;
1162
+ y: number;
1163
+ };
1164
+ end: {
1165
+ x: number;
1166
+ y: number;
1167
+ };
1168
+ strokeWidth: number;
1169
+ author?: string | undefined;
1170
+ contents?: string | undefined;
1171
+ inReplyTo?: string | undefined;
1172
+ locked?: boolean | undefined;
1173
+ custom?: Record<string, unknown> | undefined;
1174
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
1175
+ } | {
1176
+ id: string;
1177
+ page: number;
1178
+ rect: {
1179
+ x: number;
1180
+ y: number;
1181
+ width: number;
1182
+ height: number;
1183
+ };
1184
+ color: string;
1185
+ opacity: number;
1186
+ createdAt: string;
1187
+ modifiedAt: string;
1188
+ source: "session" | "pdf";
1189
+ type: "polyline" | "polygon";
1190
+ vertices: {
1191
+ x: number;
1192
+ y: number;
1193
+ }[];
1194
+ strokeWidth: number;
1195
+ author?: string | undefined;
1196
+ contents?: string | undefined;
1197
+ inReplyTo?: string | undefined;
1198
+ locked?: boolean | undefined;
1199
+ custom?: Record<string, unknown> | undefined;
1200
+ fill?: string | undefined;
1201
+ } | {
1202
+ id: string;
1203
+ page: number;
1204
+ rect: {
1205
+ x: number;
1206
+ y: number;
1207
+ width: number;
1208
+ height: number;
1209
+ };
1210
+ color: string;
1211
+ opacity: number;
1212
+ createdAt: string;
1213
+ modifiedAt: string;
1214
+ source: "session" | "pdf";
1215
+ type: "ink";
1216
+ paths: {
1217
+ x: number;
1218
+ y: number;
1219
+ }[][];
1220
+ strokeWidth: number;
1221
+ author?: string | undefined;
1222
+ contents?: string | undefined;
1223
+ inReplyTo?: string | undefined;
1224
+ locked?: boolean | undefined;
1225
+ custom?: Record<string, unknown> | undefined;
1226
+ } | {
1227
+ id: string;
1228
+ page: number;
1229
+ rect: {
1230
+ x: number;
1231
+ y: number;
1232
+ width: number;
1233
+ height: number;
1234
+ };
1235
+ color: string;
1236
+ opacity: number;
1237
+ createdAt: string;
1238
+ modifiedAt: string;
1239
+ source: "session" | "pdf";
1240
+ type: "redact";
1241
+ origin: "user" | "suggested";
1242
+ fill: string;
1243
+ author?: string | undefined;
1244
+ contents?: string | undefined;
1245
+ inReplyTo?: string | undefined;
1246
+ locked?: boolean | undefined;
1247
+ custom?: Record<string, unknown> | undefined;
1248
+ quads?: {
1249
+ p1: {
1250
+ x: number;
1251
+ y: number;
1252
+ };
1253
+ p2: {
1254
+ x: number;
1255
+ y: number;
1256
+ };
1257
+ p3: {
1258
+ x: number;
1259
+ y: number;
1260
+ };
1261
+ p4: {
1262
+ x: number;
1263
+ y: number;
1264
+ };
1265
+ }[] | undefined;
1266
+ suggestion?: {
1267
+ confidence: number;
1268
+ jobId?: string | undefined;
1269
+ reason?: string | undefined;
1270
+ explanation?: string | undefined;
1271
+ recommendation?: "redact" | "review" | "keep" | undefined;
1272
+ } | undefined;
1273
+ overlayText?: string | undefined;
1274
+ })[];
1275
+ byPage: (page: number) => ({
1276
+ id: string;
1277
+ page: number;
1278
+ rect: {
1279
+ x: number;
1280
+ y: number;
1281
+ width: number;
1282
+ height: number;
1283
+ };
1284
+ color: string;
1285
+ opacity: number;
1286
+ createdAt: string;
1287
+ modifiedAt: string;
1288
+ source: "session" | "pdf";
1289
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
1290
+ quads: {
1291
+ p1: {
1292
+ x: number;
1293
+ y: number;
1294
+ };
1295
+ p2: {
1296
+ x: number;
1297
+ y: number;
1298
+ };
1299
+ p3: {
1300
+ x: number;
1301
+ y: number;
1302
+ };
1303
+ p4: {
1304
+ x: number;
1305
+ y: number;
1306
+ };
1307
+ }[];
1308
+ author?: string | undefined;
1309
+ contents?: string | undefined;
1310
+ inReplyTo?: string | undefined;
1311
+ locked?: boolean | undefined;
1312
+ custom?: Record<string, unknown> | undefined;
1313
+ } | {
1314
+ id: string;
1315
+ page: number;
1316
+ rect: {
1317
+ x: number;
1318
+ y: number;
1319
+ width: number;
1320
+ height: number;
1321
+ };
1322
+ color: string;
1323
+ opacity: number;
1324
+ createdAt: string;
1325
+ modifiedAt: string;
1326
+ source: "session" | "pdf";
1327
+ type: "note";
1328
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
1329
+ author?: string | undefined;
1330
+ contents?: string | undefined;
1331
+ inReplyTo?: string | undefined;
1332
+ locked?: boolean | undefined;
1333
+ custom?: Record<string, unknown> | undefined;
1334
+ } | {
1335
+ id: string;
1336
+ page: number;
1337
+ rect: {
1338
+ x: number;
1339
+ y: number;
1340
+ width: number;
1341
+ height: number;
1342
+ };
1343
+ color: string;
1344
+ opacity: number;
1345
+ createdAt: string;
1346
+ modifiedAt: string;
1347
+ source: "session" | "pdf";
1348
+ type: "freeText";
1349
+ text: string;
1350
+ fontSize: number;
1351
+ fontFamily: string;
1352
+ align: "left" | "center" | "right";
1353
+ author?: string | undefined;
1354
+ contents?: string | undefined;
1355
+ inReplyTo?: string | undefined;
1356
+ locked?: boolean | undefined;
1357
+ custom?: Record<string, unknown> | undefined;
1358
+ callout?: {
1359
+ x: number;
1360
+ y: number;
1361
+ }[] | undefined;
1362
+ } | {
1363
+ id: string;
1364
+ page: number;
1365
+ rect: {
1366
+ x: number;
1367
+ y: number;
1368
+ width: number;
1369
+ height: number;
1370
+ };
1371
+ color: string;
1372
+ opacity: number;
1373
+ createdAt: string;
1374
+ modifiedAt: string;
1375
+ source: "session" | "pdf";
1376
+ type: "square" | "circle";
1377
+ strokeWidth: number;
1378
+ author?: string | undefined;
1379
+ contents?: string | undefined;
1380
+ inReplyTo?: string | undefined;
1381
+ locked?: boolean | undefined;
1382
+ custom?: Record<string, unknown> | undefined;
1383
+ fill?: string | undefined;
1384
+ } | {
1385
+ id: string;
1386
+ page: number;
1387
+ rect: {
1388
+ x: number;
1389
+ y: number;
1390
+ width: number;
1391
+ height: number;
1392
+ };
1393
+ color: string;
1394
+ opacity: number;
1395
+ createdAt: string;
1396
+ modifiedAt: string;
1397
+ source: "session" | "pdf";
1398
+ type: "line";
1399
+ start: {
1400
+ x: number;
1401
+ y: number;
1402
+ };
1403
+ end: {
1404
+ x: number;
1405
+ y: number;
1406
+ };
1407
+ strokeWidth: number;
1408
+ author?: string | undefined;
1409
+ contents?: string | undefined;
1410
+ inReplyTo?: string | undefined;
1411
+ locked?: boolean | undefined;
1412
+ custom?: Record<string, unknown> | undefined;
1413
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
1414
+ } | {
1415
+ id: string;
1416
+ page: number;
1417
+ rect: {
1418
+ x: number;
1419
+ y: number;
1420
+ width: number;
1421
+ height: number;
1422
+ };
1423
+ color: string;
1424
+ opacity: number;
1425
+ createdAt: string;
1426
+ modifiedAt: string;
1427
+ source: "session" | "pdf";
1428
+ type: "polyline" | "polygon";
1429
+ vertices: {
1430
+ x: number;
1431
+ y: number;
1432
+ }[];
1433
+ strokeWidth: number;
1434
+ author?: string | undefined;
1435
+ contents?: string | undefined;
1436
+ inReplyTo?: string | undefined;
1437
+ locked?: boolean | undefined;
1438
+ custom?: Record<string, unknown> | undefined;
1439
+ fill?: string | undefined;
1440
+ } | {
1441
+ id: string;
1442
+ page: number;
1443
+ rect: {
1444
+ x: number;
1445
+ y: number;
1446
+ width: number;
1447
+ height: number;
1448
+ };
1449
+ color: string;
1450
+ opacity: number;
1451
+ createdAt: string;
1452
+ modifiedAt: string;
1453
+ source: "session" | "pdf";
1454
+ type: "ink";
1455
+ paths: {
1456
+ x: number;
1457
+ y: number;
1458
+ }[][];
1459
+ strokeWidth: number;
1460
+ author?: string | undefined;
1461
+ contents?: string | undefined;
1462
+ inReplyTo?: string | undefined;
1463
+ locked?: boolean | undefined;
1464
+ custom?: Record<string, unknown> | undefined;
1465
+ } | {
1466
+ id: string;
1467
+ page: number;
1468
+ rect: {
1469
+ x: number;
1470
+ y: number;
1471
+ width: number;
1472
+ height: number;
1473
+ };
1474
+ color: string;
1475
+ opacity: number;
1476
+ createdAt: string;
1477
+ modifiedAt: string;
1478
+ source: "session" | "pdf";
1479
+ type: "redact";
1480
+ origin: "user" | "suggested";
1481
+ fill: string;
1482
+ author?: string | undefined;
1483
+ contents?: string | undefined;
1484
+ inReplyTo?: string | undefined;
1485
+ locked?: boolean | undefined;
1486
+ custom?: Record<string, unknown> | undefined;
1487
+ quads?: {
1488
+ p1: {
1489
+ x: number;
1490
+ y: number;
1491
+ };
1492
+ p2: {
1493
+ x: number;
1494
+ y: number;
1495
+ };
1496
+ p3: {
1497
+ x: number;
1498
+ y: number;
1499
+ };
1500
+ p4: {
1501
+ x: number;
1502
+ y: number;
1503
+ };
1504
+ }[] | undefined;
1505
+ suggestion?: {
1506
+ confidence: number;
1507
+ jobId?: string | undefined;
1508
+ reason?: string | undefined;
1509
+ explanation?: string | undefined;
1510
+ recommendation?: "redact" | "review" | "keep" | undefined;
1511
+ } | undefined;
1512
+ overlayText?: string | undefined;
1513
+ })[];
1514
+ /** Replies in creation order for a note id. */
1515
+ replies: (id: string) => ({
1516
+ id: string;
1517
+ page: number;
1518
+ rect: {
1519
+ x: number;
1520
+ y: number;
1521
+ width: number;
1522
+ height: number;
1523
+ };
1524
+ color: string;
1525
+ opacity: number;
1526
+ createdAt: string;
1527
+ modifiedAt: string;
1528
+ source: "session" | "pdf";
1529
+ type: "highlight" | "underline" | "strikeout" | "squiggly";
1530
+ quads: {
1531
+ p1: {
1532
+ x: number;
1533
+ y: number;
1534
+ };
1535
+ p2: {
1536
+ x: number;
1537
+ y: number;
1538
+ };
1539
+ p3: {
1540
+ x: number;
1541
+ y: number;
1542
+ };
1543
+ p4: {
1544
+ x: number;
1545
+ y: number;
1546
+ };
1547
+ }[];
1548
+ author?: string | undefined;
1549
+ contents?: string | undefined;
1550
+ inReplyTo?: string | undefined;
1551
+ locked?: boolean | undefined;
1552
+ custom?: Record<string, unknown> | undefined;
1553
+ } | {
1554
+ id: string;
1555
+ page: number;
1556
+ rect: {
1557
+ x: number;
1558
+ y: number;
1559
+ width: number;
1560
+ height: number;
1561
+ };
1562
+ color: string;
1563
+ opacity: number;
1564
+ createdAt: string;
1565
+ modifiedAt: string;
1566
+ source: "session" | "pdf";
1567
+ type: "note";
1568
+ icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
1569
+ author?: string | undefined;
1570
+ contents?: string | undefined;
1571
+ inReplyTo?: string | undefined;
1572
+ locked?: boolean | undefined;
1573
+ custom?: Record<string, unknown> | undefined;
1574
+ } | {
1575
+ id: string;
1576
+ page: number;
1577
+ rect: {
1578
+ x: number;
1579
+ y: number;
1580
+ width: number;
1581
+ height: number;
1582
+ };
1583
+ color: string;
1584
+ opacity: number;
1585
+ createdAt: string;
1586
+ modifiedAt: string;
1587
+ source: "session" | "pdf";
1588
+ type: "freeText";
1589
+ text: string;
1590
+ fontSize: number;
1591
+ fontFamily: string;
1592
+ align: "left" | "center" | "right";
1593
+ author?: string | undefined;
1594
+ contents?: string | undefined;
1595
+ inReplyTo?: string | undefined;
1596
+ locked?: boolean | undefined;
1597
+ custom?: Record<string, unknown> | undefined;
1598
+ callout?: {
1599
+ x: number;
1600
+ y: number;
1601
+ }[] | undefined;
1602
+ } | {
1603
+ id: string;
1604
+ page: number;
1605
+ rect: {
1606
+ x: number;
1607
+ y: number;
1608
+ width: number;
1609
+ height: number;
1610
+ };
1611
+ color: string;
1612
+ opacity: number;
1613
+ createdAt: string;
1614
+ modifiedAt: string;
1615
+ source: "session" | "pdf";
1616
+ type: "square" | "circle";
1617
+ strokeWidth: number;
1618
+ author?: string | undefined;
1619
+ contents?: string | undefined;
1620
+ inReplyTo?: string | undefined;
1621
+ locked?: boolean | undefined;
1622
+ custom?: Record<string, unknown> | undefined;
1623
+ fill?: string | undefined;
1624
+ } | {
1625
+ id: string;
1626
+ page: number;
1627
+ rect: {
1628
+ x: number;
1629
+ y: number;
1630
+ width: number;
1631
+ height: number;
1632
+ };
1633
+ color: string;
1634
+ opacity: number;
1635
+ createdAt: string;
1636
+ modifiedAt: string;
1637
+ source: "session" | "pdf";
1638
+ type: "line";
1639
+ start: {
1640
+ x: number;
1641
+ y: number;
1642
+ };
1643
+ end: {
1644
+ x: number;
1645
+ y: number;
1646
+ };
1647
+ strokeWidth: number;
1648
+ author?: string | undefined;
1649
+ contents?: string | undefined;
1650
+ inReplyTo?: string | undefined;
1651
+ locked?: boolean | undefined;
1652
+ custom?: Record<string, unknown> | undefined;
1653
+ endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
1654
+ } | {
1655
+ id: string;
1656
+ page: number;
1657
+ rect: {
1658
+ x: number;
1659
+ y: number;
1660
+ width: number;
1661
+ height: number;
1662
+ };
1663
+ color: string;
1664
+ opacity: number;
1665
+ createdAt: string;
1666
+ modifiedAt: string;
1667
+ source: "session" | "pdf";
1668
+ type: "polyline" | "polygon";
1669
+ vertices: {
1670
+ x: number;
1671
+ y: number;
1672
+ }[];
1673
+ strokeWidth: number;
1674
+ author?: string | undefined;
1675
+ contents?: string | undefined;
1676
+ inReplyTo?: string | undefined;
1677
+ locked?: boolean | undefined;
1678
+ custom?: Record<string, unknown> | undefined;
1679
+ fill?: string | undefined;
1680
+ } | {
1681
+ id: string;
1682
+ page: number;
1683
+ rect: {
1684
+ x: number;
1685
+ y: number;
1686
+ width: number;
1687
+ height: number;
1688
+ };
1689
+ color: string;
1690
+ opacity: number;
1691
+ createdAt: string;
1692
+ modifiedAt: string;
1693
+ source: "session" | "pdf";
1694
+ type: "ink";
1695
+ paths: {
1696
+ x: number;
1697
+ y: number;
1698
+ }[][];
1699
+ strokeWidth: number;
1700
+ author?: string | undefined;
1701
+ contents?: string | undefined;
1702
+ inReplyTo?: string | undefined;
1703
+ locked?: boolean | undefined;
1704
+ custom?: Record<string, unknown> | undefined;
1705
+ } | {
1706
+ id: string;
1707
+ page: number;
1708
+ rect: {
1709
+ x: number;
1710
+ y: number;
1711
+ width: number;
1712
+ height: number;
1713
+ };
1714
+ color: string;
1715
+ opacity: number;
1716
+ createdAt: string;
1717
+ modifiedAt: string;
1718
+ source: "session" | "pdf";
1719
+ type: "redact";
1720
+ origin: "user" | "suggested";
1721
+ fill: string;
1722
+ author?: string | undefined;
1723
+ contents?: string | undefined;
1724
+ inReplyTo?: string | undefined;
1725
+ locked?: boolean | undefined;
1726
+ custom?: Record<string, unknown> | undefined;
1727
+ quads?: {
1728
+ p1: {
1729
+ x: number;
1730
+ y: number;
1731
+ };
1732
+ p2: {
1733
+ x: number;
1734
+ y: number;
1735
+ };
1736
+ p3: {
1737
+ x: number;
1738
+ y: number;
1739
+ };
1740
+ p4: {
1741
+ x: number;
1742
+ y: number;
1743
+ };
1744
+ }[] | undefined;
1745
+ suggestion?: {
1746
+ confidence: number;
1747
+ jobId?: string | undefined;
1748
+ reason?: string | undefined;
1749
+ explanation?: string | undefined;
1750
+ recommendation?: "redact" | "review" | "keep" | undefined;
1751
+ } | undefined;
1752
+ overlayText?: string | undefined;
1753
+ })[];
1754
+ };
1755
+ //#endregion
1756
+ //#region src/hooks/useTool.d.ts
1757
+ export declare function useTool(): {
1758
+ tool: import("@inkbar/core/dom").ToolId;
1759
+ setTool: (id: import("@inkbar/core/dom").ToolId) => void;
1760
+ };
1761
+ //#endregion
1762
+ //#region src/hooks/useSelection.d.ts
1763
+ export declare function useSelection(): {
1764
+ selection: readonly string[];
1765
+ select: (ids: string[]) => void | undefined;
1766
+ clear: () => void | undefined;
1767
+ };
1768
+ //#endregion
1769
+ //#region src/hooks/useZoom.d.ts
1770
+ export declare function useZoom(): {
1771
+ zoom: ZoomValue;
1772
+ scale: number;
1773
+ setZoom: (z: ZoomValue) => void | undefined;
1774
+ zoomIn: () => void | undefined;
1775
+ zoomOut: () => void | undefined;
1776
+ };
1777
+ //#endregion
1778
+ //#region src/hooks/usePage.d.ts
1779
+ export declare function usePage(): {
1780
+ /** 0-based. */
1781
+ current: number;
1782
+ count: number;
1783
+ goTo: (index: number) => void | undefined;
1784
+ next: () => void | undefined;
1785
+ previous: () => void | undefined;
1786
+ scrollToAnnotation(id: string): void;
1787
+ };
1788
+ //#endregion
1789
+ //#region src/hooks/useHistory.d.ts
1790
+ /**
1791
+ * Undo and redo. Uncontrolled documents use the core history; controlled hosts that pass
1792
+ * `history` to InkRoot get a snapshot stack over their own list, applied through
1793
+ * `onAnnotationsChange`.
1794
+ */
1795
+ export declare function useHistory(): InkHistory;
1796
+ //#endregion
1797
+ //#region src/hooks/useEmbedded.d.ts
1798
+ export declare function useEmbedded(): {
1799
+ summary: readonly import("@inkbar/core").EmbeddedSummary[];
1800
+ total: number;
1801
+ hasAny: boolean;
1802
+ };
1803
+ //#endregion
1804
+ //#region src/components/InkRoot.d.ts
1805
+ interface InkRootHandle {
1806
+ readonly document: InkDocument | null;
1807
+ readonly status: InkStatus;
1808
+ readonly rootEl: HTMLElement | null;
1809
+ /** What `useHistory()` returns inside the root. A controlled host calls `clear()` after loading its saved list. */
1810
+ readonly history: InkHistory;
1811
+ }
1812
+ interface InkRootProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'onChange' | 'onError'> {
1813
+ src: DocumentSource | null;
1814
+ assets: PdfAssets;
1815
+ password?: string | undefined;
1816
+ /** Colour defaults. Without it, the theme's CSS variables on the root element apply. */
1817
+ defaults?: AnnotationDefaults | undefined;
1818
+ /**
1819
+ * Pass (with `onAnnotationsChange`) to put annotations under the host's control. The mode
1820
+ * is fixed when a document opens: passing or dropping this prop later takes effect on the
1821
+ * next open.
1822
+ */
1823
+ annotations?: Annotation[] | undefined;
1824
+ onAnnotationsChange?: ((next: Annotation[]) => void) | undefined;
1825
+ onChange?: ((change: AnnotationChange) => void) | undefined;
1826
+ tool?: ToolId | undefined;
1827
+ onToolChange?: ((tool: ToolId) => void) | undefined;
1828
+ page?: number | undefined;
1829
+ onPageChange?: ((page: number) => void) | undefined;
1830
+ zoom?: ZoomValue | undefined;
1831
+ onZoomChange?: ((zoom: ZoomValue) => void) | undefined;
1832
+ /** Undo history. Defaults to on for uncontrolled, off for controlled. */
1833
+ history?: boolean | undefined;
1834
+ asChild?: boolean | undefined;
1835
+ onReady?: ((doc: InkDocument) => void) | undefined;
1836
+ onError?: ((error: InkError) => void) | undefined;
1837
+ onActivate?: ((id: string) => void) | undefined;
1838
+ children?: ReactNode | ((props: {
1839
+ status: InkStatus;
1840
+ document: InkDocument | null;
1841
+ }) => ReactNode);
1842
+ ref?: Ref<InkRootHandle>;
1843
+ }
1844
+ export declare function InkRoot({ src, assets, password, defaults, annotations, onAnnotationsChange, onChange, tool, onToolChange, page, onPageChange, zoom, onZoomChange, history, asChild, onReady, onError, onActivate, children, ref, ...rest }: InkRootProps): import("react").JSX.Element;
1845
+ //#endregion
1846
+ //#region src/components/InkViewport.d.ts
1847
+ interface InkViewportProps extends ComponentPropsWithoutRef<'div'> {
1848
+ mode?: LayoutMode;
1849
+ rotation?: ViewRotation;
1850
+ /** Gap between pages, CSS px. */
1851
+ gap?: number;
1852
+ /** Pages kept mounted either side of the visible ones. */
1853
+ buffer?: number;
1854
+ loading?: ReactNode;
1855
+ empty?: ReactNode;
1856
+ error?: ReactNode | ((props: {
1857
+ error: InkError;
1858
+ }) => ReactNode);
1859
+ renderAnnotation?: ((props: AnnotationSlotProps$1) => ReactNode) | undefined;
1860
+ /** Shown inside a page that failed to render. The rest of the document stays usable. */
1861
+ renderPageError?: ((props: {
1862
+ error: InkError;
1863
+ page: number;
1864
+ }) => ReactNode) | undefined;
1865
+ }
1866
+ export declare function InkViewport({ mode, rotation, gap, buffer, loading, empty, error, renderAnnotation, renderPageError, className, ...rest }: InkViewportProps): import("react").JSX.Element;
1867
+ //#endregion
1868
+ //#region src/components/InkPage.d.ts
1869
+ interface InkPageProps {
1870
+ page: number;
1871
+ host: HTMLElement;
1872
+ /** The engine's page mount in `host`. */
1873
+ mount: PageMount;
1874
+ /** The engine's error for this page, `null` while it renders. */
1875
+ error: InkError | null;
1876
+ /** Fixed for the life of the mount: the engine rebuilds when it changes. */
1877
+ customAnnotations?: boolean;
1878
+ renderAnnotation?: ((props: AnnotationSlotProps$1) => ReactNode) | undefined;
1879
+ renderPageError?: ((props: {
1880
+ error: InkError;
1881
+ page: number;
1882
+ }) => ReactNode) | undefined;
1883
+ }
1884
+ export declare function InkPage({ page, host, mount, error, customAnnotations, renderAnnotation, renderPageError }: InkPageProps): import("react").JSX.Element;
1885
+ //#endregion
1886
+ //#region src/components/InkAnnotation.d.ts
1887
+ interface InkAnnotationProps {
1888
+ annotation: Annotation;
1889
+ /** The overlay element; its `data-state` (which includes hover) drives `state`. */
1890
+ element?: HTMLElement | undefined;
1891
+ children: (props: AnnotationSlotProps$1) => ReactNode;
1892
+ }
1893
+ export declare function InkAnnotation({ annotation, element, children }: InkAnnotationProps): import("react").JSX.Element;
1894
+ //#endregion
1895
+ //#region src/components/InkToolbar.d.ts
1896
+ interface InkToolbarProps extends Omit<ComponentPropsWithoutRef<'div'>, 'dir'> {
1897
+ /** Radix narrows text direction to these two values. */
1898
+ dir?: 'ltr' | 'rtl';
1899
+ label?: string;
1900
+ asChild?: boolean;
1901
+ }
1902
+ export declare function InkToolbar({ label, asChild, className, children, ...rest }: InkToolbarProps): import("react").JSX.Element;
1903
+ //#endregion
1904
+ //#region src/components/InkIcon.d.ts
1905
+ interface InkIconProps {
1906
+ icon: IconNode;
1907
+ size?: number;
1908
+ }
1909
+ export declare function InkIcon({ icon, size }: InkIconProps): import("react").JSX.Element;
1910
+ //#endregion
1911
+ //#region src/components/InkToolButton.d.ts
1912
+ interface InkToolButtonProps extends Omit<ComponentPropsWithoutRef<'button'>, 'children'> {
1913
+ tool: ToolId;
1914
+ label?: string | undefined;
1915
+ asChild?: boolean;
1916
+ children?: ReactNode | ((props: {
1917
+ active: boolean;
1918
+ label: string;
1919
+ }) => ReactNode);
1920
+ }
1921
+ export declare function InkToolButton({ tool, label, asChild, className, children, onClick, ...rest }: InkToolButtonProps): import("react").JSX.Element;
1922
+ //#endregion
1923
+ //#region src/components/InkToolbarSeparator.d.ts
1924
+ type InkToolbarSeparatorProps = ComponentPropsWithoutRef<'div'>;
1925
+ /**
1926
+ * A divider between groups of controls in a horizontal toolbar. Not focusable. A plain div
1927
+ * rather than Radix's separator, which reads as horizontal inside a horizontal toolbar.
1928
+ */
1929
+ export declare function InkToolbarSeparator({ className, ...rest }: InkToolbarSeparatorProps): import("react").JSX.Element;
1930
+ //#endregion
1931
+ //#region src/components/history-button.d.ts
1932
+ /** Props of `InkUndo` and `InkRedo`: a toolbar button that may render as its child. */
1933
+ interface InkHistoryButtonProps extends ComponentPropsWithoutRef<'button'> {
1934
+ asChild?: boolean;
1935
+ }
1936
+ //#endregion
1937
+ //#region src/components/InkUndo.d.ts
1938
+ export declare function InkUndo({ asChild, className, children, disabled, onClick, ...rest }: InkHistoryButtonProps): import("react").JSX.Element;
1939
+ //#endregion
1940
+ //#region src/components/InkRedo.d.ts
1941
+ export declare function InkRedo({ asChild, className, children, disabled, onClick, ...rest }: InkHistoryButtonProps): import("react").JSX.Element;
1942
+ //#endregion
1943
+ //#region src/components/zoom-button.d.ts
1944
+ /** Props of `InkZoomIn` and `InkZoomOut`: a toolbar button that may render as its child. */
1945
+ interface InkZoomButtonProps extends ComponentPropsWithoutRef<'button'> {
1946
+ asChild?: boolean;
1947
+ }
1948
+ //#endregion
1949
+ //#region src/components/InkZoomIn.d.ts
1950
+ export declare function InkZoomIn({ asChild, className, children, onClick, ...rest }: InkZoomButtonProps): import("react").JSX.Element;
1951
+ //#endregion
1952
+ //#region src/components/InkZoomOut.d.ts
1953
+ export declare function InkZoomOut({ asChild, className, children, onClick, ...rest }: InkZoomButtonProps): import("react").JSX.Element;
1954
+ //#endregion
1955
+ //#region src/components/InkZoomSelect.d.ts
1956
+ /** Props of the select's trigger button; the options come from the zoom levels. */
1957
+ type InkZoomSelectProps = Omit<ComponentPropsWithoutRef<typeof Select.Trigger>, 'children' | 'asChild'>;
1958
+ export declare function InkZoomSelect({ className, ...rest }: InkZoomSelectProps): import("react").JSX.Element;
1959
+ //#endregion
1960
+ //#region src/components/InkPageInput.d.ts
1961
+ type InkPageInputProps = Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'type' | 'min' | 'max'>;
1962
+ export declare function InkPageInput({ className, onKeyDown: onKeyDownProp, ...rest }: InkPageInputProps): import("react").JSX.Element;
1963
+ //#endregion
1964
+ //#region src/components/InkPageCount.d.ts
1965
+ export declare function InkPageCount({ className, ...rest }: ComponentPropsWithoutRef<'span'>): import("react").JSX.Element;
1966
+ //#endregion
1967
+ //#region src/components/page-button.d.ts
1968
+ /** Props of `InkPrevPage` and `InkNextPage`: a toolbar button that may render as its child. */
1969
+ interface InkPageButtonProps extends ComponentPropsWithoutRef<'button'> {
1970
+ asChild?: boolean;
1971
+ }
1972
+ //#endregion
1973
+ //#region src/components/InkPrevPage.d.ts
1974
+ export declare function InkPrevPage({ asChild, className, children, disabled, onClick, ...rest }: InkPageButtonProps): import("react").JSX.Element;
1975
+ //#endregion
1976
+ //#region src/components/InkNextPage.d.ts
1977
+ export declare function InkNextPage({ asChild, className, children, disabled, onClick, ...rest }: InkPageButtonProps): import("react").JSX.Element;
1978
+ //#endregion
1979
+ //#region src/components/InkNotePopover.d.ts
1980
+ interface InkNotePopoverProps {
1981
+ children?: ((props: NotePopoverSlotProps$1) => ReactNode) | undefined;
1982
+ }
1983
+ export declare function InkNotePopover({ children }: InkNotePopoverProps): import("react").JSX.Element;
1984
+ //#endregion
1985
+ //#region src/components/InkSuggestionCard.d.ts
1986
+ interface InkSuggestionCardProps {
1987
+ children?: ((props: SuggestionCardSlotProps$1) => ReactNode) | undefined;
1988
+ }
1989
+ export declare function InkSuggestionCard({ children }: InkSuggestionCardProps): import("react").JSX.Element;
1990
+ //#endregion
1991
+ export type { AnnotationSlotProps, AnnotationState, ConfidenceBucket, InkAnnotationProps, InkContext, InkHistory, InkHistoryButtonProps, InkIconProps, InkNotePopoverProps, InkPageButtonProps, InkPageInputProps, InkPageProps, InkRootHandle, InkRootProps, InkStatus, InkSuggestionCardProps, InkToolButtonProps, InkToolbarProps, InkToolbarSeparatorProps, InkViewportProps, InkZoomButtonProps, InkZoomSelectProps, NotePopoverSlotProps, SuggestionCardSlotProps };
1992
+ //# sourceMappingURL=index.d.mts.map