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