@arbidocs/react 0.4.69 → 0.4.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +8 -0
  2. package/dist/annotations/index.cjs +186 -2450
  3. package/dist/annotations/index.cjs.map +1 -1
  4. package/dist/annotations/index.d.cts +3 -33
  5. package/dist/annotations/index.d.ts +3 -33
  6. package/dist/annotations/index.js +4 -2411
  7. package/dist/annotations/index.js.map +1 -1
  8. package/dist/artifacts/index.cjs +88 -112
  9. package/dist/artifacts/index.cjs.map +1 -1
  10. package/dist/artifacts/index.js +12 -61
  11. package/dist/artifacts/index.js.map +1 -1
  12. package/dist/artifacts/redline-core.cjs +8 -7
  13. package/dist/artifacts/redline-core.js +2 -1
  14. package/dist/{chunk-PATLJSAO.cjs → chunk-3AADNIOK.cjs} +9 -52
  15. package/dist/chunk-3AADNIOK.cjs.map +1 -0
  16. package/dist/chunk-3QF5DNAP.js +2413 -0
  17. package/dist/chunk-3QF5DNAP.js.map +1 -0
  18. package/dist/chunk-5DCRIWCA.cjs +243 -0
  19. package/dist/chunk-5DCRIWCA.cjs.map +1 -0
  20. package/dist/{chunk-NA3FOYSF.cjs → chunk-5SZ2J2WT.cjs} +5 -177
  21. package/dist/chunk-5SZ2J2WT.cjs.map +1 -0
  22. package/dist/{chunk-43AKLNBC.js → chunk-74N436VK.js} +4 -40
  23. package/dist/chunk-74N436VK.js.map +1 -0
  24. package/dist/{chunk-Z3RRZ3KV.cjs → chunk-7CL7QHT6.cjs} +2 -240
  25. package/dist/chunk-7CL7QHT6.cjs.map +1 -0
  26. package/dist/{chunk-BWVIAATD.cjs → chunk-BTRIS3HY.cjs} +4 -4
  27. package/dist/{chunk-BWVIAATD.cjs.map → chunk-BTRIS3HY.cjs.map} +1 -1
  28. package/dist/chunk-G6FHNURH.js +234 -0
  29. package/dist/chunk-G6FHNURH.js.map +1 -0
  30. package/dist/chunk-HKUD2NZN.js +61 -0
  31. package/dist/chunk-HKUD2NZN.js.map +1 -0
  32. package/dist/chunk-QRCMKEE6.js +173 -0
  33. package/dist/chunk-QRCMKEE6.js.map +1 -0
  34. package/dist/{chunk-PFKLOVGQ.js → chunk-SYPUFZGA.js} +3 -233
  35. package/dist/chunk-SYPUFZGA.js.map +1 -0
  36. package/dist/chunk-T4IJHRRD.cjs +71 -0
  37. package/dist/chunk-T4IJHRRD.cjs.map +1 -0
  38. package/dist/chunk-ULU5LEWF.cjs +2460 -0
  39. package/dist/chunk-ULU5LEWF.cjs.map +1 -0
  40. package/dist/{chunk-TQ6FRVAH.js → chunk-V4CXOPLB.js} +3 -3
  41. package/dist/{chunk-TQ6FRVAH.js.map → chunk-V4CXOPLB.js.map} +1 -1
  42. package/dist/chunk-VOFNX4P6.cjs +50 -0
  43. package/dist/chunk-VOFNX4P6.cjs.map +1 -0
  44. package/dist/chunk-WUTL62MC.js +42 -0
  45. package/dist/chunk-WUTL62MC.js.map +1 -0
  46. package/dist/{chunk-JPGV7NMY.js → chunk-YXSXGTYQ.js} +4 -173
  47. package/dist/chunk-YXSXGTYQ.js.map +1 -0
  48. package/dist/chunk-Z3LLUO32.cjs +177 -0
  49. package/dist/chunk-Z3LLUO32.cjs.map +1 -0
  50. package/dist/document-tools/index.cjs +683 -0
  51. package/dist/document-tools/index.cjs.map +1 -0
  52. package/dist/document-tools/index.d.cts +392 -0
  53. package/dist/document-tools/index.d.ts +392 -0
  54. package/dist/document-tools/index.js +639 -0
  55. package/dist/document-tools/index.js.map +1 -0
  56. package/dist/index.cjs +320 -318
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.js +9 -6
  59. package/dist/index.js.map +1 -1
  60. package/dist/store-CqkkD7Ho.d.cts +35 -0
  61. package/dist/store-D1nhbkgk.d.ts +35 -0
  62. package/dist/ui/index.cjs +138 -137
  63. package/dist/ui/index.js +3 -2
  64. package/package.json +11 -3
  65. package/dist/chunk-43AKLNBC.js.map +0 -1
  66. package/dist/chunk-JPGV7NMY.js.map +0 -1
  67. package/dist/chunk-NA3FOYSF.cjs.map +0 -1
  68. package/dist/chunk-PATLJSAO.cjs.map +0 -1
  69. package/dist/chunk-PFKLOVGQ.js.map +0 -1
  70. package/dist/chunk-Z3RRZ3KV.cjs.map +0 -1
@@ -0,0 +1,392 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { ArbiClient, components } from '@arbidocs/client';
4
+ import { A as AnnotationStore } from '../store-D1nhbkgk.js';
5
+ import { A as Annotation, b as AnnotationLayer } from '../model-DIwXRuGC.js';
6
+ import * as _tanstack_react_query from '@tanstack/react-query';
7
+
8
+ type DocumentToolsClient = ArbiClient['fetch'];
9
+ type DocumentToolsNoticeKind = 'success' | 'error' | 'info' | 'warning';
10
+ interface DocumentToolsNoticeOptions {
11
+ /** A second line under the message. */
12
+ description?: string;
13
+ /** One action button on the notice ("Email it"). */
14
+ action?: {
15
+ label: string;
16
+ onClick: () => void;
17
+ };
18
+ }
19
+ type DocumentToolsNotify = (message: string, kind: DocumentToolsNoticeKind, options?: DocumentToolsNoticeOptions) => void;
20
+ interface DocumentToolsUser {
21
+ /** The name marks are authored as and the signer's name is prefilled with. */
22
+ name: string;
23
+ /** The sign-in email: signing re-derives the user's key from it and the password. */
24
+ email?: string | null;
25
+ }
26
+ /** What changed about a document, so the host can refresh its own lists and caches. */
27
+ type DocumentChange =
28
+ /** A version's markup got its first mark or lost its last one. */
29
+ 'markup'
30
+ /** A signature was added: the document has a new current version. */
31
+ | 'signed'
32
+ /** A new document was made from it (a frozen copy). The ids are the NEW documents. */
33
+ | 'copy';
34
+ interface DocumentUploadRequest {
35
+ file: File;
36
+ /** `/v1/document/upload` query: `derived_from`, `derived_role`, `shared`, `folder`. */
37
+ query: Record<string, string>;
38
+ }
39
+ interface DocumentToolsEnvironment {
40
+ client: DocumentToolsClient;
41
+ /** The deployment domain the user's keys are derived for. Needed for signing. */
42
+ deploymentDomain?: string;
43
+ /** The signed-in user; marks are authored as "You" without one, and signing is unavailable. */
44
+ user?: DocumentToolsUser | null;
45
+ /** Surface a transient message. Default: none (errors still show inline where they can). */
46
+ notify?: DocumentToolsNotify;
47
+ /** Open a document or a version reference (`doc-…@v2`): the copy just made, the signed copy. */
48
+ openDocument?: (documentRef: string) => void;
49
+ /**
50
+ * Documents changed on the server (see {@link DocumentChange}); refresh the host's lists. The
51
+ * tools wait for it before opening the document, so a copy is listed when it opens.
52
+ */
53
+ onDocumentsChanged?: (documentIds: string[], change: DocumentChange) => void | Promise<void>;
54
+ /** Upload a derived copy. Default: `POST /v1/document/upload` through `client`. */
55
+ uploadDocument?: (request: DocumentUploadRequest) => Promise<{
56
+ doc_ext_ids?: string[];
57
+ } | undefined>;
58
+ /** Save a file to the user's computer. Default: a temporary download link. */
59
+ saveFile?: (blob: Blob, fileName: string) => void;
60
+ /** Email a document (offered once it is signed). Omitted: no "Email it". */
61
+ emailDocument?: (documentRef: string) => void;
62
+ /**
63
+ * The public page that checks a signature (the certificate), when the backend did not return
64
+ * one. Default: `/verify/{reference}` on this origin.
65
+ */
66
+ certificateUrl?: (reference: string) => string;
67
+ }
68
+ /** The environment with every default filled in. */
69
+ interface ResolvedDocumentToolsEnvironment extends DocumentToolsEnvironment {
70
+ notify: DocumentToolsNotify;
71
+ saveFile: (blob: Blob, fileName: string) => void;
72
+ uploadDocument: (request: DocumentUploadRequest) => Promise<{
73
+ doc_ext_ids?: string[];
74
+ } | undefined>;
75
+ certificateUrl: (reference: string) => string;
76
+ }
77
+ /** Save a blob through a temporary `<a download>`. */
78
+ declare function downloadBlob(blob: Blob, fileName: string): void;
79
+ /** The default upload: multipart `files` to `/v1/document/upload` through the API client. */
80
+ declare function clientUpload(client: DocumentToolsClient): ({ file, query }: DocumentUploadRequest) => Promise<{
81
+ doc_ext_ids?: string[];
82
+ } | undefined>;
83
+ declare function defaultCertificateUrl(reference: string): string;
84
+ interface DocumentToolsProviderProps extends DocumentToolsEnvironment {
85
+ children: ReactNode;
86
+ }
87
+ declare function DocumentToolsProvider({ children, ...env }: DocumentToolsProviderProps): React.JSX.Element;
88
+ /** The host's environment; throws outside a `<DocumentToolsProvider>`. */
89
+ declare function useDocumentTools(): ResolvedDocumentToolsEnvironment;
90
+
91
+ /**
92
+ * The annotation store for a document version's MARKUP on the server: `GET`/`PUT
93
+ * /v1/document/{id}/markup`. The server keeps the marks as native PDF annotations in an encrypted
94
+ * `{doc}-markup.pdf` next to the version (same document id, the document's own privacy); this store
95
+ * only moves the layer and its revision.
96
+ *
97
+ * Optimistic concurrency: every save names the revision it started from. When someone else saved
98
+ * first the server answers 409; the store then re-reads the latest layer, merges it with ours by
99
+ * annotation id (`mergeLayers`: union, last edit wins per mark, replies unioned, our deletions
100
+ * stay deleted) and saves again. The merged layer is returned so the viewer shows their marks too.
101
+ *
102
+ * Deletions are tracked as tombstones for the session: an id this session has seen that is no
103
+ * longer in the layer it saves was deleted here, and a concurrent edit elsewhere cannot bring it
104
+ * back.
105
+ */
106
+
107
+ /** How many times a save re-reads and merges after a 409 before giving up (each is a real race). */
108
+ declare const MAX_MERGE_ATTEMPTS = 5;
109
+ interface MarkupSnapshot {
110
+ revision: number;
111
+ count: number;
112
+ canEdit: boolean;
113
+ }
114
+ interface MarkupStoreOptions {
115
+ /** The version the markup belongs to; omitted = the document's current version. */
116
+ version?: number;
117
+ /** The ARBI API client (see `DocumentToolsEnvironment.client`). */
118
+ client: DocumentToolsClient;
119
+ /** After every successful save: the new revision and how many marks the markup holds. */
120
+ onSaved?: (snapshot: MarkupSnapshot) => void;
121
+ }
122
+ interface MarkupStore extends AnnotationStore {
123
+ snapshot(): MarkupSnapshot;
124
+ }
125
+ declare class MarkupStoreError extends Error {
126
+ readonly status?: number | undefined;
127
+ constructor(message: string, status?: number | undefined);
128
+ }
129
+ declare function createMarkupStore({ version, client, onSaved }: MarkupStoreOptions): MarkupStore;
130
+
131
+ /**
132
+ * Moving marks INTO a version's markup without the viewer: the one-time migration of layers kept in
133
+ * this browser before markup lived on the server, and "copy open comments" from an older version's
134
+ * markup onto the current one (a new version — signed, synced from Drive, saved from Word — starts
135
+ * with an empty markup; redactions never carry over).
136
+ *
137
+ * Both are unions by annotation id, so running them twice adds nothing twice.
138
+ */
139
+
140
+ declare const LEGACY_LAYER_PREFIX = "arbi:annotations:";
141
+ interface VersionInfo {
142
+ n: number;
143
+ created_at?: string | null;
144
+ markup_count?: number | null;
145
+ }
146
+ /** The layer this browser kept for a document before markup moved to the server, if any. */
147
+ declare function readLegacyLayer(documentId: string): AnnotationLayer | null;
148
+ declare function forgetLegacyLayer(documentId: string): void;
149
+ /**
150
+ * Which version each legacy mark belongs to: the version that was current when it was made. A
151
+ * document's id is the id of its first version (older layers were made on it); a layer made after
152
+ * the versions moved inside the document was made on whatever version was then current.
153
+ */
154
+ declare function marksByVersion(layer: AnnotationLayer, versions: VersionInfo[]): Map<number, Annotation[]>;
155
+ /** Add marks to one version's markup (union by id); returns how many were new. */
156
+ declare function addToMarkup(documentId: string, version: number | undefined, marks: Annotation[], client: DocumentToolsClient): Promise<number>;
157
+ /**
158
+ * Migrate this browser's layer for a document into its markup, version by version, then forget
159
+ * the browser copy. Throws (and keeps the browser copy) if any version could not be saved.
160
+ */
161
+ declare function migrateLegacyLayer(documentId: string, layer: AnnotationLayer, versions: VersionInfo[], currentVersion: number, client: DocumentToolsClient): Promise<number>;
162
+ /** The unresolved comment threads (with replies) of a version's markup. */
163
+ declare function openThreadsOf(documentId: string, version: number, client: DocumentToolsClient): Promise<Annotation[]>;
164
+ /** Copy the open comment threads of an older version onto the current version's markup. */
165
+ declare function copyOpenThreads(documentId: string, fromVersion: number, client: DocumentToolsClient): Promise<number>;
166
+ /** Version entries of a document as the API returns them (`DocResponse.versions`). */
167
+ declare function versionsWithMarkup(versions: VersionInfo[] | null | undefined): VersionInfo[];
168
+
169
+ /**
170
+ * "Download with markup": a document version's markup PDF, the PDF with its annotations as native
171
+ * PDF annotations (comments, highlights, stamps, unapplied redactions), which Acrobat and Preview
172
+ * show. The plain Download serves the original. Kept apart from the annotation layer code so a
173
+ * documents list can offer it without loading the annotation tools.
174
+ *
175
+ * A SIGNED version is locked: nothing but a further signature changes it. Its markup stays in the
176
+ * separate markup layer (a title beside the signature, say) and is never written into its PDF, so
177
+ * it has no "Download with markup"; the plain Download is the signed file as it is.
178
+ */
179
+
180
+ interface DocumentVersions {
181
+ current_version?: number | null;
182
+ versions?: Array<{
183
+ n: number;
184
+ markup_count?: number | null;
185
+ reason?: string | null;
186
+ }> | null;
187
+ }
188
+ /** Why "Download with markup" is off for a signed version. */
189
+ declare const SIGNED_LOCKED_REASON = "Signed documents can't be changed \u2014 download the signed file instead";
190
+ /** Whether a version (default: the current one) is a signed copy, per its version entry. */
191
+ declare function isSignedVersion(doc: DocumentVersions, version?: number): boolean;
192
+ declare class MarkupDownloadError extends Error {
193
+ readonly status?: number | undefined;
194
+ constructor(message: string, status?: number | undefined);
195
+ }
196
+ /** Whether a document's current version has markup (per its version entries). */
197
+ declare function currentHasMarkup(doc: DocumentVersions): boolean;
198
+ /** Fetch a version's markup PDF (default: the current version's). */
199
+ declare function fetchMarkupPdf(client: DocumentToolsClient, documentId: string, version?: number): Promise<{
200
+ blob: Blob;
201
+ fileName: string;
202
+ }>;
203
+
204
+ declare const SIGNED_UNCHANGED = "The signed PDF is unchanged: the comments are kept beside it as markup.";
205
+ interface MarkupDocument {
206
+ external_id: string;
207
+ shared?: boolean | null;
208
+ current_version?: number | null;
209
+ versions?: VersionInfo[] | null;
210
+ }
211
+ interface LegacyPrompt {
212
+ count: number;
213
+ busy: boolean;
214
+ add: () => void;
215
+ discard: () => void;
216
+ }
217
+ interface OlderMarkupNote {
218
+ version: number;
219
+ busy: boolean;
220
+ /** The current version is a signed copy: say that copying leaves its signed PDF as it is. */
221
+ signed: boolean;
222
+ copy: () => void;
223
+ }
224
+ declare function useDocumentMarkup(documentData: MarkupDocument | null | undefined,
225
+ /** The version on screen when it is an older one (a read-only snapshot). */
226
+ snapshotVersion: number | undefined,
227
+ /**
228
+ * Whether the version on screen is a signed, sealed copy: locked, so no "Download with markup"
229
+ * (and, for the current version, copied comments leave its signed PDF as it is).
230
+ */
231
+ currentSigned?: boolean): {
232
+ hasMarkup: boolean;
233
+ showOriginal: boolean;
234
+ setShowOriginal: React.Dispatch<React.SetStateAction<boolean>>;
235
+ onMarkupChange: (snapshot: MarkupSnapshot) => void;
236
+ downloadMarkup: () => Promise<void>;
237
+ legacyPrompt: LegacyPrompt | null;
238
+ olderNote: OlderMarkupNote | null;
239
+ };
240
+
241
+ /**
242
+ * Saving a frozen copy: a SEPARATE document derived from the version it was frozen from
243
+ * (`derived_from`, role `redaction` or `annotated`), never a new version of it. The original keeps
244
+ * its place in every list and stays the current version; the copy sits beside it, in the same
245
+ * folder and with the same workspace sharing.
246
+ */
247
+
248
+ interface FrozenCopySource {
249
+ /** The version on screen, which the copy is derived from. */
250
+ documentId: string;
251
+ fileName: string | null | undefined;
252
+ shared: boolean;
253
+ folder?: string | null;
254
+ }
255
+ /** "Contract.pdf" becomes "Contract (redacted).pdf"; a .txt or .docx keeps its extension inside. */
256
+ declare function frozenCopyName(fileName: string | null | undefined, redacted: boolean): string;
257
+ declare function redactionLogName(fileName: string | null | undefined): string;
258
+ /** Upload the frozen bytes as a new document derived from `source`; returns its id, if any. */
259
+ declare function uploadFrozenCopy(upload: NonNullable<DocumentToolsEnvironment['uploadDocument']>, bytes: Uint8Array, source: FrozenCopySource, redacted: boolean): Promise<string | undefined>;
260
+
261
+ /**
262
+ * Whether the document on screen can be annotated: only a PDF the viewer is actually showing.
263
+ * Text and Word files are shown as a PDF too, so they qualify; images, audio, video, files that
264
+ * cannot be previewed, drafts and streaming output do not, and neither does a read-only snapshot
265
+ * or a comparison.
266
+ */
267
+ interface AnnotatableState {
268
+ activeTab: string;
269
+ /** The PDF bytes have been fetched. */
270
+ hasPdf: boolean;
271
+ isImage: boolean;
272
+ isVideo: boolean;
273
+ isAudio: boolean;
274
+ isDownloadOnly: boolean;
275
+ isDraft: boolean;
276
+ isStreaming: boolean;
277
+ isSnapshot: boolean;
278
+ isComparing: boolean;
279
+ }
280
+ declare function canAnnotate(s: AnnotatableState): boolean;
281
+
282
+ /**
283
+ * Reactive connectivity from React Query's `onlineManager` (the browser's online events, plus
284
+ * whatever the host feeds it, e.g. a WebSocket). The markup autosave waits while it is false.
285
+ */
286
+ declare function useIsOnline(): boolean;
287
+
288
+ /**
289
+ * Who signs: the name only. A role, a firm or a place go on the page as ordinary annotation text,
290
+ * which is not part of the signature.
291
+ */
292
+ type SignerDetails = components['schemas']['SignerDetails'];
293
+ /** Same sentence as `esign.intent_text`; the dialog refuses to sign if the server's differs. */
294
+ declare function intentText(signer: SignerDetails): string;
295
+ declare function sha256Hex(blob: Blob): Promise<string>;
296
+ /** A signature box drawn on the annotation overlay, as the signing API's placement. */
297
+ declare function toAppearance(box: {
298
+ page: number;
299
+ rect: {
300
+ x: number;
301
+ y: number;
302
+ w: number;
303
+ h: number;
304
+ };
305
+ }): {
306
+ page: number;
307
+ x: number;
308
+ y: number;
309
+ width: number;
310
+ height: number;
311
+ };
312
+ declare function isLegibleSignatureBox(rect: {
313
+ w: number;
314
+ h: number;
315
+ }): boolean;
316
+ type SignatureAppearance = components['schemas']['SignatureAppearance'];
317
+ type SignatureStatusResponse = components['schemas']['SignatureStatusResponse'];
318
+ type SignatureRecord = components['schemas']['SignatureRecord'];
319
+ type SignDocumentResponse = components['schemas']['SignDocumentResponse'];
320
+ /** Whether a document version is a signed copy, and its signatures. */
321
+ declare function fetchDocumentSignatures(client: DocumentToolsClient, documentRef: string): Promise<SignatureStatusResponse>;
322
+ /**
323
+ * Is a document version a signed copy? `documentId` is a document id (its current version) or a
324
+ * version reference `doc-…@v{n}`. Needs a React Query `QueryClientProvider`.
325
+ */
326
+ declare function useDocumentSignatures(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
327
+ signed: boolean;
328
+ intact: boolean;
329
+ timestamped: boolean;
330
+ certificate_url?: string | null;
331
+ signatures: components["schemas"]["SignatureRecord"][];
332
+ }>, Error>;
333
+ interface SignDocumentVars {
334
+ documentId: string;
335
+ /** The PDF bytes the viewer is showing: the signer signs exactly these. */
336
+ pdfBlob: Blob;
337
+ email: string;
338
+ password: string;
339
+ signer: SignerDetails;
340
+ /** Where the signature goes; omitted = the backend default (bottom of the last page). */
341
+ appearance?: SignatureAppearance;
342
+ /** Draw the signing date under the signature. Default off: only the signature is drawn. */
343
+ includeDate?: boolean;
344
+ }
345
+ /**
346
+ * Sign a document: the server prepares the statement, the browser checks that it covers the PDF
347
+ * on screen under the wording the signer read, re-derives the user's Ed25519 key from their
348
+ * password and signs it, and the server seals the signed copy as a new version.
349
+ *
350
+ * What is drawn on the page is only the signature (the signer's name as the signature mark) and,
351
+ * with `includeDate`, the date; anyone can click it to open its certificate. A role, a firm or a
352
+ * place go on the page as ordinary annotation text, which is not part of the signature.
353
+ */
354
+ declare function signDocument(client: DocumentToolsClient, deploymentDomain: string, { documentId, pdfBlob, email, password, signer, appearance, includeDate, }: SignDocumentVars): Promise<SignDocumentResponse>;
355
+ /** The signing mutation. On success the host hears the document changed (`'signed'`). */
356
+ declare function useSignDocument(): _tanstack_react_query.UseMutationResult<{
357
+ doc_ext_id: string;
358
+ version: number;
359
+ signature: components["schemas"]["SignatureRecord"];
360
+ }, Error, SignDocumentVars, unknown>;
361
+
362
+ declare const VERIFY_PATH = "/v1/sign/verify/{reference}";
363
+ type SignatureVerification = components['schemas']['SignatureVerification'];
364
+ type VerifiedSignature = components['schemas']['VerifiedSignature'];
365
+ declare function isSignatureReference(reference: string | null | undefined): boolean;
366
+ declare class SignatureVerificationError extends Error {
367
+ readonly status?: number | undefined;
368
+ constructor(message: string, status?: number | undefined);
369
+ }
370
+ declare function fetchSignatureVerification(client: DocumentToolsClient, reference: string): Promise<SignatureVerification>;
371
+ /** The certificate of a signature reference. Needs a `<DocumentToolsProvider>` (no user). */
372
+ declare function useSignatureVerification(reference: string | null | undefined): _tanstack_react_query.UseQueryResult<NoInfer<{
373
+ signatures: components["schemas"]["VerifiedSignature"][];
374
+ document_sha256: string;
375
+ intact: boolean;
376
+ }>, Error>;
377
+ /**
378
+ * What a copy is: the signed document as it stands (`current`), the document as it was when an
379
+ * earlier signer signed it (`earlier`, a counter-signed PDF's earlier revision), or neither.
380
+ */
381
+ type CopyMatch = {
382
+ kind: 'current';
383
+ } | {
384
+ kind: 'earlier';
385
+ signature: VerifiedSignature;
386
+ } | {
387
+ kind: 'none';
388
+ };
389
+ /** Compare a file with the signed PDF and its signed revisions. Hashed here; nothing is uploaded. */
390
+ declare function matchSignedCopy(file: Blob, verification: Pick<SignatureVerification, 'document_sha256' | 'signatures'>): Promise<CopyMatch>;
391
+
392
+ export { type AnnotatableState, type CopyMatch, type DocumentChange, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadRequest, type FrozenCopySource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, type ResolvedDocumentToolsEnvironment, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, type SignDocumentResponse, type SignDocumentVars, type SignatureAppearance, type SignatureRecord, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerDetails, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, canAnnotate, clientUpload, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, downloadBlob, fetchDocumentSignatures, fetchMarkupPdf, fetchSignatureVerification, forgetLegacyLayer, frozenCopyName, intentText, isLegibleSignatureBox, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, openThreadsOf, readLegacyLayer, redactionLogName, sha256Hex, signDocument, toAppearance, uploadFrozenCopy, useDocumentMarkup, useDocumentSignatures, useDocumentTools, useIsOnline, useSignDocument, useSignatureVerification, versionsWithMarkup };