@arbidocs/react 0.4.158 → 0.4.159

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 (47) hide show
  1. package/dist/{store-CoLuVSxI.d.ts → ProductionDialog-BvRVGdvH.d.ts} +33 -33
  2. package/dist/{store-BEXGdE1y.d.cts → ProductionDialog-Dhf9MXH-.d.cts} +33 -33
  3. package/dist/annotations/freeze/index.cjs +15 -15
  4. package/dist/annotations/freeze/index.d.cts +6 -1
  5. package/dist/annotations/freeze/index.d.ts +6 -1
  6. package/dist/annotations/freeze/index.js +3 -3
  7. package/dist/annotations/index.cjs +56 -56
  8. package/dist/annotations/index.d.cts +9 -4
  9. package/dist/annotations/index.d.ts +9 -4
  10. package/dist/annotations/index.js +2 -2
  11. package/dist/bundle-COMT7X3A.js +4 -0
  12. package/dist/{bundle-N2JIJ2T6.js.map → bundle-COMT7X3A.js.map} +1 -1
  13. package/dist/bundle-UWCOLMAA.cjs +13 -0
  14. package/dist/{bundle-T6BEVYHE.cjs.map → bundle-UWCOLMAA.cjs.map} +1 -1
  15. package/dist/{chunk-SSOPIPEX.cjs → chunk-LRBOMQ6Q.cjs} +4 -3
  16. package/dist/chunk-LRBOMQ6Q.cjs.map +1 -0
  17. package/dist/{chunk-COWZGCL5.js → chunk-NBIW7AEE.js} +4 -3
  18. package/dist/chunk-NBIW7AEE.js.map +1 -0
  19. package/dist/{chunk-ZJMUNGOY.js → chunk-R66GNDO7.js} +42 -4
  20. package/dist/chunk-R66GNDO7.js.map +1 -0
  21. package/dist/{chunk-L2PXZWJM.cjs → chunk-RDF2Q45F.cjs} +75 -20
  22. package/dist/chunk-RDF2Q45F.cjs.map +1 -0
  23. package/dist/{chunk-IHTBAY57.js → chunk-S33P6THG.js} +59 -4
  24. package/dist/chunk-S33P6THG.js.map +1 -0
  25. package/dist/{chunk-QJXFRP5R.cjs → chunk-UP6PIBVF.cjs} +46 -8
  26. package/dist/chunk-UP6PIBVF.cjs.map +1 -0
  27. package/dist/document-tools/index.cjs +157 -27
  28. package/dist/document-tools/index.cjs.map +1 -1
  29. package/dist/document-tools/index.d.cts +110 -13
  30. package/dist/document-tools/index.d.ts +110 -13
  31. package/dist/document-tools/index.js +137 -21
  32. package/dist/document-tools/index.js.map +1 -1
  33. package/dist/index.cjs +13 -13
  34. package/dist/index.js +2 -2
  35. package/dist/{model-DIwXRuGC.d.cts → model-D63gedpb.d.cts} +5 -0
  36. package/dist/{model-DIwXRuGC.d.ts → model-D63gedpb.d.ts} +5 -0
  37. package/dist/ui/index.cjs +9 -9
  38. package/dist/ui/index.js +1 -1
  39. package/package.json +3 -3
  40. package/dist/bundle-N2JIJ2T6.js +0 -4
  41. package/dist/bundle-T6BEVYHE.cjs +0 -13
  42. package/dist/chunk-COWZGCL5.js.map +0 -1
  43. package/dist/chunk-IHTBAY57.js.map +0 -1
  44. package/dist/chunk-L2PXZWJM.cjs.map +0 -1
  45. package/dist/chunk-QJXFRP5R.cjs.map +0 -1
  46. package/dist/chunk-SSOPIPEX.cjs.map +0 -1
  47. package/dist/chunk-ZJMUNGOY.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { ArbiClient, operations, components } from '@arbidocs/client';
4
- import { P as ProductionChoices, A as AnnotationStore } from '../store-BEXGdE1y.cjs';
3
+ import { ArbiClient, operations, components, KeyPair } from '@arbidocs/client';
4
+ import { P as ProductionChoices, A as AnnotationStore } from '../ProductionDialog-Dhf9MXH-.cjs';
5
5
  import { a as BundleFile, b as BundleIndexEntry } from '../bundle-BnCSbHy2.cjs';
6
- import { A as Annotation, b as AnnotationLayer } from '../model-DIwXRuGC.cjs';
6
+ import { A as Annotation, b as AnnotationLayer } from '../model-D63gedpb.cjs';
7
7
  import * as _tanstack_react_query from '@tanstack/react-query';
8
8
 
9
9
  type DocumentToolsClient = ArbiClient['fetch'];
@@ -575,17 +575,25 @@ type SignatureField = components['schemas']['SignatureField'];
575
575
  type SignatureFieldType = SignatureField['type'];
576
576
  type SignatureRequest = components['schemas']['SignatureRequestResponse'];
577
577
  type SignatureRequestSigner = components['schemas']['SignatureRequestSigner'];
578
+ type SignerProgress = components['schemas']['SignerProgress'];
578
579
  type SuggestedSignatureField = components['schemas']['SuggestedSignatureField'];
579
580
  type AdoptedSignature = components['schemas']['AdoptedSignature'];
580
581
  type SignRequestSignResponse = components['schemas']['SignRequestSignResponse'];
581
582
  /** Field types in the order the editor offers them. */
582
583
  declare const SIGNATURE_FIELD_TYPES: readonly SignatureFieldType[];
583
584
  declare const FIELD_TYPE_LABELS: Record<SignatureFieldType, string>;
584
- /** Default size of a new field, as fractions of the page (the backend draws to fit the box). */
585
+ /**
586
+ * Default size of a new field, as fractions of the page (the backend draws to fit the box). The
587
+ * same sizes the server's suggester places fields in (`esign_suggest._SIZE`).
588
+ */
585
589
  declare const DEFAULT_FIELD_SIZE: Record<SignatureFieldType, {
586
590
  width: number;
587
591
  height: number;
588
592
  }>;
593
+ /** How far each signer has got, as the request's sender sees it. */
594
+ declare const SIGNER_PROGRESS_LABELS: Record<SignerProgress, string>;
595
+ /** Whether a field's signer is an email (someone to invite) rather than a member or request signer. */
596
+ declare const isEmailSigner: (signer: string) => boolean;
589
597
  /** The fields carrying a signer's mark: every signer needs at least one to be sent the request. */
590
598
  declare const MARK_FIELD_TYPES: readonly SignatureFieldType[];
591
599
  /** A short unique id for a new field (the server only needs it unique within the request). */
@@ -598,9 +606,44 @@ declare function fieldsInSigningOrder(fields: SignatureField[], signer: string):
598
606
  declare function sendBlocker(fields: SignatureField[]): string | null;
599
607
  /**
600
608
  * Suggested fields grouped by signature block; `assign` maps a block (`group`) to the signer its
601
- * fields go to. Unassigned blocks are left out.
609
+ * fields go to. A field placed in the Word document that names its signer goes to them: the
610
+ * member with that email (`members`, by lowercased email), else the email itself (an invitee).
611
+ * Unassigned blocks are left out.
602
612
  */
603
- declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>): SignatureField[];
613
+ declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>, members?: ReadonlyMap<string, string>): SignatureField[];
614
+ /** The Word document's own fields (found by their anchors) and the optional layout suggestions. */
615
+ declare function splitSuggestions(suggestions: SuggestedSignatureField[]): {
616
+ placed: {
617
+ type: "signature" | "initials" | "date" | "name";
618
+ page: number;
619
+ x: number;
620
+ y: number;
621
+ width: number;
622
+ height: number;
623
+ group: number;
624
+ role?: string | null;
625
+ anchor: string;
626
+ source: "anchor" | "layout";
627
+ signer_email?: string | null;
628
+ signer_name?: string | null;
629
+ required: boolean;
630
+ }[];
631
+ extras: {
632
+ type: "signature" | "initials" | "date" | "name";
633
+ page: number;
634
+ x: number;
635
+ y: number;
636
+ width: number;
637
+ height: number;
638
+ group: number;
639
+ role?: string | null;
640
+ anchor: string;
641
+ source: "anchor" | "layout";
642
+ signer_email?: string | null;
643
+ signer_name?: string | null;
644
+ required: boolean;
645
+ }[];
646
+ };
604
647
  declare function fetchDocumentSignatureRequests(client: DocumentToolsClient, documentId: string): Promise<SignatureRequest[]>;
605
648
  /** A document's signature requests, newest first. */
606
649
  declare function useDocumentSignatureRequests(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
@@ -639,10 +682,13 @@ declare function useSignatureRequestsAwaitingMe(enabled?: boolean): _tanstack_re
639
682
  required: boolean;
640
683
  }[];
641
684
  signers: {
642
- user_ext_id: string;
685
+ external_id: string;
686
+ user_ext_id?: string | null | undefined;
643
687
  name: string;
644
688
  email?: string | null | undefined;
645
689
  status: components["schemas"]["SignerStatus"];
690
+ progress: components["schemas"]["SignerProgress"];
691
+ viewed_at?: string | null | undefined;
646
692
  signed_at?: string | null | undefined;
647
693
  reference?: string | null | undefined;
648
694
  fields: number;
@@ -673,10 +719,13 @@ declare function useSignatureRequest(requestId: string | null | undefined): _tan
673
719
  required: boolean;
674
720
  }[];
675
721
  signers: {
676
- user_ext_id: string;
722
+ external_id: string;
723
+ user_ext_id?: string | null | undefined;
677
724
  name: string;
678
725
  email?: string | null | undefined;
679
726
  status: components["schemas"]["SignerStatus"];
727
+ progress: components["schemas"]["SignerProgress"];
728
+ viewed_at?: string | null | undefined;
680
729
  signed_at?: string | null | undefined;
681
730
  reference?: string | null | undefined;
682
731
  fields: number;
@@ -736,10 +785,13 @@ declare function useVoidSignatureRequest(): _tanstack_react_query.UseMutationRes
736
785
  required: boolean;
737
786
  }[];
738
787
  signers: {
739
- user_ext_id: string;
788
+ external_id: string;
789
+ user_ext_id?: string | null | undefined;
740
790
  name: string;
741
791
  email?: string | null | undefined;
742
792
  status: components["schemas"]["SignerStatus"];
793
+ progress: components["schemas"]["SignerProgress"];
794
+ viewed_at?: string | null | undefined;
743
795
  signed_at?: string | null | undefined;
744
796
  reference?: string | null | undefined;
745
797
  fields: number;
@@ -770,10 +822,13 @@ declare function useDeclineSignatureRequest(): _tanstack_react_query.UseMutation
770
822
  required: boolean;
771
823
  }[];
772
824
  signers: {
773
- user_ext_id: string;
825
+ external_id: string;
826
+ user_ext_id?: string | null | undefined;
774
827
  name: string;
775
828
  email?: string | null | undefined;
776
829
  status: components["schemas"]["SignerStatus"];
830
+ progress: components["schemas"]["SignerProgress"];
831
+ viewed_at?: string | null | undefined;
777
832
  signed_at?: string | null | undefined;
778
833
  reference?: string | null | undefined;
779
834
  fields: number;
@@ -816,9 +871,51 @@ interface SignerCandidate {
816
871
  role: string;
817
872
  }
818
873
  /**
819
- * The people in the active workspace who may sign: owners and collaborators (a guest cannot sign,
820
- * and an agent never does). The first one listed is the current user when they are a member.
874
+ * The people in the active workspace who may sign: owners, collaborators and guests (an agent never
875
+ * does). The first one listed is the current user when they are a member.
821
876
  */
822
877
  declare function useSignerCandidates(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SignerCandidate[]>, Error>;
878
+ /**
879
+ * Invite signers who are not in the workspace yet, as guests, through the workspace's own invite
880
+ * (`POST /v1/workspace/users` with `confirm_invite`): a registered person is added at once, anyone
881
+ * else is emailed an invitation that lands on the document. Each is asked to sign when they join.
882
+ * Only a workspace owner can invite.
883
+ */
884
+ declare function inviteSigners(client: DocumentToolsClient, documentId: string, emails: string[]): Promise<void>;
885
+ declare function useInviteSigners(): _tanstack_react_query.UseMutationResult<void, Error, {
886
+ documentId: string;
887
+ emails: string[];
888
+ }, unknown>;
889
+
890
+ interface SavedSignature {
891
+ name: string;
892
+ initials: string;
893
+ /** How the signature was adopted (a typed one is saved as its picture as well). */
894
+ style: 'typed' | 'drawn' | 'uploaded';
895
+ initials_style: 'typed' | 'drawn';
896
+ /** Base64 PNGs, transparent around the ink. */
897
+ signature_png: string;
898
+ initials_png: string;
899
+ }
900
+ /** The one line shown wherever a saved signature is placed by hand. */
901
+ declare const INFORMAL_SIGNATURE_NOTE = "Informal signature: for verified signing, use Request signatures.";
902
+ /** The user's own keypair (the session's); a host or a test may pass another. */
903
+ type KeypairSource = () => Promise<KeyPair | null>;
904
+ /** The saved signature, opened with the user's own key; null when none is saved. */
905
+ declare function fetchSavedSignature(client: DocumentToolsClient, source?: KeypairSource): Promise<SavedSignature | null>;
906
+ /** Seal it to the user's own key and save it (replacing any saved before). */
907
+ declare function storeSavedSignature(client: DocumentToolsClient, signature: SavedSignature, source?: KeypairSource): Promise<void>;
908
+ /** Remove it from the account completely. */
909
+ declare function deleteSavedSignature(client: DocumentToolsClient): Promise<void>;
910
+ declare function useSavedSignature(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SavedSignature | null>, Error>;
911
+ declare function useStoreSavedSignature(): _tanstack_react_query.UseMutationResult<void, Error, SavedSignature, unknown>;
912
+ declare function useDeleteSavedSignature(): _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
913
+ /** Base64 PNG bytes, decoded (for an inline picture or an upload). */
914
+ declare function pngBytes(base64: string): Uint8Array;
915
+ /** A PNG's pixel size, read from its header (IHDR). */
916
+ declare function pngSize(base64: string): {
917
+ width: number;
918
+ height: number;
919
+ };
823
920
 
824
- export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, type DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FrozenCopySource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, type SaveSignatureRequestVars, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, documentBytesKey, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useVoidSignatureRequest, versionsWithMarkup };
921
+ export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, type DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FrozenCopySource, INFORMAL_SIGNATURE_NOTE, type KeypairSource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, SIGNER_PROGRESS_LABELS, type SaveSignatureRequestVars, type SavedSignature, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, type SignerProgress, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, deleteSavedSignature, documentBytesKey, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSavedSignature, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, inviteSigners, isEmailSigner, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, pngBytes, pngSize, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, splitSuggestions, storeSavedSignature, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useInviteSigners, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSavedSignature, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useStoreSavedSignature, useVoidSignatureRequest, versionsWithMarkup };
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { ArbiClient, operations, components } from '@arbidocs/client';
4
- import { P as ProductionChoices, A as AnnotationStore } from '../store-CoLuVSxI.js';
3
+ import { ArbiClient, operations, components, KeyPair } from '@arbidocs/client';
4
+ import { P as ProductionChoices, A as AnnotationStore } from '../ProductionDialog-BvRVGdvH.js';
5
5
  import { a as BundleFile, b as BundleIndexEntry } from '../bundle-BnCSbHy2.js';
6
- import { A as Annotation, b as AnnotationLayer } from '../model-DIwXRuGC.js';
6
+ import { A as Annotation, b as AnnotationLayer } from '../model-D63gedpb.js';
7
7
  import * as _tanstack_react_query from '@tanstack/react-query';
8
8
 
9
9
  type DocumentToolsClient = ArbiClient['fetch'];
@@ -575,17 +575,25 @@ type SignatureField = components['schemas']['SignatureField'];
575
575
  type SignatureFieldType = SignatureField['type'];
576
576
  type SignatureRequest = components['schemas']['SignatureRequestResponse'];
577
577
  type SignatureRequestSigner = components['schemas']['SignatureRequestSigner'];
578
+ type SignerProgress = components['schemas']['SignerProgress'];
578
579
  type SuggestedSignatureField = components['schemas']['SuggestedSignatureField'];
579
580
  type AdoptedSignature = components['schemas']['AdoptedSignature'];
580
581
  type SignRequestSignResponse = components['schemas']['SignRequestSignResponse'];
581
582
  /** Field types in the order the editor offers them. */
582
583
  declare const SIGNATURE_FIELD_TYPES: readonly SignatureFieldType[];
583
584
  declare const FIELD_TYPE_LABELS: Record<SignatureFieldType, string>;
584
- /** Default size of a new field, as fractions of the page (the backend draws to fit the box). */
585
+ /**
586
+ * Default size of a new field, as fractions of the page (the backend draws to fit the box). The
587
+ * same sizes the server's suggester places fields in (`esign_suggest._SIZE`).
588
+ */
585
589
  declare const DEFAULT_FIELD_SIZE: Record<SignatureFieldType, {
586
590
  width: number;
587
591
  height: number;
588
592
  }>;
593
+ /** How far each signer has got, as the request's sender sees it. */
594
+ declare const SIGNER_PROGRESS_LABELS: Record<SignerProgress, string>;
595
+ /** Whether a field's signer is an email (someone to invite) rather than a member or request signer. */
596
+ declare const isEmailSigner: (signer: string) => boolean;
589
597
  /** The fields carrying a signer's mark: every signer needs at least one to be sent the request. */
590
598
  declare const MARK_FIELD_TYPES: readonly SignatureFieldType[];
591
599
  /** A short unique id for a new field (the server only needs it unique within the request). */
@@ -598,9 +606,44 @@ declare function fieldsInSigningOrder(fields: SignatureField[], signer: string):
598
606
  declare function sendBlocker(fields: SignatureField[]): string | null;
599
607
  /**
600
608
  * Suggested fields grouped by signature block; `assign` maps a block (`group`) to the signer its
601
- * fields go to. Unassigned blocks are left out.
609
+ * fields go to. A field placed in the Word document that names its signer goes to them: the
610
+ * member with that email (`members`, by lowercased email), else the email itself (an invitee).
611
+ * Unassigned blocks are left out.
602
612
  */
603
- declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>): SignatureField[];
613
+ declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>, members?: ReadonlyMap<string, string>): SignatureField[];
614
+ /** The Word document's own fields (found by their anchors) and the optional layout suggestions. */
615
+ declare function splitSuggestions(suggestions: SuggestedSignatureField[]): {
616
+ placed: {
617
+ type: "signature" | "initials" | "date" | "name";
618
+ page: number;
619
+ x: number;
620
+ y: number;
621
+ width: number;
622
+ height: number;
623
+ group: number;
624
+ role?: string | null;
625
+ anchor: string;
626
+ source: "anchor" | "layout";
627
+ signer_email?: string | null;
628
+ signer_name?: string | null;
629
+ required: boolean;
630
+ }[];
631
+ extras: {
632
+ type: "signature" | "initials" | "date" | "name";
633
+ page: number;
634
+ x: number;
635
+ y: number;
636
+ width: number;
637
+ height: number;
638
+ group: number;
639
+ role?: string | null;
640
+ anchor: string;
641
+ source: "anchor" | "layout";
642
+ signer_email?: string | null;
643
+ signer_name?: string | null;
644
+ required: boolean;
645
+ }[];
646
+ };
604
647
  declare function fetchDocumentSignatureRequests(client: DocumentToolsClient, documentId: string): Promise<SignatureRequest[]>;
605
648
  /** A document's signature requests, newest first. */
606
649
  declare function useDocumentSignatureRequests(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
@@ -639,10 +682,13 @@ declare function useSignatureRequestsAwaitingMe(enabled?: boolean): _tanstack_re
639
682
  required: boolean;
640
683
  }[];
641
684
  signers: {
642
- user_ext_id: string;
685
+ external_id: string;
686
+ user_ext_id?: string | null | undefined;
643
687
  name: string;
644
688
  email?: string | null | undefined;
645
689
  status: components["schemas"]["SignerStatus"];
690
+ progress: components["schemas"]["SignerProgress"];
691
+ viewed_at?: string | null | undefined;
646
692
  signed_at?: string | null | undefined;
647
693
  reference?: string | null | undefined;
648
694
  fields: number;
@@ -673,10 +719,13 @@ declare function useSignatureRequest(requestId: string | null | undefined): _tan
673
719
  required: boolean;
674
720
  }[];
675
721
  signers: {
676
- user_ext_id: string;
722
+ external_id: string;
723
+ user_ext_id?: string | null | undefined;
677
724
  name: string;
678
725
  email?: string | null | undefined;
679
726
  status: components["schemas"]["SignerStatus"];
727
+ progress: components["schemas"]["SignerProgress"];
728
+ viewed_at?: string | null | undefined;
680
729
  signed_at?: string | null | undefined;
681
730
  reference?: string | null | undefined;
682
731
  fields: number;
@@ -736,10 +785,13 @@ declare function useVoidSignatureRequest(): _tanstack_react_query.UseMutationRes
736
785
  required: boolean;
737
786
  }[];
738
787
  signers: {
739
- user_ext_id: string;
788
+ external_id: string;
789
+ user_ext_id?: string | null | undefined;
740
790
  name: string;
741
791
  email?: string | null | undefined;
742
792
  status: components["schemas"]["SignerStatus"];
793
+ progress: components["schemas"]["SignerProgress"];
794
+ viewed_at?: string | null | undefined;
743
795
  signed_at?: string | null | undefined;
744
796
  reference?: string | null | undefined;
745
797
  fields: number;
@@ -770,10 +822,13 @@ declare function useDeclineSignatureRequest(): _tanstack_react_query.UseMutation
770
822
  required: boolean;
771
823
  }[];
772
824
  signers: {
773
- user_ext_id: string;
825
+ external_id: string;
826
+ user_ext_id?: string | null | undefined;
774
827
  name: string;
775
828
  email?: string | null | undefined;
776
829
  status: components["schemas"]["SignerStatus"];
830
+ progress: components["schemas"]["SignerProgress"];
831
+ viewed_at?: string | null | undefined;
777
832
  signed_at?: string | null | undefined;
778
833
  reference?: string | null | undefined;
779
834
  fields: number;
@@ -816,9 +871,51 @@ interface SignerCandidate {
816
871
  role: string;
817
872
  }
818
873
  /**
819
- * The people in the active workspace who may sign: owners and collaborators (a guest cannot sign,
820
- * and an agent never does). The first one listed is the current user when they are a member.
874
+ * The people in the active workspace who may sign: owners, collaborators and guests (an agent never
875
+ * does). The first one listed is the current user when they are a member.
821
876
  */
822
877
  declare function useSignerCandidates(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SignerCandidate[]>, Error>;
878
+ /**
879
+ * Invite signers who are not in the workspace yet, as guests, through the workspace's own invite
880
+ * (`POST /v1/workspace/users` with `confirm_invite`): a registered person is added at once, anyone
881
+ * else is emailed an invitation that lands on the document. Each is asked to sign when they join.
882
+ * Only a workspace owner can invite.
883
+ */
884
+ declare function inviteSigners(client: DocumentToolsClient, documentId: string, emails: string[]): Promise<void>;
885
+ declare function useInviteSigners(): _tanstack_react_query.UseMutationResult<void, Error, {
886
+ documentId: string;
887
+ emails: string[];
888
+ }, unknown>;
889
+
890
+ interface SavedSignature {
891
+ name: string;
892
+ initials: string;
893
+ /** How the signature was adopted (a typed one is saved as its picture as well). */
894
+ style: 'typed' | 'drawn' | 'uploaded';
895
+ initials_style: 'typed' | 'drawn';
896
+ /** Base64 PNGs, transparent around the ink. */
897
+ signature_png: string;
898
+ initials_png: string;
899
+ }
900
+ /** The one line shown wherever a saved signature is placed by hand. */
901
+ declare const INFORMAL_SIGNATURE_NOTE = "Informal signature: for verified signing, use Request signatures.";
902
+ /** The user's own keypair (the session's); a host or a test may pass another. */
903
+ type KeypairSource = () => Promise<KeyPair | null>;
904
+ /** The saved signature, opened with the user's own key; null when none is saved. */
905
+ declare function fetchSavedSignature(client: DocumentToolsClient, source?: KeypairSource): Promise<SavedSignature | null>;
906
+ /** Seal it to the user's own key and save it (replacing any saved before). */
907
+ declare function storeSavedSignature(client: DocumentToolsClient, signature: SavedSignature, source?: KeypairSource): Promise<void>;
908
+ /** Remove it from the account completely. */
909
+ declare function deleteSavedSignature(client: DocumentToolsClient): Promise<void>;
910
+ declare function useSavedSignature(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SavedSignature | null>, Error>;
911
+ declare function useStoreSavedSignature(): _tanstack_react_query.UseMutationResult<void, Error, SavedSignature, unknown>;
912
+ declare function useDeleteSavedSignature(): _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
913
+ /** Base64 PNG bytes, decoded (for an inline picture or an upload). */
914
+ declare function pngBytes(base64: string): Uint8Array;
915
+ /** A PNG's pixel size, read from its header (IHDR). */
916
+ declare function pngSize(base64: string): {
917
+ width: number;
918
+ height: number;
919
+ };
823
920
 
824
- export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, type DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FrozenCopySource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, type SaveSignatureRequestVars, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, documentBytesKey, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useVoidSignatureRequest, versionsWithMarkup };
921
+ export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, type DocumentBytesKind, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, FIELD_TYPE_LABELS, type FrozenCopySource, INFORMAL_SIGNATURE_NOTE, type KeypairSource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MARK_FIELD_TYPES, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNATURE_FIELD_TYPES, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, SIGNER_PROGRESS_LABELS, type SaveSignatureRequestVars, type SavedSignature, type SignDocumentResponse, type SignDocumentVars, type SignRequestSignResponse, type SignRequestVars, type SignatureAppearance, type SignatureField, type SignatureFieldType, type SignatureRecord, type SignatureRequest, type SignatureRequestSigner, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerCandidate, type SignerDetails, type SignerProgress, SigningError, type SigningErrorReason, type SuggestedSignatureField, type UseDocumentBytesOptions, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, contentDispositionFileName, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, deleteSavedSignature, documentBytesKey, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatureRequests, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSavedSignature, fetchSignatureVerification, fieldsFromSuggestions, fieldsInSigningOrder, forgetLegacyLayer, frozenCopyName, hasNoRendition, initialsOf, intentText, inviteSigners, isEmailSigner, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, newFieldId, openThreadsOf, pngBytes, pngSize, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, saveSignatureRequest, sendBlocker, sha256Hex, signDocument, signSignatureRequest, splitSuggestions, storeSavedSignature, suggestSignatureFields, toAppearance, uploadFrozenCopy, uploadQueryString, useDeclineSignatureRequest, useDeleteSavedSignature, useDocumentBytes, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useInviteSigners, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSavedSignature, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useStoreSavedSignature, useVoidSignatureRequest, versionsWithMarkup };