@arbidocs/react 0.4.101 → 0.4.102

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.
@@ -23,6 +23,8 @@ interface DocumentToolsUser {
23
23
  name: string;
24
24
  /** The sign-in email: signing re-derives the user's key from it and the password. */
25
25
  email?: string | null;
26
+ /** The user's id (usr-*): which fields of a signature request are theirs. */
27
+ externalId?: string | null;
26
28
  }
27
29
  /** What changed about a document, so the host can refresh its own lists and caches. */
28
30
  type DocumentChange =
@@ -537,4 +539,254 @@ type CopyMatch = {
537
539
  /** Compare a file with the signed PDF and its signed revisions. Hashed here; nothing is uploaded. */
538
540
  declare function matchSignedCopy(file: Blob, verification: Pick<SignatureVerification, 'document_sha256' | 'signatures'>): Promise<CopyMatch>;
539
541
 
540
- export { type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, type FrozenCopySource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, type SignDocumentResponse, type SignDocumentVars, type SignatureAppearance, type SignatureRecord, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerDetails, SigningError, type SigningErrorReason, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSignatureVerification, forgetLegacyLayer, frozenCopyName, hasNoRendition, intentText, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, openThreadsOf, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, sha256Hex, signDocument, toAppearance, uploadFrozenCopy, uploadQueryString, useDocumentMarkup, useDocumentSignatures, useDocumentTools, useIsOnline, useOptionalDocumentTools, useSignDocument, useSignatureVerification, versionsWithMarkup };
542
+ type SignatureField = components['schemas']['SignatureField'];
543
+ type SignatureFieldType = SignatureField['type'];
544
+ type SignatureRequest = components['schemas']['SignatureRequestResponse'];
545
+ type SignatureRequestSigner = components['schemas']['SignatureRequestSigner'];
546
+ type SuggestedSignatureField = components['schemas']['SuggestedSignatureField'];
547
+ type AdoptedSignature = components['schemas']['AdoptedSignature'];
548
+ type SignRequestSignResponse = components['schemas']['SignRequestSignResponse'];
549
+ /** Field types in the order the editor offers them. */
550
+ declare const SIGNATURE_FIELD_TYPES: readonly SignatureFieldType[];
551
+ declare const FIELD_TYPE_LABELS: Record<SignatureFieldType, string>;
552
+ /** Default size of a new field, as fractions of the page (the backend draws to fit the box). */
553
+ declare const DEFAULT_FIELD_SIZE: Record<SignatureFieldType, {
554
+ width: number;
555
+ height: number;
556
+ }>;
557
+ /** The fields carrying a signer's mark: every signer needs at least one to be sent the request. */
558
+ declare const MARK_FIELD_TYPES: readonly SignatureFieldType[];
559
+ /** A short unique id for a new field (the server only needs it unique within the request). */
560
+ declare function newFieldId(): string;
561
+ /** Initials from a name: "Olive M. Owner" -> "OMO". */
562
+ declare function initialsOf(name: string): string;
563
+ /** The fields a signer completes, in the order they are walked through: page, then top to bottom. */
564
+ declare function fieldsInSigningOrder(fields: SignatureField[], signer: string): SignatureField[];
565
+ /** Why a draft cannot be sent yet, or null when it can. Mirrors the server's checks. */
566
+ declare function sendBlocker(fields: SignatureField[]): string | null;
567
+ /**
568
+ * Suggested fields grouped by signature block; `assign` maps a block (`group`) to the signer its
569
+ * fields go to. Unassigned blocks are left out.
570
+ */
571
+ declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>): SignatureField[];
572
+ declare function fetchDocumentSignatureRequests(client: DocumentToolsClient, documentId: string): Promise<SignatureRequest[]>;
573
+ /** A document's signature requests, newest first. */
574
+ declare function useDocumentSignatureRequests(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
575
+ external_id: string;
576
+ doc_ext_id: string | null;
577
+ version: number;
578
+ source_sha256: string;
579
+ status: components["schemas"]["SignatureRequestStatus"];
580
+ message?: string | null;
581
+ fields: components["schemas"]["SignatureField"][];
582
+ signers: components["schemas"]["SignatureRequestSigner"][];
583
+ created_by?: string | null;
584
+ created_at: string;
585
+ sent_at?: string | null;
586
+ completed_at?: string | null;
587
+ signed_version?: number | null;
588
+ stale: boolean;
589
+ }[]>, Error>;
590
+ /** Requests in the active workspace still waiting for the current user's signature. */
591
+ declare function useSignatureRequestsAwaitingMe(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
592
+ external_id: string;
593
+ doc_ext_id: string | null;
594
+ version: number;
595
+ source_sha256: string;
596
+ status: components["schemas"]["SignatureRequestStatus"];
597
+ message?: string | null | undefined;
598
+ fields: {
599
+ id: string;
600
+ type: "signature" | "initials" | "date" | "name";
601
+ page: number;
602
+ x: number;
603
+ y: number;
604
+ width: number;
605
+ height: number;
606
+ signer: string;
607
+ required: boolean;
608
+ }[];
609
+ signers: {
610
+ user_ext_id: string;
611
+ name: string;
612
+ email?: string | null | undefined;
613
+ status: components["schemas"]["SignerStatus"];
614
+ signed_at?: string | null | undefined;
615
+ reference?: string | null | undefined;
616
+ fields: number;
617
+ }[];
618
+ created_by?: string | null | undefined;
619
+ created_at: string;
620
+ sent_at?: string | null | undefined;
621
+ completed_at?: string | null | undefined;
622
+ signed_version?: number | null | undefined;
623
+ stale: boolean;
624
+ }[]>, Error>;
625
+ declare function useSignatureRequest(requestId: string | null | undefined): _tanstack_react_query.UseQueryResult<NoInfer<{
626
+ external_id: string;
627
+ doc_ext_id: string | null;
628
+ version: number;
629
+ source_sha256: string;
630
+ status: components["schemas"]["SignatureRequestStatus"];
631
+ message?: string | null | undefined;
632
+ fields: {
633
+ id: string;
634
+ type: "signature" | "initials" | "date" | "name";
635
+ page: number;
636
+ x: number;
637
+ y: number;
638
+ width: number;
639
+ height: number;
640
+ signer: string;
641
+ required: boolean;
642
+ }[];
643
+ signers: {
644
+ user_ext_id: string;
645
+ name: string;
646
+ email?: string | null | undefined;
647
+ status: components["schemas"]["SignerStatus"];
648
+ signed_at?: string | null | undefined;
649
+ reference?: string | null | undefined;
650
+ fields: number;
651
+ }[];
652
+ created_by?: string | null | undefined;
653
+ created_at: string;
654
+ sent_at?: string | null | undefined;
655
+ completed_at?: string | null | undefined;
656
+ signed_version?: number | null | undefined;
657
+ stale: boolean;
658
+ }>, Error>;
659
+ declare function suggestSignatureFields(client: DocumentToolsClient, documentId: string, version?: number): Promise<SuggestedSignatureField[]>;
660
+ interface SaveSignatureRequestVars {
661
+ documentId: string;
662
+ /** The version the fields were placed on (the PDF shown). Omitted = current. */
663
+ version?: number;
664
+ fields: SignatureField[];
665
+ message?: string;
666
+ /** Existing draft to update instead of creating a new request. */
667
+ requestId?: string;
668
+ /** Send it to the signers (else it is saved as a draft). */
669
+ send: boolean;
670
+ }
671
+ declare function saveSignatureRequest(client: DocumentToolsClient, { documentId, version, fields, message, requestId, send }: SaveSignatureRequestVars): Promise<SignatureRequest>;
672
+ declare function useSaveSignatureRequest(): _tanstack_react_query.UseMutationResult<{
673
+ external_id: string;
674
+ doc_ext_id: string | null;
675
+ version: number;
676
+ source_sha256: string;
677
+ status: components["schemas"]["SignatureRequestStatus"];
678
+ message?: string | null;
679
+ fields: components["schemas"]["SignatureField"][];
680
+ signers: components["schemas"]["SignatureRequestSigner"][];
681
+ created_by?: string | null;
682
+ created_at: string;
683
+ sent_at?: string | null;
684
+ completed_at?: string | null;
685
+ signed_version?: number | null;
686
+ stale: boolean;
687
+ }, Error, SaveSignatureRequestVars, unknown>;
688
+ declare function useVoidSignatureRequest(): _tanstack_react_query.UseMutationResult<{
689
+ external_id: string;
690
+ doc_ext_id: string | null;
691
+ version: number;
692
+ source_sha256: string;
693
+ status: components["schemas"]["SignatureRequestStatus"];
694
+ message?: string | null | undefined;
695
+ fields: {
696
+ id: string;
697
+ type: "signature" | "initials" | "date" | "name";
698
+ page: number;
699
+ x: number;
700
+ y: number;
701
+ width: number;
702
+ height: number;
703
+ signer: string;
704
+ required: boolean;
705
+ }[];
706
+ signers: {
707
+ user_ext_id: string;
708
+ name: string;
709
+ email?: string | null | undefined;
710
+ status: components["schemas"]["SignerStatus"];
711
+ signed_at?: string | null | undefined;
712
+ reference?: string | null | undefined;
713
+ fields: number;
714
+ }[];
715
+ created_by?: string | null | undefined;
716
+ created_at: string;
717
+ sent_at?: string | null | undefined;
718
+ completed_at?: string | null | undefined;
719
+ signed_version?: number | null | undefined;
720
+ stale: boolean;
721
+ }, Error, string, unknown>;
722
+ declare function useDeclineSignatureRequest(): _tanstack_react_query.UseMutationResult<{
723
+ external_id: string;
724
+ doc_ext_id: string | null;
725
+ version: number;
726
+ source_sha256: string;
727
+ status: components["schemas"]["SignatureRequestStatus"];
728
+ message?: string | null | undefined;
729
+ fields: {
730
+ id: string;
731
+ type: "signature" | "initials" | "date" | "name";
732
+ page: number;
733
+ x: number;
734
+ y: number;
735
+ width: number;
736
+ height: number;
737
+ signer: string;
738
+ required: boolean;
739
+ }[];
740
+ signers: {
741
+ user_ext_id: string;
742
+ name: string;
743
+ email?: string | null | undefined;
744
+ status: components["schemas"]["SignerStatus"];
745
+ signed_at?: string | null | undefined;
746
+ reference?: string | null | undefined;
747
+ fields: number;
748
+ }[];
749
+ created_by?: string | null | undefined;
750
+ created_at: string;
751
+ sent_at?: string | null | undefined;
752
+ completed_at?: string | null | undefined;
753
+ signed_version?: number | null | undefined;
754
+ stale: boolean;
755
+ }, Error, {
756
+ requestId: string;
757
+ reason?: string;
758
+ }, unknown>;
759
+ interface SignRequestVars {
760
+ request: SignatureRequest;
761
+ /** The PDF the signer was walked through (`GET /view?version=` of the request's version). */
762
+ pdfBlob: Blob;
763
+ email: string;
764
+ password: string;
765
+ adopted: AdoptedSignature;
766
+ /** The ids of the fields the signer applied: every required one of theirs. */
767
+ fields: string[];
768
+ }
769
+ /**
770
+ * Sign all of the signer's fields at once: the server prepares the statement, the browser checks
771
+ * it covers the PDF on screen under the wording the signer read, re-derives the Ed25519 key from
772
+ * the password and signs. Resolves with `completed` when this was the last signature.
773
+ */
774
+ declare function signSignatureRequest(client: DocumentToolsClient, deploymentDomain: string, { request, pdfBlob, email, password, adopted, fields }: SignRequestVars): Promise<SignRequestSignResponse>;
775
+ declare function useSignSignatureRequest(): _tanstack_react_query.UseMutationResult<{
776
+ request: components["schemas"]["SignatureRequestResponse"];
777
+ completed: boolean;
778
+ signed_version?: number | null;
779
+ }, Error, SignRequestVars, unknown>;
780
+ interface SignerCandidate {
781
+ externalId: string;
782
+ name: string;
783
+ email: string;
784
+ role: string;
785
+ }
786
+ /**
787
+ * The people in the active workspace who may sign: owners and collaborators (a guest cannot sign,
788
+ * and an agent never does). The first one listed is the current user when they are a member.
789
+ */
790
+ declare function useSignerCandidates(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SignerCandidate[]>, Error>;
791
+
792
+ export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, 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, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, 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, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useVoidSignatureRequest, versionsWithMarkup };
@@ -23,6 +23,8 @@ interface DocumentToolsUser {
23
23
  name: string;
24
24
  /** The sign-in email: signing re-derives the user's key from it and the password. */
25
25
  email?: string | null;
26
+ /** The user's id (usr-*): which fields of a signature request are theirs. */
27
+ externalId?: string | null;
26
28
  }
27
29
  /** What changed about a document, so the host can refresh its own lists and caches. */
28
30
  type DocumentChange =
@@ -537,4 +539,254 @@ type CopyMatch = {
537
539
  /** Compare a file with the signed PDF and its signed revisions. Hashed here; nothing is uploaded. */
538
540
  declare function matchSignedCopy(file: Blob, verification: Pick<SignatureVerification, 'document_sha256' | 'signatures'>): Promise<CopyMatch>;
539
541
 
540
- export { type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, type DocumentChange, DocumentFetchError, type DocumentFetchOptions, type DocumentToolsClient, type DocumentToolsEnvironment, type DocumentToolsNoticeKind, type DocumentToolsNoticeOptions, type DocumentToolsNotify, DocumentToolsProvider, type DocumentToolsProviderProps, type DocumentToolsUser, type DocumentUploadQuery, type DocumentUploadRequest, type FrozenCopySource, LEGACY_LAYER_PREFIX, type LegacyPrompt, MAX_MERGE_ATTEMPTS, type MarkupDocument, MarkupDownloadError, type MarkupSnapshot, type MarkupStore, MarkupStoreError, type MarkupStoreOptions, type OlderMarkupNote, PRODUCTIONS_FOLDER, type ProductionSource, type ProductionUpload, type ResolvedDocumentToolsEnvironment, SIGNED_LOCKED_REASON, SIGNED_UNCHANGED, type SignDocumentResponse, type SignDocumentVars, type SignatureAppearance, type SignatureRecord, type SignatureStatusResponse, type SignatureVerification, SignatureVerificationError, type SignerDetails, SigningError, type SigningErrorReason, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, downloadBlob, fetchDocumentFile, fetchDocumentPdf, fetchDocumentSignatures, fetchMarkupPdf, fetchProductionPdf, fetchSignatureVerification, forgetLegacyLayer, frozenCopyName, hasNoRendition, intentText, isLegibleSignatureBox, isPdfDocument, isSignatureReference, isSignedVersion, marksByVersion, matchSignedCopy, migrateLegacyLayer, openThreadsOf, productionDocumentName, productionFileName, productionFolder, productionIndexCsv, productionTitle, readLegacyLayer, redactionLogName, saveProductionFiles, sha256Hex, signDocument, toAppearance, uploadFrozenCopy, uploadQueryString, useDocumentMarkup, useDocumentSignatures, useDocumentTools, useIsOnline, useOptionalDocumentTools, useSignDocument, useSignatureVerification, versionsWithMarkup };
542
+ type SignatureField = components['schemas']['SignatureField'];
543
+ type SignatureFieldType = SignatureField['type'];
544
+ type SignatureRequest = components['schemas']['SignatureRequestResponse'];
545
+ type SignatureRequestSigner = components['schemas']['SignatureRequestSigner'];
546
+ type SuggestedSignatureField = components['schemas']['SuggestedSignatureField'];
547
+ type AdoptedSignature = components['schemas']['AdoptedSignature'];
548
+ type SignRequestSignResponse = components['schemas']['SignRequestSignResponse'];
549
+ /** Field types in the order the editor offers them. */
550
+ declare const SIGNATURE_FIELD_TYPES: readonly SignatureFieldType[];
551
+ declare const FIELD_TYPE_LABELS: Record<SignatureFieldType, string>;
552
+ /** Default size of a new field, as fractions of the page (the backend draws to fit the box). */
553
+ declare const DEFAULT_FIELD_SIZE: Record<SignatureFieldType, {
554
+ width: number;
555
+ height: number;
556
+ }>;
557
+ /** The fields carrying a signer's mark: every signer needs at least one to be sent the request. */
558
+ declare const MARK_FIELD_TYPES: readonly SignatureFieldType[];
559
+ /** A short unique id for a new field (the server only needs it unique within the request). */
560
+ declare function newFieldId(): string;
561
+ /** Initials from a name: "Olive M. Owner" -> "OMO". */
562
+ declare function initialsOf(name: string): string;
563
+ /** The fields a signer completes, in the order they are walked through: page, then top to bottom. */
564
+ declare function fieldsInSigningOrder(fields: SignatureField[], signer: string): SignatureField[];
565
+ /** Why a draft cannot be sent yet, or null when it can. Mirrors the server's checks. */
566
+ declare function sendBlocker(fields: SignatureField[]): string | null;
567
+ /**
568
+ * Suggested fields grouped by signature block; `assign` maps a block (`group`) to the signer its
569
+ * fields go to. Unassigned blocks are left out.
570
+ */
571
+ declare function fieldsFromSuggestions(suggestions: SuggestedSignatureField[], assign: Record<number, string | undefined>): SignatureField[];
572
+ declare function fetchDocumentSignatureRequests(client: DocumentToolsClient, documentId: string): Promise<SignatureRequest[]>;
573
+ /** A document's signature requests, newest first. */
574
+ declare function useDocumentSignatureRequests(documentId: string | null | undefined, enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
575
+ external_id: string;
576
+ doc_ext_id: string | null;
577
+ version: number;
578
+ source_sha256: string;
579
+ status: components["schemas"]["SignatureRequestStatus"];
580
+ message?: string | null;
581
+ fields: components["schemas"]["SignatureField"][];
582
+ signers: components["schemas"]["SignatureRequestSigner"][];
583
+ created_by?: string | null;
584
+ created_at: string;
585
+ sent_at?: string | null;
586
+ completed_at?: string | null;
587
+ signed_version?: number | null;
588
+ stale: boolean;
589
+ }[]>, Error>;
590
+ /** Requests in the active workspace still waiting for the current user's signature. */
591
+ declare function useSignatureRequestsAwaitingMe(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<{
592
+ external_id: string;
593
+ doc_ext_id: string | null;
594
+ version: number;
595
+ source_sha256: string;
596
+ status: components["schemas"]["SignatureRequestStatus"];
597
+ message?: string | null | undefined;
598
+ fields: {
599
+ id: string;
600
+ type: "signature" | "initials" | "date" | "name";
601
+ page: number;
602
+ x: number;
603
+ y: number;
604
+ width: number;
605
+ height: number;
606
+ signer: string;
607
+ required: boolean;
608
+ }[];
609
+ signers: {
610
+ user_ext_id: string;
611
+ name: string;
612
+ email?: string | null | undefined;
613
+ status: components["schemas"]["SignerStatus"];
614
+ signed_at?: string | null | undefined;
615
+ reference?: string | null | undefined;
616
+ fields: number;
617
+ }[];
618
+ created_by?: string | null | undefined;
619
+ created_at: string;
620
+ sent_at?: string | null | undefined;
621
+ completed_at?: string | null | undefined;
622
+ signed_version?: number | null | undefined;
623
+ stale: boolean;
624
+ }[]>, Error>;
625
+ declare function useSignatureRequest(requestId: string | null | undefined): _tanstack_react_query.UseQueryResult<NoInfer<{
626
+ external_id: string;
627
+ doc_ext_id: string | null;
628
+ version: number;
629
+ source_sha256: string;
630
+ status: components["schemas"]["SignatureRequestStatus"];
631
+ message?: string | null | undefined;
632
+ fields: {
633
+ id: string;
634
+ type: "signature" | "initials" | "date" | "name";
635
+ page: number;
636
+ x: number;
637
+ y: number;
638
+ width: number;
639
+ height: number;
640
+ signer: string;
641
+ required: boolean;
642
+ }[];
643
+ signers: {
644
+ user_ext_id: string;
645
+ name: string;
646
+ email?: string | null | undefined;
647
+ status: components["schemas"]["SignerStatus"];
648
+ signed_at?: string | null | undefined;
649
+ reference?: string | null | undefined;
650
+ fields: number;
651
+ }[];
652
+ created_by?: string | null | undefined;
653
+ created_at: string;
654
+ sent_at?: string | null | undefined;
655
+ completed_at?: string | null | undefined;
656
+ signed_version?: number | null | undefined;
657
+ stale: boolean;
658
+ }>, Error>;
659
+ declare function suggestSignatureFields(client: DocumentToolsClient, documentId: string, version?: number): Promise<SuggestedSignatureField[]>;
660
+ interface SaveSignatureRequestVars {
661
+ documentId: string;
662
+ /** The version the fields were placed on (the PDF shown). Omitted = current. */
663
+ version?: number;
664
+ fields: SignatureField[];
665
+ message?: string;
666
+ /** Existing draft to update instead of creating a new request. */
667
+ requestId?: string;
668
+ /** Send it to the signers (else it is saved as a draft). */
669
+ send: boolean;
670
+ }
671
+ declare function saveSignatureRequest(client: DocumentToolsClient, { documentId, version, fields, message, requestId, send }: SaveSignatureRequestVars): Promise<SignatureRequest>;
672
+ declare function useSaveSignatureRequest(): _tanstack_react_query.UseMutationResult<{
673
+ external_id: string;
674
+ doc_ext_id: string | null;
675
+ version: number;
676
+ source_sha256: string;
677
+ status: components["schemas"]["SignatureRequestStatus"];
678
+ message?: string | null;
679
+ fields: components["schemas"]["SignatureField"][];
680
+ signers: components["schemas"]["SignatureRequestSigner"][];
681
+ created_by?: string | null;
682
+ created_at: string;
683
+ sent_at?: string | null;
684
+ completed_at?: string | null;
685
+ signed_version?: number | null;
686
+ stale: boolean;
687
+ }, Error, SaveSignatureRequestVars, unknown>;
688
+ declare function useVoidSignatureRequest(): _tanstack_react_query.UseMutationResult<{
689
+ external_id: string;
690
+ doc_ext_id: string | null;
691
+ version: number;
692
+ source_sha256: string;
693
+ status: components["schemas"]["SignatureRequestStatus"];
694
+ message?: string | null | undefined;
695
+ fields: {
696
+ id: string;
697
+ type: "signature" | "initials" | "date" | "name";
698
+ page: number;
699
+ x: number;
700
+ y: number;
701
+ width: number;
702
+ height: number;
703
+ signer: string;
704
+ required: boolean;
705
+ }[];
706
+ signers: {
707
+ user_ext_id: string;
708
+ name: string;
709
+ email?: string | null | undefined;
710
+ status: components["schemas"]["SignerStatus"];
711
+ signed_at?: string | null | undefined;
712
+ reference?: string | null | undefined;
713
+ fields: number;
714
+ }[];
715
+ created_by?: string | null | undefined;
716
+ created_at: string;
717
+ sent_at?: string | null | undefined;
718
+ completed_at?: string | null | undefined;
719
+ signed_version?: number | null | undefined;
720
+ stale: boolean;
721
+ }, Error, string, unknown>;
722
+ declare function useDeclineSignatureRequest(): _tanstack_react_query.UseMutationResult<{
723
+ external_id: string;
724
+ doc_ext_id: string | null;
725
+ version: number;
726
+ source_sha256: string;
727
+ status: components["schemas"]["SignatureRequestStatus"];
728
+ message?: string | null | undefined;
729
+ fields: {
730
+ id: string;
731
+ type: "signature" | "initials" | "date" | "name";
732
+ page: number;
733
+ x: number;
734
+ y: number;
735
+ width: number;
736
+ height: number;
737
+ signer: string;
738
+ required: boolean;
739
+ }[];
740
+ signers: {
741
+ user_ext_id: string;
742
+ name: string;
743
+ email?: string | null | undefined;
744
+ status: components["schemas"]["SignerStatus"];
745
+ signed_at?: string | null | undefined;
746
+ reference?: string | null | undefined;
747
+ fields: number;
748
+ }[];
749
+ created_by?: string | null | undefined;
750
+ created_at: string;
751
+ sent_at?: string | null | undefined;
752
+ completed_at?: string | null | undefined;
753
+ signed_version?: number | null | undefined;
754
+ stale: boolean;
755
+ }, Error, {
756
+ requestId: string;
757
+ reason?: string;
758
+ }, unknown>;
759
+ interface SignRequestVars {
760
+ request: SignatureRequest;
761
+ /** The PDF the signer was walked through (`GET /view?version=` of the request's version). */
762
+ pdfBlob: Blob;
763
+ email: string;
764
+ password: string;
765
+ adopted: AdoptedSignature;
766
+ /** The ids of the fields the signer applied: every required one of theirs. */
767
+ fields: string[];
768
+ }
769
+ /**
770
+ * Sign all of the signer's fields at once: the server prepares the statement, the browser checks
771
+ * it covers the PDF on screen under the wording the signer read, re-derives the Ed25519 key from
772
+ * the password and signs. Resolves with `completed` when this was the last signature.
773
+ */
774
+ declare function signSignatureRequest(client: DocumentToolsClient, deploymentDomain: string, { request, pdfBlob, email, password, adopted, fields }: SignRequestVars): Promise<SignRequestSignResponse>;
775
+ declare function useSignSignatureRequest(): _tanstack_react_query.UseMutationResult<{
776
+ request: components["schemas"]["SignatureRequestResponse"];
777
+ completed: boolean;
778
+ signed_version?: number | null;
779
+ }, Error, SignRequestVars, unknown>;
780
+ interface SignerCandidate {
781
+ externalId: string;
782
+ name: string;
783
+ email: string;
784
+ role: string;
785
+ }
786
+ /**
787
+ * The people in the active workspace who may sign: owners and collaborators (a guest cannot sign,
788
+ * and an agent never does). The first one listed is the current user when they are a member.
789
+ */
790
+ declare function useSignerCandidates(enabled?: boolean): _tanstack_react_query.UseQueryResult<NoInfer<SignerCandidate[]>, Error>;
791
+
792
+ export { type AdoptedSignature, type AnnotatableState, type BuildProductionOptions, type BuiltProduction, type CopyMatch, DEFAULT_FIELD_SIZE, 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, VERIFY_PATH, type VerifiedSignature, type VersionInfo, addToMarkup, buildProduction, canAnnotate, certificateLink, clientUpload, copyOpenThreads, createMarkupStore, currentHasMarkup, defaultCertificateUrl, 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, useDocumentMarkup, useDocumentSignatureRequests, useDocumentSignatures, useDocumentTools, useIsOnline, useOptionalDocumentTools, useSaveSignatureRequest, useSignDocument, useSignSignatureRequest, useSignatureRequest, useSignatureRequestsAwaitingMe, useSignatureVerification, useSignerCandidates, useVoidSignatureRequest, versionsWithMarkup };