@inkbar/core 0.3.0 → 0.4.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.
- package/README.md +46 -7
- package/dist/dom.d.mts +715 -26
- package/dist/dom.d.mts.map +1 -1
- package/dist/dom.mjs +5782 -1410
- package/dist/dom.mjs.map +1 -1
- package/dist/index.d.mts +123 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/signatures-BHYKTwYE.d.mts +2280 -0
- package/dist/signatures-BHYKTwYE.d.mts.map +1 -0
- package/dist/signatures-DF2VmNVa.mjs +3922 -0
- package/dist/signatures-DF2VmNVa.mjs.map +1 -0
- package/package.json +4 -2
- package/schema.json +757 -51
- package/dist/document-BftlPZKU.d.mts +0 -1455
- package/dist/document-BftlPZKU.d.mts.map +0 -1
- package/dist/threads-2USvyGpX.mjs +0 -1901
- package/dist/threads-2USvyGpX.mjs.map +0 -1
|
@@ -1,1455 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as pdfjs from "pdfjs-dist";
|
|
3
|
-
//#region src/model/geometry.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* All geometry in this module is PDF default user space: points, origin at the
|
|
6
|
-
* lower-left of the page, before /Rotate. Pixel conversions live in dom/transform.ts.
|
|
7
|
-
*/
|
|
8
|
-
interface Point {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
}
|
|
12
|
-
/** Axis-aligned box. `x`,`y` is the lower-left corner. */
|
|
13
|
-
interface Rect {
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
}
|
|
19
|
-
/** Four corners in PDF.js's normalised QuadPoints order: upper-left, upper-right, lower-left, lower-right. */
|
|
20
|
-
interface Quad {
|
|
21
|
-
p1: Point;
|
|
22
|
-
p2: Point;
|
|
23
|
-
p3: Point;
|
|
24
|
-
p4: Point;
|
|
25
|
-
}
|
|
26
|
-
/** PDF transformation matrix [a b c d e f]: x' = a·x + c·y + e, y' = b·x + d·y + f. */
|
|
27
|
-
type Matrix = readonly [number, number, number, number, number, number];
|
|
28
|
-
declare function approxEqual(a: number, b: number, eps?: number): boolean;
|
|
29
|
-
declare function rectFromPoints(a: Point, b: Point): Rect;
|
|
30
|
-
declare function rectFromQuad(q: Quad): Rect;
|
|
31
|
-
declare function quadFromRect(r: Rect): Quad;
|
|
32
|
-
declare function unionRects(rects: readonly Rect[]): Rect;
|
|
33
|
-
declare function rectsIntersect(a: Rect, b: Rect): boolean;
|
|
34
|
-
declare function rectContainsPoint(r: Rect, p: Point): boolean;
|
|
35
|
-
declare function translateRect(r: Rect, dx: number, dy: number): Rect;
|
|
36
|
-
declare function translateQuad(q: Quad, dx: number, dy: number): Quad;
|
|
37
|
-
declare function applyMatrix(m: Matrix, p: Point): Point;
|
|
38
|
-
declare function invertMatrix(m: Matrix): Matrix;
|
|
39
|
-
/** Returns the matrix that applies `a` first, then `b`. */
|
|
40
|
-
declare function multiplyMatrix(a: Matrix, b: Matrix): Matrix;
|
|
41
|
-
declare function pointsFromFlat(flat: ArrayLike<number>): Point[];
|
|
42
|
-
/** Eight numbers per quad, in PDF.js's normalised order. Trailing partial quads are dropped. */
|
|
43
|
-
declare function quadsFromFlat(flat: ArrayLike<number>): Quad[];
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/pdfjs/types.d.ts
|
|
46
|
-
type PdfjsModule = typeof pdfjs;
|
|
47
|
-
type PdfjsDocument = pdfjs.PDFDocumentProxy;
|
|
48
|
-
type PdfjsPage = pdfjs.PDFPageProxy;
|
|
49
|
-
/** The shape of one entry from `PDFPageProxy.getAnnotations()`, limited to the fields Inkbar reads. */
|
|
50
|
-
interface PdfjsAnnotationData {
|
|
51
|
-
id: string;
|
|
52
|
-
subtype: string;
|
|
53
|
-
annotationType: number;
|
|
54
|
-
rect: [number, number, number, number];
|
|
55
|
-
quadPoints?: Float32Array | number[] | null;
|
|
56
|
-
color?: Uint8ClampedArray | null;
|
|
57
|
-
interiorColor?: Uint8ClampedArray | null;
|
|
58
|
-
opacity?: number;
|
|
59
|
-
contentsObj?: {
|
|
60
|
-
str: string;
|
|
61
|
-
dir: string;
|
|
62
|
-
};
|
|
63
|
-
titleObj?: {
|
|
64
|
-
str: string;
|
|
65
|
-
dir: string;
|
|
66
|
-
};
|
|
67
|
-
inReplyTo?: string;
|
|
68
|
-
replyType?: string;
|
|
69
|
-
creationDate?: string | null;
|
|
70
|
-
modificationDate?: string | null;
|
|
71
|
-
name?: string;
|
|
72
|
-
borderStyle?: {
|
|
73
|
-
width: number;
|
|
74
|
-
} | null;
|
|
75
|
-
lineCoordinates?: [number, number, number, number];
|
|
76
|
-
vertices?: Float32Array | number[];
|
|
77
|
-
inkLists?: Array<Float32Array | number[]>;
|
|
78
|
-
lineEndings?: string[];
|
|
79
|
-
/** Text under a markup annotation, not a redaction's overlay text. */
|
|
80
|
-
overlaidText?: string;
|
|
81
|
-
defaultAppearanceData?: {
|
|
82
|
-
fontSize: number;
|
|
83
|
-
fontName?: string;
|
|
84
|
-
fontColor?: Uint8ClampedArray | number[] | {
|
|
85
|
-
[index: number]: number;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
hasAppearance?: boolean;
|
|
89
|
-
hidden?: boolean;
|
|
90
|
-
noView?: boolean;
|
|
91
|
-
}
|
|
92
|
-
interface PdfAssets {
|
|
93
|
-
/** URL (or file path in Node) of `pdf.worker(.min).mjs`. */
|
|
94
|
-
worker: string;
|
|
95
|
-
/** Directory URL ending in `/` containing the packed CMaps. */
|
|
96
|
-
cMaps: string;
|
|
97
|
-
/** Directory URL ending in `/` containing the standard 14 fonts. */
|
|
98
|
-
standardFonts: string;
|
|
99
|
-
/** Directory URL ending in `/` containing the image-decoder wasm files. */
|
|
100
|
-
wasm: string;
|
|
101
|
-
/** Directory URL ending in `/` containing ICC profiles. Optional. */
|
|
102
|
-
icc?: string;
|
|
103
|
-
}
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/model/pages.d.ts
|
|
106
|
-
type PageRotation = 0 | 90 | 180 | 270;
|
|
107
|
-
interface PageInfo {
|
|
108
|
-
index: number;
|
|
109
|
-
/** CropBox ∩ MediaBox in user space before /Rotate, as PDF.js reports `page.view`. */
|
|
110
|
-
box: Rect;
|
|
111
|
-
/** The page's own /Rotate. View rotation applied by the viewer is separate. */
|
|
112
|
-
rotate: PageRotation;
|
|
113
|
-
userUnit: number;
|
|
114
|
-
/** Unrotated box width in points. */
|
|
115
|
-
width: number;
|
|
116
|
-
/** Unrotated box height in points. */
|
|
117
|
-
height: number;
|
|
118
|
-
}
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/model/readable.d.ts
|
|
121
|
-
interface Readable<T> {
|
|
122
|
-
get(): T;
|
|
123
|
-
subscribe(fn: (value: T) => void): () => void;
|
|
124
|
-
}
|
|
125
|
-
interface Writable<T> extends Readable<T> {
|
|
126
|
-
set(this: void, value: T): void;
|
|
127
|
-
/** Safe to call detached (`const { update } = store`). */
|
|
128
|
-
update(this: void, fn: (value: T) => T): void;
|
|
129
|
-
}
|
|
130
|
-
declare function writable<T>(initial: T): Writable<T>;
|
|
131
|
-
/**
|
|
132
|
-
* A readable computed from `source`. It subscribes to the source only while it has
|
|
133
|
-
* subscribers of its own, so an unobserved derived value holds no reference to the source.
|
|
134
|
-
*/
|
|
135
|
-
declare function derived<T, U>(source: Readable<T>, fn: (value: T) => U): Readable<U>;
|
|
136
|
-
declare function readonly<T>(w: Writable<T>): Readable<T>;
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/model/annotations/types.d.ts
|
|
139
|
-
declare const ANNOTATION_FORMAT = "inkbar/annotations";
|
|
140
|
-
declare const ANNOTATION_VERSION = 1;
|
|
141
|
-
declare const PointSchema: z.ZodObject<{
|
|
142
|
-
x: z.ZodNumber;
|
|
143
|
-
y: z.ZodNumber;
|
|
144
|
-
}, z.core.$strip>;
|
|
145
|
-
declare const RectSchema: z.ZodObject<{
|
|
146
|
-
x: z.ZodNumber;
|
|
147
|
-
y: z.ZodNumber;
|
|
148
|
-
width: z.ZodNumber;
|
|
149
|
-
height: z.ZodNumber;
|
|
150
|
-
}, z.core.$strip>;
|
|
151
|
-
declare const QuadSchema: z.ZodObject<{
|
|
152
|
-
p1: z.ZodObject<{
|
|
153
|
-
x: z.ZodNumber;
|
|
154
|
-
y: z.ZodNumber;
|
|
155
|
-
}, z.core.$strip>;
|
|
156
|
-
p2: z.ZodObject<{
|
|
157
|
-
x: z.ZodNumber;
|
|
158
|
-
y: z.ZodNumber;
|
|
159
|
-
}, z.core.$strip>;
|
|
160
|
-
p3: z.ZodObject<{
|
|
161
|
-
x: z.ZodNumber;
|
|
162
|
-
y: z.ZodNumber;
|
|
163
|
-
}, z.core.$strip>;
|
|
164
|
-
p4: z.ZodObject<{
|
|
165
|
-
x: z.ZodNumber;
|
|
166
|
-
y: z.ZodNumber;
|
|
167
|
-
}, z.core.$strip>;
|
|
168
|
-
}, z.core.$strip>;
|
|
169
|
-
declare const TextMarkupSchema: z.ZodObject<{
|
|
170
|
-
id: z.ZodString;
|
|
171
|
-
page: z.ZodNumber;
|
|
172
|
-
rect: z.ZodObject<{
|
|
173
|
-
x: z.ZodNumber;
|
|
174
|
-
y: z.ZodNumber;
|
|
175
|
-
width: z.ZodNumber;
|
|
176
|
-
height: z.ZodNumber;
|
|
177
|
-
}, z.core.$strip>;
|
|
178
|
-
color: z.ZodString;
|
|
179
|
-
opacity: z.ZodNumber;
|
|
180
|
-
author: z.ZodOptional<z.ZodString>;
|
|
181
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
182
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
183
|
-
createdAt: z.ZodISODateTime;
|
|
184
|
-
modifiedAt: z.ZodISODateTime;
|
|
185
|
-
source: z.ZodEnum<{
|
|
186
|
-
session: "session";
|
|
187
|
-
pdf: "pdf";
|
|
188
|
-
}>;
|
|
189
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
191
|
-
type: z.ZodEnum<{
|
|
192
|
-
highlight: "highlight";
|
|
193
|
-
underline: "underline";
|
|
194
|
-
strikeout: "strikeout";
|
|
195
|
-
squiggly: "squiggly";
|
|
196
|
-
}>;
|
|
197
|
-
quads: z.ZodArray<z.ZodObject<{
|
|
198
|
-
p1: z.ZodObject<{
|
|
199
|
-
x: z.ZodNumber;
|
|
200
|
-
y: z.ZodNumber;
|
|
201
|
-
}, z.core.$strip>;
|
|
202
|
-
p2: z.ZodObject<{
|
|
203
|
-
x: z.ZodNumber;
|
|
204
|
-
y: z.ZodNumber;
|
|
205
|
-
}, z.core.$strip>;
|
|
206
|
-
p3: z.ZodObject<{
|
|
207
|
-
x: z.ZodNumber;
|
|
208
|
-
y: z.ZodNumber;
|
|
209
|
-
}, z.core.$strip>;
|
|
210
|
-
p4: z.ZodObject<{
|
|
211
|
-
x: z.ZodNumber;
|
|
212
|
-
y: z.ZodNumber;
|
|
213
|
-
}, z.core.$strip>;
|
|
214
|
-
}, z.core.$strip>>;
|
|
215
|
-
}, z.core.$strip>;
|
|
216
|
-
declare const NoteSchema: z.ZodObject<{
|
|
217
|
-
id: z.ZodString;
|
|
218
|
-
page: z.ZodNumber;
|
|
219
|
-
rect: z.ZodObject<{
|
|
220
|
-
x: z.ZodNumber;
|
|
221
|
-
y: z.ZodNumber;
|
|
222
|
-
width: z.ZodNumber;
|
|
223
|
-
height: z.ZodNumber;
|
|
224
|
-
}, z.core.$strip>;
|
|
225
|
-
color: z.ZodString;
|
|
226
|
-
opacity: z.ZodNumber;
|
|
227
|
-
author: z.ZodOptional<z.ZodString>;
|
|
228
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
229
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
230
|
-
createdAt: z.ZodISODateTime;
|
|
231
|
-
modifiedAt: z.ZodISODateTime;
|
|
232
|
-
source: z.ZodEnum<{
|
|
233
|
-
session: "session";
|
|
234
|
-
pdf: "pdf";
|
|
235
|
-
}>;
|
|
236
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
237
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
238
|
-
type: z.ZodLiteral<"text">;
|
|
239
|
-
icon: z.ZodDefault<z.ZodEnum<{
|
|
240
|
-
comment: "comment";
|
|
241
|
-
note: "note";
|
|
242
|
-
help: "help";
|
|
243
|
-
insert: "insert";
|
|
244
|
-
key: "key";
|
|
245
|
-
paragraph: "paragraph";
|
|
246
|
-
}>>;
|
|
247
|
-
}, z.core.$strip>;
|
|
248
|
-
declare const FreeTextSchema: z.ZodObject<{
|
|
249
|
-
id: z.ZodString;
|
|
250
|
-
page: z.ZodNumber;
|
|
251
|
-
rect: z.ZodObject<{
|
|
252
|
-
x: z.ZodNumber;
|
|
253
|
-
y: z.ZodNumber;
|
|
254
|
-
width: z.ZodNumber;
|
|
255
|
-
height: z.ZodNumber;
|
|
256
|
-
}, z.core.$strip>;
|
|
257
|
-
color: z.ZodString;
|
|
258
|
-
opacity: z.ZodNumber;
|
|
259
|
-
author: z.ZodOptional<z.ZodString>;
|
|
260
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
261
|
-
createdAt: z.ZodISODateTime;
|
|
262
|
-
modifiedAt: z.ZodISODateTime;
|
|
263
|
-
source: z.ZodEnum<{
|
|
264
|
-
session: "session";
|
|
265
|
-
pdf: "pdf";
|
|
266
|
-
}>;
|
|
267
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
269
|
-
type: z.ZodLiteral<"freetext">;
|
|
270
|
-
contents: z.ZodString;
|
|
271
|
-
fontSize: z.ZodDefault<z.ZodNumber>;
|
|
272
|
-
fontFamily: z.ZodDefault<z.ZodString>;
|
|
273
|
-
align: z.ZodDefault<z.ZodEnum<{
|
|
274
|
-
left: "left";
|
|
275
|
-
center: "center";
|
|
276
|
-
right: "right";
|
|
277
|
-
}>>;
|
|
278
|
-
callout: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
279
|
-
x: z.ZodNumber;
|
|
280
|
-
y: z.ZodNumber;
|
|
281
|
-
}, z.core.$strip>>>;
|
|
282
|
-
}, z.core.$strip>;
|
|
283
|
-
declare const ShapeSchema: z.ZodObject<{
|
|
284
|
-
id: z.ZodString;
|
|
285
|
-
page: z.ZodNumber;
|
|
286
|
-
rect: z.ZodObject<{
|
|
287
|
-
x: z.ZodNumber;
|
|
288
|
-
y: z.ZodNumber;
|
|
289
|
-
width: z.ZodNumber;
|
|
290
|
-
height: z.ZodNumber;
|
|
291
|
-
}, z.core.$strip>;
|
|
292
|
-
color: z.ZodString;
|
|
293
|
-
opacity: z.ZodNumber;
|
|
294
|
-
author: z.ZodOptional<z.ZodString>;
|
|
295
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
296
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
297
|
-
createdAt: z.ZodISODateTime;
|
|
298
|
-
modifiedAt: z.ZodISODateTime;
|
|
299
|
-
source: z.ZodEnum<{
|
|
300
|
-
session: "session";
|
|
301
|
-
pdf: "pdf";
|
|
302
|
-
}>;
|
|
303
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
304
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
305
|
-
type: z.ZodEnum<{
|
|
306
|
-
square: "square";
|
|
307
|
-
circle: "circle";
|
|
308
|
-
}>;
|
|
309
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
310
|
-
interiorColor: z.ZodOptional<z.ZodString>;
|
|
311
|
-
}, z.core.$strip>;
|
|
312
|
-
declare const LineEndingSchema: z.ZodEnum<{
|
|
313
|
-
square: "square";
|
|
314
|
-
circle: "circle";
|
|
315
|
-
none: "none";
|
|
316
|
-
openArrow: "openArrow";
|
|
317
|
-
closedArrow: "closedArrow";
|
|
318
|
-
diamond: "diamond";
|
|
319
|
-
butt: "butt";
|
|
320
|
-
slash: "slash";
|
|
321
|
-
}>;
|
|
322
|
-
declare const LineSchema: z.ZodObject<{
|
|
323
|
-
id: z.ZodString;
|
|
324
|
-
page: z.ZodNumber;
|
|
325
|
-
rect: z.ZodObject<{
|
|
326
|
-
x: z.ZodNumber;
|
|
327
|
-
y: z.ZodNumber;
|
|
328
|
-
width: z.ZodNumber;
|
|
329
|
-
height: z.ZodNumber;
|
|
330
|
-
}, z.core.$strip>;
|
|
331
|
-
color: z.ZodString;
|
|
332
|
-
opacity: z.ZodNumber;
|
|
333
|
-
author: z.ZodOptional<z.ZodString>;
|
|
334
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
335
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
336
|
-
createdAt: z.ZodISODateTime;
|
|
337
|
-
modifiedAt: z.ZodISODateTime;
|
|
338
|
-
source: z.ZodEnum<{
|
|
339
|
-
session: "session";
|
|
340
|
-
pdf: "pdf";
|
|
341
|
-
}>;
|
|
342
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
343
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
344
|
-
type: z.ZodLiteral<"line">;
|
|
345
|
-
start: z.ZodObject<{
|
|
346
|
-
x: z.ZodNumber;
|
|
347
|
-
y: z.ZodNumber;
|
|
348
|
-
}, z.core.$strip>;
|
|
349
|
-
end: z.ZodObject<{
|
|
350
|
-
x: z.ZodNumber;
|
|
351
|
-
y: z.ZodNumber;
|
|
352
|
-
}, z.core.$strip>;
|
|
353
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
354
|
-
head: z.ZodOptional<z.ZodEnum<{
|
|
355
|
-
square: "square";
|
|
356
|
-
circle: "circle";
|
|
357
|
-
none: "none";
|
|
358
|
-
openArrow: "openArrow";
|
|
359
|
-
closedArrow: "closedArrow";
|
|
360
|
-
diamond: "diamond";
|
|
361
|
-
butt: "butt";
|
|
362
|
-
slash: "slash";
|
|
363
|
-
}>>;
|
|
364
|
-
tail: z.ZodOptional<z.ZodEnum<{
|
|
365
|
-
square: "square";
|
|
366
|
-
circle: "circle";
|
|
367
|
-
none: "none";
|
|
368
|
-
openArrow: "openArrow";
|
|
369
|
-
closedArrow: "closedArrow";
|
|
370
|
-
diamond: "diamond";
|
|
371
|
-
butt: "butt";
|
|
372
|
-
slash: "slash";
|
|
373
|
-
}>>;
|
|
374
|
-
}, z.core.$strip>;
|
|
375
|
-
declare const PolySchema: z.ZodObject<{
|
|
376
|
-
id: z.ZodString;
|
|
377
|
-
page: z.ZodNumber;
|
|
378
|
-
rect: z.ZodObject<{
|
|
379
|
-
x: z.ZodNumber;
|
|
380
|
-
y: z.ZodNumber;
|
|
381
|
-
width: z.ZodNumber;
|
|
382
|
-
height: z.ZodNumber;
|
|
383
|
-
}, z.core.$strip>;
|
|
384
|
-
color: z.ZodString;
|
|
385
|
-
opacity: z.ZodNumber;
|
|
386
|
-
author: z.ZodOptional<z.ZodString>;
|
|
387
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
388
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
389
|
-
createdAt: z.ZodISODateTime;
|
|
390
|
-
modifiedAt: z.ZodISODateTime;
|
|
391
|
-
source: z.ZodEnum<{
|
|
392
|
-
session: "session";
|
|
393
|
-
pdf: "pdf";
|
|
394
|
-
}>;
|
|
395
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
396
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
397
|
-
type: z.ZodEnum<{
|
|
398
|
-
polyline: "polyline";
|
|
399
|
-
polygon: "polygon";
|
|
400
|
-
}>;
|
|
401
|
-
vertices: z.ZodArray<z.ZodObject<{
|
|
402
|
-
x: z.ZodNumber;
|
|
403
|
-
y: z.ZodNumber;
|
|
404
|
-
}, z.core.$strip>>;
|
|
405
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
406
|
-
interiorColor: z.ZodOptional<z.ZodString>;
|
|
407
|
-
}, z.core.$strip>;
|
|
408
|
-
declare const InkSchema: z.ZodObject<{
|
|
409
|
-
id: z.ZodString;
|
|
410
|
-
page: z.ZodNumber;
|
|
411
|
-
rect: z.ZodObject<{
|
|
412
|
-
x: z.ZodNumber;
|
|
413
|
-
y: z.ZodNumber;
|
|
414
|
-
width: z.ZodNumber;
|
|
415
|
-
height: z.ZodNumber;
|
|
416
|
-
}, z.core.$strip>;
|
|
417
|
-
color: z.ZodString;
|
|
418
|
-
opacity: z.ZodNumber;
|
|
419
|
-
author: z.ZodOptional<z.ZodString>;
|
|
420
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
421
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
422
|
-
createdAt: z.ZodISODateTime;
|
|
423
|
-
modifiedAt: z.ZodISODateTime;
|
|
424
|
-
source: z.ZodEnum<{
|
|
425
|
-
session: "session";
|
|
426
|
-
pdf: "pdf";
|
|
427
|
-
}>;
|
|
428
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
429
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
430
|
-
type: z.ZodLiteral<"ink">;
|
|
431
|
-
inklist: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
432
|
-
x: z.ZodNumber;
|
|
433
|
-
y: z.ZodNumber;
|
|
434
|
-
}, z.core.$strip>>>;
|
|
435
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
436
|
-
}, z.core.$strip>;
|
|
437
|
-
declare const SuggestionSchema: z.ZodObject<{
|
|
438
|
-
jobId: z.ZodOptional<z.ZodString>;
|
|
439
|
-
confidence: z.ZodNumber;
|
|
440
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
441
|
-
explanation: z.ZodOptional<z.ZodString>;
|
|
442
|
-
recommendation: z.ZodOptional<z.ZodEnum<{
|
|
443
|
-
redact: "redact";
|
|
444
|
-
review: "review";
|
|
445
|
-
keep: "keep";
|
|
446
|
-
}>>;
|
|
447
|
-
}, z.core.$strip>;
|
|
448
|
-
declare const RedactSchema: z.ZodObject<{
|
|
449
|
-
id: z.ZodString;
|
|
450
|
-
page: z.ZodNumber;
|
|
451
|
-
rect: z.ZodObject<{
|
|
452
|
-
x: z.ZodNumber;
|
|
453
|
-
y: z.ZodNumber;
|
|
454
|
-
width: z.ZodNumber;
|
|
455
|
-
height: z.ZodNumber;
|
|
456
|
-
}, z.core.$strip>;
|
|
457
|
-
color: z.ZodString;
|
|
458
|
-
opacity: z.ZodNumber;
|
|
459
|
-
author: z.ZodOptional<z.ZodString>;
|
|
460
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
461
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
462
|
-
createdAt: z.ZodISODateTime;
|
|
463
|
-
modifiedAt: z.ZodISODateTime;
|
|
464
|
-
source: z.ZodEnum<{
|
|
465
|
-
session: "session";
|
|
466
|
-
pdf: "pdf";
|
|
467
|
-
}>;
|
|
468
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
469
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
470
|
-
type: z.ZodLiteral<"redact">;
|
|
471
|
-
quads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
472
|
-
p1: z.ZodObject<{
|
|
473
|
-
x: z.ZodNumber;
|
|
474
|
-
y: z.ZodNumber;
|
|
475
|
-
}, z.core.$strip>;
|
|
476
|
-
p2: z.ZodObject<{
|
|
477
|
-
x: z.ZodNumber;
|
|
478
|
-
y: z.ZodNumber;
|
|
479
|
-
}, z.core.$strip>;
|
|
480
|
-
p3: z.ZodObject<{
|
|
481
|
-
x: z.ZodNumber;
|
|
482
|
-
y: z.ZodNumber;
|
|
483
|
-
}, z.core.$strip>;
|
|
484
|
-
p4: z.ZodObject<{
|
|
485
|
-
x: z.ZodNumber;
|
|
486
|
-
y: z.ZodNumber;
|
|
487
|
-
}, z.core.$strip>;
|
|
488
|
-
}, z.core.$strip>>>;
|
|
489
|
-
origin: z.ZodDefault<z.ZodEnum<{
|
|
490
|
-
user: "user";
|
|
491
|
-
suggested: "suggested";
|
|
492
|
-
}>>;
|
|
493
|
-
suggestion: z.ZodOptional<z.ZodObject<{
|
|
494
|
-
jobId: z.ZodOptional<z.ZodString>;
|
|
495
|
-
confidence: z.ZodNumber;
|
|
496
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
497
|
-
explanation: z.ZodOptional<z.ZodString>;
|
|
498
|
-
recommendation: z.ZodOptional<z.ZodEnum<{
|
|
499
|
-
redact: "redact";
|
|
500
|
-
review: "review";
|
|
501
|
-
keep: "keep";
|
|
502
|
-
}>>;
|
|
503
|
-
}, z.core.$strip>>;
|
|
504
|
-
overlayText: z.ZodOptional<z.ZodString>;
|
|
505
|
-
interiorColor: z.ZodString;
|
|
506
|
-
}, z.core.$strip>;
|
|
507
|
-
declare const AnnotationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
508
|
-
id: z.ZodString;
|
|
509
|
-
page: z.ZodNumber;
|
|
510
|
-
rect: z.ZodObject<{
|
|
511
|
-
x: z.ZodNumber;
|
|
512
|
-
y: z.ZodNumber;
|
|
513
|
-
width: z.ZodNumber;
|
|
514
|
-
height: z.ZodNumber;
|
|
515
|
-
}, z.core.$strip>;
|
|
516
|
-
color: z.ZodString;
|
|
517
|
-
opacity: z.ZodNumber;
|
|
518
|
-
author: z.ZodOptional<z.ZodString>;
|
|
519
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
520
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
521
|
-
createdAt: z.ZodISODateTime;
|
|
522
|
-
modifiedAt: z.ZodISODateTime;
|
|
523
|
-
source: z.ZodEnum<{
|
|
524
|
-
session: "session";
|
|
525
|
-
pdf: "pdf";
|
|
526
|
-
}>;
|
|
527
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
529
|
-
type: z.ZodEnum<{
|
|
530
|
-
highlight: "highlight";
|
|
531
|
-
underline: "underline";
|
|
532
|
-
strikeout: "strikeout";
|
|
533
|
-
squiggly: "squiggly";
|
|
534
|
-
}>;
|
|
535
|
-
quads: z.ZodArray<z.ZodObject<{
|
|
536
|
-
p1: z.ZodObject<{
|
|
537
|
-
x: z.ZodNumber;
|
|
538
|
-
y: z.ZodNumber;
|
|
539
|
-
}, z.core.$strip>;
|
|
540
|
-
p2: z.ZodObject<{
|
|
541
|
-
x: z.ZodNumber;
|
|
542
|
-
y: z.ZodNumber;
|
|
543
|
-
}, z.core.$strip>;
|
|
544
|
-
p3: z.ZodObject<{
|
|
545
|
-
x: z.ZodNumber;
|
|
546
|
-
y: z.ZodNumber;
|
|
547
|
-
}, z.core.$strip>;
|
|
548
|
-
p4: z.ZodObject<{
|
|
549
|
-
x: z.ZodNumber;
|
|
550
|
-
y: z.ZodNumber;
|
|
551
|
-
}, z.core.$strip>;
|
|
552
|
-
}, z.core.$strip>>;
|
|
553
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
554
|
-
id: z.ZodString;
|
|
555
|
-
page: z.ZodNumber;
|
|
556
|
-
rect: z.ZodObject<{
|
|
557
|
-
x: z.ZodNumber;
|
|
558
|
-
y: z.ZodNumber;
|
|
559
|
-
width: z.ZodNumber;
|
|
560
|
-
height: z.ZodNumber;
|
|
561
|
-
}, z.core.$strip>;
|
|
562
|
-
color: z.ZodString;
|
|
563
|
-
opacity: z.ZodNumber;
|
|
564
|
-
author: z.ZodOptional<z.ZodString>;
|
|
565
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
566
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
567
|
-
createdAt: z.ZodISODateTime;
|
|
568
|
-
modifiedAt: z.ZodISODateTime;
|
|
569
|
-
source: z.ZodEnum<{
|
|
570
|
-
session: "session";
|
|
571
|
-
pdf: "pdf";
|
|
572
|
-
}>;
|
|
573
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
574
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
575
|
-
type: z.ZodLiteral<"text">;
|
|
576
|
-
icon: z.ZodDefault<z.ZodEnum<{
|
|
577
|
-
comment: "comment";
|
|
578
|
-
note: "note";
|
|
579
|
-
help: "help";
|
|
580
|
-
insert: "insert";
|
|
581
|
-
key: "key";
|
|
582
|
-
paragraph: "paragraph";
|
|
583
|
-
}>>;
|
|
584
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
585
|
-
id: z.ZodString;
|
|
586
|
-
page: z.ZodNumber;
|
|
587
|
-
rect: z.ZodObject<{
|
|
588
|
-
x: z.ZodNumber;
|
|
589
|
-
y: z.ZodNumber;
|
|
590
|
-
width: z.ZodNumber;
|
|
591
|
-
height: z.ZodNumber;
|
|
592
|
-
}, z.core.$strip>;
|
|
593
|
-
color: z.ZodString;
|
|
594
|
-
opacity: z.ZodNumber;
|
|
595
|
-
author: z.ZodOptional<z.ZodString>;
|
|
596
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
597
|
-
createdAt: z.ZodISODateTime;
|
|
598
|
-
modifiedAt: z.ZodISODateTime;
|
|
599
|
-
source: z.ZodEnum<{
|
|
600
|
-
session: "session";
|
|
601
|
-
pdf: "pdf";
|
|
602
|
-
}>;
|
|
603
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
604
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
605
|
-
type: z.ZodLiteral<"freetext">;
|
|
606
|
-
contents: z.ZodString;
|
|
607
|
-
fontSize: z.ZodDefault<z.ZodNumber>;
|
|
608
|
-
fontFamily: z.ZodDefault<z.ZodString>;
|
|
609
|
-
align: z.ZodDefault<z.ZodEnum<{
|
|
610
|
-
left: "left";
|
|
611
|
-
center: "center";
|
|
612
|
-
right: "right";
|
|
613
|
-
}>>;
|
|
614
|
-
callout: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
615
|
-
x: z.ZodNumber;
|
|
616
|
-
y: z.ZodNumber;
|
|
617
|
-
}, z.core.$strip>>>;
|
|
618
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
619
|
-
id: z.ZodString;
|
|
620
|
-
page: z.ZodNumber;
|
|
621
|
-
rect: z.ZodObject<{
|
|
622
|
-
x: z.ZodNumber;
|
|
623
|
-
y: z.ZodNumber;
|
|
624
|
-
width: z.ZodNumber;
|
|
625
|
-
height: z.ZodNumber;
|
|
626
|
-
}, z.core.$strip>;
|
|
627
|
-
color: z.ZodString;
|
|
628
|
-
opacity: z.ZodNumber;
|
|
629
|
-
author: z.ZodOptional<z.ZodString>;
|
|
630
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
631
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
632
|
-
createdAt: z.ZodISODateTime;
|
|
633
|
-
modifiedAt: z.ZodISODateTime;
|
|
634
|
-
source: z.ZodEnum<{
|
|
635
|
-
session: "session";
|
|
636
|
-
pdf: "pdf";
|
|
637
|
-
}>;
|
|
638
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
639
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
640
|
-
type: z.ZodEnum<{
|
|
641
|
-
square: "square";
|
|
642
|
-
circle: "circle";
|
|
643
|
-
}>;
|
|
644
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
645
|
-
interiorColor: z.ZodOptional<z.ZodString>;
|
|
646
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
647
|
-
id: z.ZodString;
|
|
648
|
-
page: z.ZodNumber;
|
|
649
|
-
rect: z.ZodObject<{
|
|
650
|
-
x: z.ZodNumber;
|
|
651
|
-
y: z.ZodNumber;
|
|
652
|
-
width: z.ZodNumber;
|
|
653
|
-
height: z.ZodNumber;
|
|
654
|
-
}, z.core.$strip>;
|
|
655
|
-
color: z.ZodString;
|
|
656
|
-
opacity: z.ZodNumber;
|
|
657
|
-
author: z.ZodOptional<z.ZodString>;
|
|
658
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
659
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
660
|
-
createdAt: z.ZodISODateTime;
|
|
661
|
-
modifiedAt: z.ZodISODateTime;
|
|
662
|
-
source: z.ZodEnum<{
|
|
663
|
-
session: "session";
|
|
664
|
-
pdf: "pdf";
|
|
665
|
-
}>;
|
|
666
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
667
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
668
|
-
type: z.ZodLiteral<"line">;
|
|
669
|
-
start: z.ZodObject<{
|
|
670
|
-
x: z.ZodNumber;
|
|
671
|
-
y: z.ZodNumber;
|
|
672
|
-
}, z.core.$strip>;
|
|
673
|
-
end: z.ZodObject<{
|
|
674
|
-
x: z.ZodNumber;
|
|
675
|
-
y: z.ZodNumber;
|
|
676
|
-
}, z.core.$strip>;
|
|
677
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
678
|
-
head: z.ZodOptional<z.ZodEnum<{
|
|
679
|
-
square: "square";
|
|
680
|
-
circle: "circle";
|
|
681
|
-
none: "none";
|
|
682
|
-
openArrow: "openArrow";
|
|
683
|
-
closedArrow: "closedArrow";
|
|
684
|
-
diamond: "diamond";
|
|
685
|
-
butt: "butt";
|
|
686
|
-
slash: "slash";
|
|
687
|
-
}>>;
|
|
688
|
-
tail: z.ZodOptional<z.ZodEnum<{
|
|
689
|
-
square: "square";
|
|
690
|
-
circle: "circle";
|
|
691
|
-
none: "none";
|
|
692
|
-
openArrow: "openArrow";
|
|
693
|
-
closedArrow: "closedArrow";
|
|
694
|
-
diamond: "diamond";
|
|
695
|
-
butt: "butt";
|
|
696
|
-
slash: "slash";
|
|
697
|
-
}>>;
|
|
698
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
699
|
-
id: z.ZodString;
|
|
700
|
-
page: z.ZodNumber;
|
|
701
|
-
rect: z.ZodObject<{
|
|
702
|
-
x: z.ZodNumber;
|
|
703
|
-
y: z.ZodNumber;
|
|
704
|
-
width: z.ZodNumber;
|
|
705
|
-
height: z.ZodNumber;
|
|
706
|
-
}, z.core.$strip>;
|
|
707
|
-
color: z.ZodString;
|
|
708
|
-
opacity: z.ZodNumber;
|
|
709
|
-
author: z.ZodOptional<z.ZodString>;
|
|
710
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
711
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
712
|
-
createdAt: z.ZodISODateTime;
|
|
713
|
-
modifiedAt: z.ZodISODateTime;
|
|
714
|
-
source: z.ZodEnum<{
|
|
715
|
-
session: "session";
|
|
716
|
-
pdf: "pdf";
|
|
717
|
-
}>;
|
|
718
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
719
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
720
|
-
type: z.ZodEnum<{
|
|
721
|
-
polyline: "polyline";
|
|
722
|
-
polygon: "polygon";
|
|
723
|
-
}>;
|
|
724
|
-
vertices: z.ZodArray<z.ZodObject<{
|
|
725
|
-
x: z.ZodNumber;
|
|
726
|
-
y: z.ZodNumber;
|
|
727
|
-
}, z.core.$strip>>;
|
|
728
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
729
|
-
interiorColor: z.ZodOptional<z.ZodString>;
|
|
730
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
731
|
-
id: z.ZodString;
|
|
732
|
-
page: z.ZodNumber;
|
|
733
|
-
rect: z.ZodObject<{
|
|
734
|
-
x: z.ZodNumber;
|
|
735
|
-
y: z.ZodNumber;
|
|
736
|
-
width: z.ZodNumber;
|
|
737
|
-
height: z.ZodNumber;
|
|
738
|
-
}, z.core.$strip>;
|
|
739
|
-
color: z.ZodString;
|
|
740
|
-
opacity: z.ZodNumber;
|
|
741
|
-
author: z.ZodOptional<z.ZodString>;
|
|
742
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
743
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
744
|
-
createdAt: z.ZodISODateTime;
|
|
745
|
-
modifiedAt: z.ZodISODateTime;
|
|
746
|
-
source: z.ZodEnum<{
|
|
747
|
-
session: "session";
|
|
748
|
-
pdf: "pdf";
|
|
749
|
-
}>;
|
|
750
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
751
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
752
|
-
type: z.ZodLiteral<"ink">;
|
|
753
|
-
inklist: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
754
|
-
x: z.ZodNumber;
|
|
755
|
-
y: z.ZodNumber;
|
|
756
|
-
}, z.core.$strip>>>;
|
|
757
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
758
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
759
|
-
id: z.ZodString;
|
|
760
|
-
page: z.ZodNumber;
|
|
761
|
-
rect: z.ZodObject<{
|
|
762
|
-
x: z.ZodNumber;
|
|
763
|
-
y: z.ZodNumber;
|
|
764
|
-
width: z.ZodNumber;
|
|
765
|
-
height: z.ZodNumber;
|
|
766
|
-
}, z.core.$strip>;
|
|
767
|
-
color: z.ZodString;
|
|
768
|
-
opacity: z.ZodNumber;
|
|
769
|
-
author: z.ZodOptional<z.ZodString>;
|
|
770
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
771
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
772
|
-
createdAt: z.ZodISODateTime;
|
|
773
|
-
modifiedAt: z.ZodISODateTime;
|
|
774
|
-
source: z.ZodEnum<{
|
|
775
|
-
session: "session";
|
|
776
|
-
pdf: "pdf";
|
|
777
|
-
}>;
|
|
778
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
779
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
780
|
-
type: z.ZodLiteral<"redact">;
|
|
781
|
-
quads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
782
|
-
p1: z.ZodObject<{
|
|
783
|
-
x: z.ZodNumber;
|
|
784
|
-
y: z.ZodNumber;
|
|
785
|
-
}, z.core.$strip>;
|
|
786
|
-
p2: z.ZodObject<{
|
|
787
|
-
x: z.ZodNumber;
|
|
788
|
-
y: z.ZodNumber;
|
|
789
|
-
}, z.core.$strip>;
|
|
790
|
-
p3: z.ZodObject<{
|
|
791
|
-
x: z.ZodNumber;
|
|
792
|
-
y: z.ZodNumber;
|
|
793
|
-
}, z.core.$strip>;
|
|
794
|
-
p4: z.ZodObject<{
|
|
795
|
-
x: z.ZodNumber;
|
|
796
|
-
y: z.ZodNumber;
|
|
797
|
-
}, z.core.$strip>;
|
|
798
|
-
}, z.core.$strip>>>;
|
|
799
|
-
origin: z.ZodDefault<z.ZodEnum<{
|
|
800
|
-
user: "user";
|
|
801
|
-
suggested: "suggested";
|
|
802
|
-
}>>;
|
|
803
|
-
suggestion: z.ZodOptional<z.ZodObject<{
|
|
804
|
-
jobId: z.ZodOptional<z.ZodString>;
|
|
805
|
-
confidence: z.ZodNumber;
|
|
806
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
807
|
-
explanation: z.ZodOptional<z.ZodString>;
|
|
808
|
-
recommendation: z.ZodOptional<z.ZodEnum<{
|
|
809
|
-
redact: "redact";
|
|
810
|
-
review: "review";
|
|
811
|
-
keep: "keep";
|
|
812
|
-
}>>;
|
|
813
|
-
}, z.core.$strip>>;
|
|
814
|
-
overlayText: z.ZodOptional<z.ZodString>;
|
|
815
|
-
interiorColor: z.ZodString;
|
|
816
|
-
}, z.core.$strip>], "type">;
|
|
817
|
-
/** One exported annotation: the stored annotation without its viewer state. */
|
|
818
|
-
declare const ExportedAnnotationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
819
|
-
type: z.ZodEnum<{
|
|
820
|
-
highlight: "highlight";
|
|
821
|
-
underline: "underline";
|
|
822
|
-
strikeout: "strikeout";
|
|
823
|
-
squiggly: "squiggly";
|
|
824
|
-
}>;
|
|
825
|
-
rect: z.ZodObject<{
|
|
826
|
-
x: z.ZodNumber;
|
|
827
|
-
y: z.ZodNumber;
|
|
828
|
-
width: z.ZodNumber;
|
|
829
|
-
height: z.ZodNumber;
|
|
830
|
-
}, z.core.$strip>;
|
|
831
|
-
color: z.ZodString;
|
|
832
|
-
id: z.ZodString;
|
|
833
|
-
page: z.ZodNumber;
|
|
834
|
-
opacity: z.ZodNumber;
|
|
835
|
-
author: z.ZodOptional<z.ZodString>;
|
|
836
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
837
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
838
|
-
createdAt: z.ZodISODateTime;
|
|
839
|
-
modifiedAt: z.ZodISODateTime;
|
|
840
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
841
|
-
quads: z.ZodArray<z.ZodObject<{
|
|
842
|
-
p1: z.ZodObject<{
|
|
843
|
-
x: z.ZodNumber;
|
|
844
|
-
y: z.ZodNumber;
|
|
845
|
-
}, z.core.$strip>;
|
|
846
|
-
p2: z.ZodObject<{
|
|
847
|
-
x: z.ZodNumber;
|
|
848
|
-
y: z.ZodNumber;
|
|
849
|
-
}, z.core.$strip>;
|
|
850
|
-
p3: z.ZodObject<{
|
|
851
|
-
x: z.ZodNumber;
|
|
852
|
-
y: z.ZodNumber;
|
|
853
|
-
}, z.core.$strip>;
|
|
854
|
-
p4: z.ZodObject<{
|
|
855
|
-
x: z.ZodNumber;
|
|
856
|
-
y: z.ZodNumber;
|
|
857
|
-
}, z.core.$strip>;
|
|
858
|
-
}, z.core.$strip>>;
|
|
859
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
860
|
-
type: z.ZodLiteral<"text">;
|
|
861
|
-
rect: z.ZodObject<{
|
|
862
|
-
x: z.ZodNumber;
|
|
863
|
-
y: z.ZodNumber;
|
|
864
|
-
width: z.ZodNumber;
|
|
865
|
-
height: z.ZodNumber;
|
|
866
|
-
}, z.core.$strip>;
|
|
867
|
-
color: z.ZodString;
|
|
868
|
-
id: z.ZodString;
|
|
869
|
-
page: z.ZodNumber;
|
|
870
|
-
opacity: z.ZodNumber;
|
|
871
|
-
author: z.ZodOptional<z.ZodString>;
|
|
872
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
873
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
874
|
-
createdAt: z.ZodISODateTime;
|
|
875
|
-
modifiedAt: z.ZodISODateTime;
|
|
876
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
877
|
-
icon: z.ZodDefault<z.ZodEnum<{
|
|
878
|
-
comment: "comment";
|
|
879
|
-
note: "note";
|
|
880
|
-
help: "help";
|
|
881
|
-
insert: "insert";
|
|
882
|
-
key: "key";
|
|
883
|
-
paragraph: "paragraph";
|
|
884
|
-
}>>;
|
|
885
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
886
|
-
type: z.ZodLiteral<"freetext">;
|
|
887
|
-
rect: z.ZodObject<{
|
|
888
|
-
x: z.ZodNumber;
|
|
889
|
-
y: z.ZodNumber;
|
|
890
|
-
width: z.ZodNumber;
|
|
891
|
-
height: z.ZodNumber;
|
|
892
|
-
}, z.core.$strip>;
|
|
893
|
-
color: z.ZodString;
|
|
894
|
-
id: z.ZodString;
|
|
895
|
-
page: z.ZodNumber;
|
|
896
|
-
opacity: z.ZodNumber;
|
|
897
|
-
author: z.ZodOptional<z.ZodString>;
|
|
898
|
-
contents: z.ZodString;
|
|
899
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
900
|
-
createdAt: z.ZodISODateTime;
|
|
901
|
-
modifiedAt: z.ZodISODateTime;
|
|
902
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
903
|
-
fontSize: z.ZodDefault<z.ZodNumber>;
|
|
904
|
-
fontFamily: z.ZodDefault<z.ZodString>;
|
|
905
|
-
align: z.ZodDefault<z.ZodEnum<{
|
|
906
|
-
left: "left";
|
|
907
|
-
center: "center";
|
|
908
|
-
right: "right";
|
|
909
|
-
}>>;
|
|
910
|
-
callout: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
911
|
-
x: z.ZodNumber;
|
|
912
|
-
y: z.ZodNumber;
|
|
913
|
-
}, z.core.$strip>>>;
|
|
914
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
915
|
-
type: z.ZodEnum<{
|
|
916
|
-
square: "square";
|
|
917
|
-
circle: "circle";
|
|
918
|
-
}>;
|
|
919
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
920
|
-
rect: z.ZodObject<{
|
|
921
|
-
x: z.ZodNumber;
|
|
922
|
-
y: z.ZodNumber;
|
|
923
|
-
width: z.ZodNumber;
|
|
924
|
-
height: z.ZodNumber;
|
|
925
|
-
}, z.core.$strip>;
|
|
926
|
-
color: z.ZodString;
|
|
927
|
-
id: z.ZodString;
|
|
928
|
-
page: z.ZodNumber;
|
|
929
|
-
opacity: z.ZodNumber;
|
|
930
|
-
author: z.ZodOptional<z.ZodString>;
|
|
931
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
932
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
933
|
-
createdAt: z.ZodISODateTime;
|
|
934
|
-
modifiedAt: z.ZodISODateTime;
|
|
935
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
936
|
-
interiorColor: z.ZodOptional<z.ZodString>;
|
|
937
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
938
|
-
type: z.ZodLiteral<"line">;
|
|
939
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
940
|
-
rect: z.ZodObject<{
|
|
941
|
-
x: z.ZodNumber;
|
|
942
|
-
y: z.ZodNumber;
|
|
943
|
-
width: z.ZodNumber;
|
|
944
|
-
height: z.ZodNumber;
|
|
945
|
-
}, z.core.$strip>;
|
|
946
|
-
color: z.ZodString;
|
|
947
|
-
id: z.ZodString;
|
|
948
|
-
page: z.ZodNumber;
|
|
949
|
-
opacity: z.ZodNumber;
|
|
950
|
-
author: z.ZodOptional<z.ZodString>;
|
|
951
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
952
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
953
|
-
createdAt: z.ZodISODateTime;
|
|
954
|
-
modifiedAt: z.ZodISODateTime;
|
|
955
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
956
|
-
start: z.ZodObject<{
|
|
957
|
-
x: z.ZodNumber;
|
|
958
|
-
y: z.ZodNumber;
|
|
959
|
-
}, z.core.$strip>;
|
|
960
|
-
end: z.ZodObject<{
|
|
961
|
-
x: z.ZodNumber;
|
|
962
|
-
y: z.ZodNumber;
|
|
963
|
-
}, z.core.$strip>;
|
|
964
|
-
head: z.ZodOptional<z.ZodEnum<{
|
|
965
|
-
square: "square";
|
|
966
|
-
circle: "circle";
|
|
967
|
-
none: "none";
|
|
968
|
-
openArrow: "openArrow";
|
|
969
|
-
closedArrow: "closedArrow";
|
|
970
|
-
diamond: "diamond";
|
|
971
|
-
butt: "butt";
|
|
972
|
-
slash: "slash";
|
|
973
|
-
}>>;
|
|
974
|
-
tail: z.ZodOptional<z.ZodEnum<{
|
|
975
|
-
square: "square";
|
|
976
|
-
circle: "circle";
|
|
977
|
-
none: "none";
|
|
978
|
-
openArrow: "openArrow";
|
|
979
|
-
closedArrow: "closedArrow";
|
|
980
|
-
diamond: "diamond";
|
|
981
|
-
butt: "butt";
|
|
982
|
-
slash: "slash";
|
|
983
|
-
}>>;
|
|
984
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
985
|
-
type: z.ZodEnum<{
|
|
986
|
-
polyline: "polyline";
|
|
987
|
-
polygon: "polygon";
|
|
988
|
-
}>;
|
|
989
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
990
|
-
rect: z.ZodObject<{
|
|
991
|
-
x: z.ZodNumber;
|
|
992
|
-
y: z.ZodNumber;
|
|
993
|
-
width: z.ZodNumber;
|
|
994
|
-
height: z.ZodNumber;
|
|
995
|
-
}, z.core.$strip>;
|
|
996
|
-
color: z.ZodString;
|
|
997
|
-
id: z.ZodString;
|
|
998
|
-
page: z.ZodNumber;
|
|
999
|
-
opacity: z.ZodNumber;
|
|
1000
|
-
author: z.ZodOptional<z.ZodString>;
|
|
1001
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
1002
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
1003
|
-
createdAt: z.ZodISODateTime;
|
|
1004
|
-
modifiedAt: z.ZodISODateTime;
|
|
1005
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1006
|
-
interiorColor: z.ZodOptional<z.ZodString>;
|
|
1007
|
-
vertices: z.ZodArray<z.ZodObject<{
|
|
1008
|
-
x: z.ZodNumber;
|
|
1009
|
-
y: z.ZodNumber;
|
|
1010
|
-
}, z.core.$strip>>;
|
|
1011
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1012
|
-
type: z.ZodLiteral<"ink">;
|
|
1013
|
-
width: z.ZodDefault<z.ZodNumber>;
|
|
1014
|
-
rect: z.ZodObject<{
|
|
1015
|
-
x: z.ZodNumber;
|
|
1016
|
-
y: z.ZodNumber;
|
|
1017
|
-
width: z.ZodNumber;
|
|
1018
|
-
height: z.ZodNumber;
|
|
1019
|
-
}, z.core.$strip>;
|
|
1020
|
-
color: z.ZodString;
|
|
1021
|
-
id: z.ZodString;
|
|
1022
|
-
page: z.ZodNumber;
|
|
1023
|
-
opacity: z.ZodNumber;
|
|
1024
|
-
author: z.ZodOptional<z.ZodString>;
|
|
1025
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
1026
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
1027
|
-
createdAt: z.ZodISODateTime;
|
|
1028
|
-
modifiedAt: z.ZodISODateTime;
|
|
1029
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1030
|
-
inklist: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
1031
|
-
x: z.ZodNumber;
|
|
1032
|
-
y: z.ZodNumber;
|
|
1033
|
-
}, z.core.$strip>>>;
|
|
1034
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1035
|
-
type: z.ZodLiteral<"redact">;
|
|
1036
|
-
rect: z.ZodObject<{
|
|
1037
|
-
x: z.ZodNumber;
|
|
1038
|
-
y: z.ZodNumber;
|
|
1039
|
-
width: z.ZodNumber;
|
|
1040
|
-
height: z.ZodNumber;
|
|
1041
|
-
}, z.core.$strip>;
|
|
1042
|
-
color: z.ZodString;
|
|
1043
|
-
id: z.ZodString;
|
|
1044
|
-
page: z.ZodNumber;
|
|
1045
|
-
opacity: z.ZodNumber;
|
|
1046
|
-
author: z.ZodOptional<z.ZodString>;
|
|
1047
|
-
contents: z.ZodOptional<z.ZodString>;
|
|
1048
|
-
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
1049
|
-
createdAt: z.ZodISODateTime;
|
|
1050
|
-
modifiedAt: z.ZodISODateTime;
|
|
1051
|
-
custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1052
|
-
quads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1053
|
-
p1: z.ZodObject<{
|
|
1054
|
-
x: z.ZodNumber;
|
|
1055
|
-
y: z.ZodNumber;
|
|
1056
|
-
}, z.core.$strip>;
|
|
1057
|
-
p2: z.ZodObject<{
|
|
1058
|
-
x: z.ZodNumber;
|
|
1059
|
-
y: z.ZodNumber;
|
|
1060
|
-
}, z.core.$strip>;
|
|
1061
|
-
p3: z.ZodObject<{
|
|
1062
|
-
x: z.ZodNumber;
|
|
1063
|
-
y: z.ZodNumber;
|
|
1064
|
-
}, z.core.$strip>;
|
|
1065
|
-
p4: z.ZodObject<{
|
|
1066
|
-
x: z.ZodNumber;
|
|
1067
|
-
y: z.ZodNumber;
|
|
1068
|
-
}, z.core.$strip>;
|
|
1069
|
-
}, z.core.$strip>>>;
|
|
1070
|
-
interiorColor: z.ZodString;
|
|
1071
|
-
origin: z.ZodDefault<z.ZodEnum<{
|
|
1072
|
-
user: "user";
|
|
1073
|
-
suggested: "suggested";
|
|
1074
|
-
}>>;
|
|
1075
|
-
suggestion: z.ZodOptional<z.ZodObject<{
|
|
1076
|
-
jobId: z.ZodOptional<z.ZodString>;
|
|
1077
|
-
confidence: z.ZodNumber;
|
|
1078
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
1079
|
-
explanation: z.ZodOptional<z.ZodString>;
|
|
1080
|
-
recommendation: z.ZodOptional<z.ZodEnum<{
|
|
1081
|
-
redact: "redact";
|
|
1082
|
-
review: "review";
|
|
1083
|
-
keep: "keep";
|
|
1084
|
-
}>>;
|
|
1085
|
-
}, z.core.$strip>>;
|
|
1086
|
-
overlayText: z.ZodOptional<z.ZodString>;
|
|
1087
|
-
}, z.core.$strip>], "type">;
|
|
1088
|
-
type Annotation = z.infer<typeof AnnotationSchema>;
|
|
1089
|
-
type ExportedAnnotation = z.infer<typeof ExportedAnnotationSchema>;
|
|
1090
|
-
type AnnotationType = Annotation['type'];
|
|
1091
|
-
type AnnotationOfType<T extends AnnotationType> = Extract<Annotation, {
|
|
1092
|
-
type: T;
|
|
1093
|
-
}>;
|
|
1094
|
-
type TextMarkupAnnotation = z.infer<typeof TextMarkupSchema>;
|
|
1095
|
-
type NoteAnnotation = z.infer<typeof NoteSchema>;
|
|
1096
|
-
type FreeTextAnnotation = z.infer<typeof FreeTextSchema>;
|
|
1097
|
-
type ShapeAnnotation = z.infer<typeof ShapeSchema>;
|
|
1098
|
-
type LineAnnotation = z.infer<typeof LineSchema>;
|
|
1099
|
-
type PolyAnnotation = z.infer<typeof PolySchema>;
|
|
1100
|
-
type InkAnnotation = z.infer<typeof InkSchema>;
|
|
1101
|
-
type RedactAnnotation = z.infer<typeof RedactSchema>;
|
|
1102
|
-
type Suggestion = z.infer<typeof SuggestionSchema>;
|
|
1103
|
-
/** Keys the store fills in; callers never supply them (except an optional `id`). */
|
|
1104
|
-
type Generated = 'id' | 'createdAt' | 'modifiedAt' | 'source' | 'locked';
|
|
1105
|
-
/** Keys the store derives or defaults when absent. */
|
|
1106
|
-
type Defaulted = 'rect' | 'color' | 'opacity';
|
|
1107
|
-
/** Builds the caller-facing shape of one member from its zod input type. */
|
|
1108
|
-
type InputOf<I> = I extends unknown ? Omit<I, Generated | Defaulted> & Partial<Pick<I, Extract<Defaulted, keyof I>>> & {
|
|
1109
|
-
id?: string;
|
|
1110
|
-
} : never;
|
|
1111
|
-
type RedactInput = z.input<typeof RedactSchema>;
|
|
1112
|
-
type RedactBase = Omit<InputOf<RedactInput>, 'interiorColor' | 'rect' | 'quads'> & {
|
|
1113
|
-
interiorColor?: string;
|
|
1114
|
-
};
|
|
1115
|
-
type RedactCallerInput = (RedactBase & {
|
|
1116
|
-
rect: RedactInput['rect'];
|
|
1117
|
-
quads?: RedactInput['quads'];
|
|
1118
|
-
}) | (RedactBase & {
|
|
1119
|
-
rect?: RedactInput['rect'];
|
|
1120
|
-
quads: NonNullable<RedactInput['quads']>;
|
|
1121
|
-
});
|
|
1122
|
-
/**
|
|
1123
|
-
* What callers pass to `add`. Built from zod input types, so fields with defaults or
|
|
1124
|
-
* optional fields may be omitted. A redaction needs `rect` or `quads` (the store
|
|
1125
|
-
* derives the other), and `interiorColor` defaults to the store's redaction colour.
|
|
1126
|
-
*/
|
|
1127
|
-
type AnnotationInput = InputOf<z.input<typeof TextMarkupSchema> | z.input<typeof NoteSchema> | z.input<typeof FreeTextSchema> | z.input<typeof ShapeSchema> | z.input<typeof LineSchema> | z.input<typeof PolySchema> | z.input<typeof InkSchema>> | RedactCallerInput;
|
|
1128
|
-
declare const AnnotationDocumentSchema: z.ZodObject<{
|
|
1129
|
-
format: z.ZodLiteral<"inkbar/annotations">;
|
|
1130
|
-
version: z.ZodLiteral<1>;
|
|
1131
|
-
documentKey: z.ZodOptional<z.ZodString>;
|
|
1132
|
-
annotations: z.ZodArray<z.ZodUnknown>;
|
|
1133
|
-
}, z.core.$strip>;
|
|
1134
|
-
/**
|
|
1135
|
-
* An item whose `type` this version does not know, written by a newer Inkbar. It is kept as-is
|
|
1136
|
-
* so it survives an import and export round trip, and it is valid only under the schema
|
|
1137
|
-
* version that produced it.
|
|
1138
|
-
*/
|
|
1139
|
-
type ForeignAnnotation = {
|
|
1140
|
-
type: string;
|
|
1141
|
-
id: string;
|
|
1142
|
-
page: number;
|
|
1143
|
-
} & Record<string, unknown>;
|
|
1144
|
-
interface AnnotationDocument {
|
|
1145
|
-
format: typeof ANNOTATION_FORMAT;
|
|
1146
|
-
version: typeof ANNOTATION_VERSION;
|
|
1147
|
-
documentKey?: string;
|
|
1148
|
-
annotations: Array<ExportedAnnotation | ForeignAnnotation>;
|
|
1149
|
-
}
|
|
1150
|
-
type ConfidenceBucket = 'low' | 'medium' | 'high';
|
|
1151
|
-
declare function confidenceBucket(confidence: number): ConfidenceBucket;
|
|
1152
|
-
//#endregion
|
|
1153
|
-
//#region src/model/annotations/defaults.d.ts
|
|
1154
|
-
interface AnnotationDefaults {
|
|
1155
|
-
color(type: AnnotationType): string;
|
|
1156
|
-
/** Fill colour for redactions. */
|
|
1157
|
-
fill(): string;
|
|
1158
|
-
opacity(type: AnnotationType): number;
|
|
1159
|
-
/** Outline colour for a suggested redaction, by confidence bucket. */
|
|
1160
|
-
suggestion(bucket: ConfidenceBucket): string;
|
|
1161
|
-
}
|
|
1162
|
-
declare const staticDefaults: AnnotationDefaults;
|
|
1163
|
-
/** Resolves default colours from CSS custom properties on `el`, falling back to `staticDefaults`. */
|
|
1164
|
-
declare function cssVariableDefaults(el: Element): AnnotationDefaults;
|
|
1165
|
-
/** Accepts `#rgb`, `#rrggbb`, `rgb(r, g, b)` and `rgb(r g b)`; returns `#RRGGBB` or undefined. */
|
|
1166
|
-
declare function normalizeColor(value: string): string | undefined;
|
|
1167
|
-
//#endregion
|
|
1168
|
-
//#region src/model/annotations/embedded.d.ts
|
|
1169
|
-
declare const SUPPORTED_SUBTYPES: ReadonlySet<string>;
|
|
1170
|
-
interface EmbeddedSummary {
|
|
1171
|
-
subtype: string;
|
|
1172
|
-
count: number;
|
|
1173
|
-
supported: boolean;
|
|
1174
|
-
}
|
|
1175
|
-
declare function pdfColorToHex(c: ArrayLike<number> | null | undefined, fallback: string): string;
|
|
1176
|
-
/**
|
|
1177
|
-
* Imported ids are `pdf:<page>:<pdfjsId>` (page is 0-based, pdfjsId is the annotation's object
|
|
1178
|
-
* reference such as `12R`). They are stable across opens of the same file, and `inReplyTo`
|
|
1179
|
-
* uses the same scheme so threads resolve.
|
|
1180
|
-
*/
|
|
1181
|
-
declare function importedId(page: number, pdfjsId: string): string;
|
|
1182
|
-
declare function importEmbeddedPage(page: number, raw: PdfjsAnnotationData[], importedAt: string): {
|
|
1183
|
-
annotations: Annotation[];
|
|
1184
|
-
counts: Record<string, number>;
|
|
1185
|
-
};
|
|
1186
|
-
declare function summarise(perPage: Record<string, number>[]): EmbeddedSummary[];
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region src/model/annotations/store.d.ts
|
|
1189
|
-
type AnnotationChange = {
|
|
1190
|
-
kind: 'add';
|
|
1191
|
-
annotation: Annotation;
|
|
1192
|
-
} | {
|
|
1193
|
-
kind: 'update';
|
|
1194
|
-
id: string;
|
|
1195
|
-
before: Annotation;
|
|
1196
|
-
after: Annotation;
|
|
1197
|
-
} | {
|
|
1198
|
-
kind: 'remove';
|
|
1199
|
-
/** The annotation `remove` was called with. */
|
|
1200
|
-
annotation: Annotation;
|
|
1201
|
-
/** Everything that went: `annotation` first, then the replies removed with it. */
|
|
1202
|
-
removed: Annotation[];
|
|
1203
|
-
} | {
|
|
1204
|
-
kind: 'replace';
|
|
1205
|
-
reason: 'import' | 'sync' | 'history';
|
|
1206
|
-
};
|
|
1207
|
-
type StoreMode = {
|
|
1208
|
-
mode: 'uncontrolled';
|
|
1209
|
-
initial?: Annotation[];
|
|
1210
|
-
} | {
|
|
1211
|
-
mode: 'controlled';
|
|
1212
|
-
initial: Annotation[];
|
|
1213
|
-
onChange: (next: Annotation[], change: AnnotationChange) => void;
|
|
1214
|
-
};
|
|
1215
|
-
interface AnnotationStore {
|
|
1216
|
-
readonly mode: 'uncontrolled' | 'controlled';
|
|
1217
|
-
readonly list: Readable<readonly Annotation[]>;
|
|
1218
|
-
readonly selection: Readable<readonly string[]>;
|
|
1219
|
-
/** The colour, fill and opacity defaults new annotations get. */
|
|
1220
|
-
readonly defaults: AnnotationDefaults;
|
|
1221
|
-
get(id: string): Annotation | undefined;
|
|
1222
|
-
byPage(page: number): Annotation[];
|
|
1223
|
-
/**
|
|
1224
|
-
* Returns the completed annotation. In controlled mode it is proposed to the host, not
|
|
1225
|
-
* applied. Throws an `Error` naming the id when it is already in the list, whether it came
|
|
1226
|
-
* from `input.id` or the store's `id` generator.
|
|
1227
|
-
*/
|
|
1228
|
-
add(input: AnnotationInput): Annotation;
|
|
1229
|
-
/**
|
|
1230
|
-
* `id`, `type`, `createdAt` and `source` cannot be patched, nor can `locked` on an embedded
|
|
1231
|
-
* (`source: 'pdf'`) annotation: those keys are ignored. `modifiedAt` is always bumped. A
|
|
1232
|
-
* locked annotation refuses any patch to its geometry, `page` or `contents`.
|
|
1233
|
-
*/
|
|
1234
|
-
update(id: string, patch: Partial<Annotation>): Annotation | undefined;
|
|
1235
|
-
remove(id: string): boolean;
|
|
1236
|
-
select(ids: string[]): void;
|
|
1237
|
-
/**
|
|
1238
|
-
* Uncontrolled: embedded annotations survive (the list may edit them like `update` would, but
|
|
1239
|
-
* cannot drop or add them). Controlled: proposes the list minus embedded items to `onChange`.
|
|
1240
|
-
*/
|
|
1241
|
-
replaceAll(list: Annotation[], reason: 'import' | 'sync' | 'history'): void;
|
|
1242
|
-
/**
|
|
1243
|
-
* Controlled mode only: the host pushes its current list. Embedded (`source: 'pdf'`) items
|
|
1244
|
-
* belong to the store, so they stay in `list` whatever the host sends; host items that reuse
|
|
1245
|
-
* an embedded id are dropped.
|
|
1246
|
-
*/
|
|
1247
|
-
setControlledValue(list: Annotation[]): void;
|
|
1248
|
-
/**
|
|
1249
|
-
* @internal Replaces the annotations embedded in the file (`source: 'pdf'`). Applied
|
|
1250
|
-
* directly in both modes and never passed to `onChange`; the document calls it once on open.
|
|
1251
|
-
*/
|
|
1252
|
-
_setEmbedded(list: readonly Annotation[]): void;
|
|
1253
|
-
/**
|
|
1254
|
-
* @internal Like `get`, but in controlled mode it also sees changes proposed to the host and
|
|
1255
|
-
* not applied yet: the list `update` and `remove` build on.
|
|
1256
|
-
*/
|
|
1257
|
-
_getProposed(id: string): Annotation | undefined;
|
|
1258
|
-
completeInput(input: AnnotationInput): Annotation;
|
|
1259
|
-
on(event: 'change', fn: (change: AnnotationChange) => void): () => void;
|
|
1260
|
-
destroy(): void;
|
|
1261
|
-
}
|
|
1262
|
-
interface StoreOptions {
|
|
1263
|
-
mode: StoreMode;
|
|
1264
|
-
defaults: AnnotationDefaults;
|
|
1265
|
-
now?: () => string;
|
|
1266
|
-
id?: () => string;
|
|
1267
|
-
}
|
|
1268
|
-
declare function deriveRect(input: AnnotationInput): Rect;
|
|
1269
|
-
declare function createAnnotationStore(opts: StoreOptions): AnnotationStore;
|
|
1270
|
-
//#endregion
|
|
1271
|
-
//#region src/model/annotations/history.d.ts
|
|
1272
|
-
interface History {
|
|
1273
|
-
readonly canUndo: Readable<boolean>;
|
|
1274
|
-
readonly canRedo: Readable<boolean>;
|
|
1275
|
-
undo(): void;
|
|
1276
|
-
redo(): void;
|
|
1277
|
-
clear(): void;
|
|
1278
|
-
/**
|
|
1279
|
-
* Runs `fn` and records everything it changes as one undo entry. Change events still fire once
|
|
1280
|
-
* per annotation. Nested calls join the outer batch. `fn` must be synchronous; changes after an
|
|
1281
|
-
* `await` are not part of the batch; a dev build warns when `fn` returns a promise. A throwing
|
|
1282
|
-
* `fn` still records what it changed, then rethrows. A batch whose list ends where it began
|
|
1283
|
-
* (the same annotations, by identity, in the same order) records nothing and keeps redo.
|
|
1284
|
-
* Calling `undo()` or `redo()` inside `fn` is not supported. On a controlled or destroyed
|
|
1285
|
-
* history this only runs `fn`, and a history destroyed inside `fn` records nothing.
|
|
1286
|
-
*/
|
|
1287
|
-
batch(fn: () => void): void;
|
|
1288
|
-
/** Unsubscribes from the store and empties both stacks; undo and redo become no-ops. */
|
|
1289
|
-
destroy(): void;
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* Snapshot-based undo and redo over an uncontrolled store.
|
|
1293
|
-
*
|
|
1294
|
-
* In controlled mode the host owns the list, so history is the host's concern (the Vue layer
|
|
1295
|
-
* offers `useHistory`). There `createHistory` returns an inert History: `canUndo` and `canRedo`
|
|
1296
|
-
* stay false, `undo` and `redo` do nothing, and nothing is recorded.
|
|
1297
|
-
*/
|
|
1298
|
-
declare function createHistory(store: AnnotationStore, opts?: {
|
|
1299
|
-
limit?: number;
|
|
1300
|
-
}): History;
|
|
1301
|
-
//#endregion
|
|
1302
|
-
//#region src/model/annotations/json.d.ts
|
|
1303
|
-
interface ImportResult {
|
|
1304
|
-
imported: number;
|
|
1305
|
-
/**
|
|
1306
|
-
* Items whose `type` this version does not know (they still need a string `id` and a numeric
|
|
1307
|
-
* `page`). Keep them and pass them back to exportAnnotations.
|
|
1308
|
-
*/
|
|
1309
|
-
unknown: ForeignAnnotation[];
|
|
1310
|
-
errors: {
|
|
1311
|
-
index: number;
|
|
1312
|
-
issues: string[];
|
|
1313
|
-
}[];
|
|
1314
|
-
}
|
|
1315
|
-
interface ImportOptions {
|
|
1316
|
-
/** `replace` drops every session annotation first; `merge` overwrites by id and keeps the rest. */
|
|
1317
|
-
mode: 'replace' | 'merge';
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Session annotations plus any preserved foreign items. Embedded (`source: 'pdf'`) ones stay in
|
|
1321
|
-
* the file. `source` and `locked` are viewer state and are left out.
|
|
1322
|
-
*
|
|
1323
|
-
* The result is a JSON copy (`JSON.parse(JSON.stringify(...))`), the same data a serialised
|
|
1324
|
-
* export would carry: editing it never touches the store, and values JSON cannot hold, such as
|
|
1325
|
-
* functions or `undefined` inside `custom`, are left out exactly as `JSON.stringify` would.
|
|
1326
|
-
*
|
|
1327
|
-
* Without foreign items the result validates against this version's `schema.json`. With them it
|
|
1328
|
-
* validates only against the newer schema that produced them, since this version's schema
|
|
1329
|
-
* describes only the types it knows.
|
|
1330
|
-
*/
|
|
1331
|
-
declare function exportAnnotations(store: AnnotationStore, preserved?: readonly ForeignAnnotation[], documentKey?: string): AnnotationDocument;
|
|
1332
|
-
/**
|
|
1333
|
-
* Validates the envelope (throws a TypeError when it is not an inkbar/annotations v1 document),
|
|
1334
|
-
* then each item on its own. Embedded annotations are never touched; imported items become
|
|
1335
|
-
* session annotations.
|
|
1336
|
-
*/
|
|
1337
|
-
declare function importAnnotations(store: AnnotationStore, data: AnnotationDocument | string, opts: ImportOptions): ImportResult;
|
|
1338
|
-
//#endregion
|
|
1339
|
-
//#region src/model/errors.d.ts
|
|
1340
|
-
type InkErrorCode = 'PasswordRequired' | 'InvalidPdf' | 'SourceFetchFailed' | 'AssetConfigMissing' | 'AssetLoadFailed' | 'EngineUnavailable' | 'ControlledMutationIgnored' | 'DocumentDestroyed' | 'PageOutOfRange';
|
|
1341
|
-
declare class InkError extends Error {
|
|
1342
|
-
readonly name = "InkError";
|
|
1343
|
-
readonly code: InkErrorCode;
|
|
1344
|
-
readonly details: Readonly<Record<string, unknown>>;
|
|
1345
|
-
constructor(code: InkErrorCode, message: string, details?: Record<string, unknown>, cause?: unknown);
|
|
1346
|
-
}
|
|
1347
|
-
declare function isInkError(value: unknown): value is InkError;
|
|
1348
|
-
//#endregion
|
|
1349
|
-
//#region src/model/source.d.ts
|
|
1350
|
-
type DocumentSource = ArrayBuffer | Uint8Array | Blob | string | {
|
|
1351
|
-
url: string;
|
|
1352
|
-
key: string;
|
|
1353
|
-
} | {
|
|
1354
|
-
data: ArrayBuffer | Uint8Array;
|
|
1355
|
-
key: string;
|
|
1356
|
-
};
|
|
1357
|
-
//#endregion
|
|
1358
|
-
//#region src/model/text.d.ts
|
|
1359
|
-
interface TextItem {
|
|
1360
|
-
str: string;
|
|
1361
|
-
dir: 'ltr' | 'rtl' | 'ttb';
|
|
1362
|
-
fontName: string;
|
|
1363
|
-
fontSize: number;
|
|
1364
|
-
hasEOL: boolean;
|
|
1365
|
-
/** Glyph-run box in user space, following the run's rotation. */
|
|
1366
|
-
quad: Quad;
|
|
1367
|
-
/** Axis-aligned bounds of `quad`. */
|
|
1368
|
-
rect: Rect;
|
|
1369
|
-
}
|
|
1370
|
-
interface TextContent {
|
|
1371
|
-
page: number;
|
|
1372
|
-
items: TextItem[];
|
|
1373
|
-
}
|
|
1374
|
-
//#endregion
|
|
1375
|
-
//#region src/model/document.d.ts
|
|
1376
|
-
type DocumentStatus = {
|
|
1377
|
-
state: 'loading';
|
|
1378
|
-
} | {
|
|
1379
|
-
state: 'ready';
|
|
1380
|
-
} | {
|
|
1381
|
-
state: 'error';
|
|
1382
|
-
error: InkError;
|
|
1383
|
-
};
|
|
1384
|
-
/** A document's status plus `idle`, for a host with no document open. */
|
|
1385
|
-
type InkStatus = DocumentStatus | {
|
|
1386
|
-
state: 'idle';
|
|
1387
|
-
};
|
|
1388
|
-
interface DocumentInfo {
|
|
1389
|
-
title?: string | undefined;
|
|
1390
|
-
author?: string | undefined;
|
|
1391
|
-
pageCount: number;
|
|
1392
|
-
isEncrypted: boolean;
|
|
1393
|
-
}
|
|
1394
|
-
interface OpenOptions {
|
|
1395
|
-
assets: PdfAssets;
|
|
1396
|
-
password?: string | undefined;
|
|
1397
|
-
fetch?: typeof fetch | undefined;
|
|
1398
|
-
/**
|
|
1399
|
-
* Defaults to uncontrolled. In controlled mode the host owns only session annotations:
|
|
1400
|
-
* embedded (`source: 'pdf'`) ones live in the store, are never passed to `onChange`, and stay
|
|
1401
|
-
* in `list` whatever the host pushes back.
|
|
1402
|
-
*/
|
|
1403
|
-
annotations?: StoreMode | undefined;
|
|
1404
|
-
/** Colour defaults. Pass `cssVariableDefaults(element)` from the DOM layer to read theme variables. */
|
|
1405
|
-
defaults?: AnnotationDefaults | undefined;
|
|
1406
|
-
/**
|
|
1407
|
-
* Undo history, on by default. `false` disables it. In controlled mode history is always
|
|
1408
|
-
* inert: the host owns the list, so it owns undo too.
|
|
1409
|
-
*/
|
|
1410
|
-
history?: boolean | {
|
|
1411
|
-
limit?: number | undefined;
|
|
1412
|
-
} | undefined;
|
|
1413
|
-
/** PDF.js verbosity level; 0 = errors only. Defaults to PDF.js's own level. */
|
|
1414
|
-
verbosity?: number | undefined;
|
|
1415
|
-
}
|
|
1416
|
-
interface InkDocument {
|
|
1417
|
-
readonly key: string;
|
|
1418
|
-
readonly status: Readable<DocumentStatus>;
|
|
1419
|
-
/** Resolves when status is ready; rejects with the InkError when it is error. */
|
|
1420
|
-
readonly ready: Promise<void>;
|
|
1421
|
-
readonly pages: readonly PageInfo[];
|
|
1422
|
-
readonly info: DocumentInfo;
|
|
1423
|
-
text(page: number): Promise<TextContent>;
|
|
1424
|
-
/**
|
|
1425
|
-
* Annotations embedded in the file arrive here as `source: 'pdf'`, `locked: true` before
|
|
1426
|
-
* `ready` resolves. They stay in `list` in both modes and cannot be removed; in controlled
|
|
1427
|
-
* mode they never reach `onChange`.
|
|
1428
|
-
*/
|
|
1429
|
-
readonly annotations: AnnotationStore;
|
|
1430
|
-
/** What the file contained, by PDF subtype, including subtypes Inkbar does not show. */
|
|
1431
|
-
readonly embedded: readonly EmbeddedSummary[];
|
|
1432
|
-
readonly history: History;
|
|
1433
|
-
/** Session annotations only, plus unknown-type items kept from earlier imports. */
|
|
1434
|
-
exportAnnotations(format: 'json'): AnnotationDocument;
|
|
1435
|
-
/** Defaults to `{ mode: 'replace' }`. Embedded annotations are never touched. */
|
|
1436
|
-
importAnnotations(data: AnnotationDocument | string, opts?: ImportOptions): ImportResult;
|
|
1437
|
-
/** Writes the document with its annotations. Needs @inkbar/engine; rejects with EngineUnavailable otherwise. */
|
|
1438
|
-
save(): Promise<Uint8Array>;
|
|
1439
|
-
destroy(): void;
|
|
1440
|
-
/** @internal PDF.js handles for the DOM layer. Not part of the public contract. */
|
|
1441
|
-
readonly _pdfjs: {
|
|
1442
|
-
module: PdfjsModule;
|
|
1443
|
-
proxy: PdfjsDocument;
|
|
1444
|
-
getPage(index: number): Promise<PdfjsPage>;
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
/**
|
|
1448
|
-
* Opens a document. Resolves once loading has finished, whether it succeeded or not:
|
|
1449
|
-
* check `status` or await `ready`, which rejects with the InkError. Only a missing
|
|
1450
|
-
* `assets` option (a programmer error) makes this promise itself reject.
|
|
1451
|
-
*/
|
|
1452
|
-
declare function openDocument(source: DocumentSource, options: OpenOptions): Promise<InkDocument>;
|
|
1453
|
-
//#endregion
|
|
1454
|
-
export { LineEndingSchema as $, summarise as A, approxEqual as At, AnnotationInput as B, translateQuad as Bt, createAnnotationStore as C, PageRotation as Ct, importEmbeddedPage as D, Quad as Dt, SUPPORTED_SUBTYPES as E, Point as Et, ANNOTATION_FORMAT as F, quadsFromFlat as Ft, ExportedAnnotation as G, AnnotationSchema as H, unionRects as Ht, ANNOTATION_VERSION as I, rectContainsPoint as It, FreeTextAnnotation as J, ExportedAnnotationSchema as K, Annotation as L, rectFromPoints as Lt, cssVariableDefaults as M, multiplyMatrix as Mt, normalizeColor as N, pointsFromFlat as Nt, importedId as O, Rect as Ot, staticDefaults as P, quadFromRect as Pt, LineAnnotation as Q, AnnotationDocument as R, rectFromQuad as Rt, StoreOptions as S, PageInfo as St, EmbeddedSummary as T, Matrix as Tt, AnnotationType as U, AnnotationOfType as V, translateRect as Vt, ConfidenceBucket as W, InkAnnotation as X, FreeTextSchema as Y, InkSchema as Z, History as _, Readable as _t, OpenOptions as a, PolySchema as at, AnnotationStore as b, readonly as bt, TextItem as c, RedactAnnotation as ct, InkErrorCode as d, ShapeSchema as dt, LineSchema as et, isInkError as f, Suggestion as ft, importAnnotations as g, confidenceBucket as gt, exportAnnotations as h, TextMarkupSchema as ht, InkStatus as i, PolyAnnotation as it, AnnotationDefaults as j, invertMatrix as jt, pdfColorToHex as k, applyMatrix as kt, DocumentSource as l, RedactSchema as lt, ImportResult as m, TextMarkupAnnotation as mt, DocumentStatus as n, NoteSchema as nt, openDocument as o, QuadSchema as ot, ImportOptions as p, SuggestionSchema as pt, ForeignAnnotation as q, InkDocument as r, PointSchema as rt, TextContent as s, RectSchema as st, DocumentInfo as t, NoteAnnotation as tt, InkError as u, ShapeAnnotation as ut, createHistory as v, Writable as vt, deriveRect as w, PdfAssets as wt, StoreMode as x, writable as xt, AnnotationChange as y, derived as yt, AnnotationDocumentSchema as z, rectsIntersect as zt };
|
|
1455
|
-
//# sourceMappingURL=document-BftlPZKU.d.mts.map
|