@signiphi/pdf-signer 0.2.0-beta.21 → 0.2.0-beta.22

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 (179) hide show
  1. package/dist/__tests__/helpers/fixtures.d.ts +43 -0
  2. package/dist/__tests__/helpers/fixtures.d.ts.map +1 -0
  3. package/dist/__tests__/helpers/mocks.d.ts +411 -0
  4. package/dist/__tests__/helpers/mocks.d.ts.map +1 -0
  5. package/dist/__tests__/setup.d.ts +6 -0
  6. package/dist/__tests__/setup.d.ts.map +1 -0
  7. package/dist/components/AcknowledgementModal.d.ts +21 -0
  8. package/dist/components/AcknowledgementModal.d.ts.map +1 -0
  9. package/dist/components/AcknowledgementsSidebar.d.ts +22 -0
  10. package/dist/components/AcknowledgementsSidebar.d.ts.map +1 -0
  11. package/dist/components/AttachmentUpload.d.ts +20 -0
  12. package/dist/components/AttachmentUpload.d.ts.map +1 -0
  13. package/dist/components/DateFieldCalendarPopup.d.ts +28 -0
  14. package/dist/components/DateFieldCalendarPopup.d.ts.map +1 -0
  15. package/dist/components/EditableFieldsPanel.d.ts +30 -0
  16. package/dist/components/EditableFieldsPanel.d.ts.map +1 -0
  17. package/dist/components/ErrorBoundary.d.ts +67 -0
  18. package/dist/components/ErrorBoundary.d.ts.map +1 -0
  19. package/dist/components/FormFieldsView.d.ts +46 -0
  20. package/dist/components/FormFieldsView.d.ts.map +1 -0
  21. package/dist/components/InitialsModal.d.ts +16 -0
  22. package/dist/components/InitialsModal.d.ts.map +1 -0
  23. package/dist/components/PdfViewerStyled.d.ts +16 -0
  24. package/dist/components/PdfViewerStyled.d.ts.map +1 -0
  25. package/dist/components/PoweredBySigniphi.d.ts +11 -0
  26. package/dist/components/PoweredBySigniphi.d.ts.map +1 -0
  27. package/dist/components/RequiredFieldNavigation.d.ts +18 -0
  28. package/dist/components/RequiredFieldNavigation.d.ts.map +1 -0
  29. package/dist/components/SignatureCanvas.d.ts +12 -0
  30. package/dist/components/SignatureCanvas.d.ts.map +1 -0
  31. package/dist/components/SignatureInitialsBox.d.ts +25 -0
  32. package/dist/components/SignatureInitialsBox.d.ts.map +1 -0
  33. package/dist/components/SignatureModal.d.ts +21 -0
  34. package/dist/components/SignatureModal.d.ts.map +1 -0
  35. package/dist/components/SignatureTypeInput.d.ts +27 -0
  36. package/dist/components/SignatureTypeInput.d.ts.map +1 -0
  37. package/dist/components/SigningInstructions.d.ts +12 -0
  38. package/dist/components/SigningInstructions.d.ts.map +1 -0
  39. package/dist/components/SubmissionForm.d.ts +52 -0
  40. package/dist/components/SubmissionForm.d.ts.map +1 -0
  41. package/dist/components/UnacknowledgedFieldsModal.d.ts +25 -0
  42. package/dist/components/UnacknowledgedFieldsModal.d.ts.map +1 -0
  43. package/dist/components/ViewToggleToolbar.d.ts +38 -0
  44. package/dist/components/ViewToggleToolbar.d.ts.map +1 -0
  45. package/dist/components/form-fields/CheckboxRenderer.d.ts +10 -0
  46. package/dist/components/form-fields/CheckboxRenderer.d.ts.map +1 -0
  47. package/dist/components/form-fields/DateFieldRenderer.d.ts +14 -0
  48. package/dist/components/form-fields/DateFieldRenderer.d.ts.map +1 -0
  49. package/dist/components/form-fields/DropdownRenderer.d.ts +14 -0
  50. package/dist/components/form-fields/DropdownRenderer.d.ts.map +1 -0
  51. package/dist/components/form-fields/FormFieldRenderer.d.ts +22 -0
  52. package/dist/components/form-fields/FormFieldRenderer.d.ts.map +1 -0
  53. package/dist/components/form-fields/InitialsFieldRenderer.d.ts +16 -0
  54. package/dist/components/form-fields/InitialsFieldRenderer.d.ts.map +1 -0
  55. package/dist/components/form-fields/RadioGroupRenderer.d.ts +10 -0
  56. package/dist/components/form-fields/RadioGroupRenderer.d.ts.map +1 -0
  57. package/dist/components/form-fields/SignatureFieldRenderer.d.ts +16 -0
  58. package/dist/components/form-fields/SignatureFieldRenderer.d.ts.map +1 -0
  59. package/dist/components/form-fields/TextFieldRenderer.d.ts +14 -0
  60. package/dist/components/form-fields/TextFieldRenderer.d.ts.map +1 -0
  61. package/dist/components/form-fields/TextLabelRenderer.d.ts +14 -0
  62. package/dist/components/form-fields/TextLabelRenderer.d.ts.map +1 -0
  63. package/dist/components/form-fields/index.d.ts +14 -0
  64. package/dist/components/form-fields/index.d.ts.map +1 -0
  65. package/dist/components/index.d.ts +18 -0
  66. package/dist/components/index.d.ts.map +1 -0
  67. package/dist/core/PdfViewerCore.d.ts +19 -0
  68. package/dist/core/PdfViewerCore.d.ts.map +1 -0
  69. package/dist/core/SignatureCaptureCore.d.ts +37 -0
  70. package/dist/core/SignatureCaptureCore.d.ts.map +1 -0
  71. package/dist/core/index.d.ts +3 -0
  72. package/dist/core/index.d.ts.map +1 -0
  73. package/dist/hooks/index.d.ts +9 -0
  74. package/dist/hooks/index.d.ts.map +1 -0
  75. package/dist/hooks/useAcknowledgements.d.ts +50 -0
  76. package/dist/hooks/useAcknowledgements.d.ts.map +1 -0
  77. package/dist/hooks/useAttachments.d.ts +26 -0
  78. package/dist/hooks/useAttachments.d.ts.map +1 -0
  79. package/dist/hooks/useFieldFiltering.d.ts +29 -0
  80. package/dist/hooks/useFieldFiltering.d.ts.map +1 -0
  81. package/dist/hooks/useFormFields.d.ts +23 -0
  82. package/dist/hooks/useFormFields.d.ts.map +1 -0
  83. package/dist/hooks/useMultiSignerContext.d.ts +25 -0
  84. package/dist/hooks/useMultiSignerContext.d.ts.map +1 -0
  85. package/dist/hooks/usePdfViewer.d.ts +52 -0
  86. package/dist/hooks/usePdfViewer.d.ts.map +1 -0
  87. package/dist/hooks/useRequiredFieldNavigation.d.ts +16 -0
  88. package/dist/hooks/useRequiredFieldNavigation.d.ts.map +1 -0
  89. package/dist/hooks/useSignatureCapture.d.ts +17 -0
  90. package/dist/hooks/useSignatureCapture.d.ts.map +1 -0
  91. package/dist/hooks/useSignatures.d.ts +29 -0
  92. package/dist/hooks/useSignatures.d.ts.map +1 -0
  93. package/dist/index.d.ts +17 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/integrations/index.d.ts +6 -0
  96. package/dist/integrations/index.d.ts.map +1 -0
  97. package/dist/integrations/next-config.d.ts +46 -0
  98. package/dist/integrations/next-config.d.ts.map +1 -0
  99. package/dist/integrations/vite-plugin.d.ts +48 -0
  100. package/dist/integrations/vite-plugin.d.ts.map +1 -0
  101. package/dist/lib/index.d.ts +3 -0
  102. package/dist/lib/index.d.ts.map +1 -0
  103. package/dist/lib/ui/accordion.d.ts +8 -0
  104. package/dist/lib/ui/accordion.d.ts.map +1 -0
  105. package/dist/lib/ui/alert.d.ts +9 -0
  106. package/dist/lib/ui/alert.d.ts.map +1 -0
  107. package/dist/lib/ui/button.d.ts +12 -0
  108. package/dist/lib/ui/button.d.ts.map +1 -0
  109. package/dist/lib/ui/calendar.d.ts +10 -0
  110. package/dist/lib/ui/calendar.d.ts.map +1 -0
  111. package/dist/lib/ui/card.d.ts +9 -0
  112. package/dist/lib/ui/card.d.ts.map +1 -0
  113. package/dist/lib/ui/checkbox.d.ts +5 -0
  114. package/dist/lib/ui/checkbox.d.ts.map +1 -0
  115. package/dist/lib/ui/dialog.d.ts +20 -0
  116. package/dist/lib/ui/dialog.d.ts.map +1 -0
  117. package/dist/lib/ui/index.d.ts +13 -0
  118. package/dist/lib/ui/index.d.ts.map +1 -0
  119. package/dist/lib/ui/input.d.ts +6 -0
  120. package/dist/lib/ui/input.d.ts.map +1 -0
  121. package/dist/lib/ui/label.d.ts +6 -0
  122. package/dist/lib/ui/label.d.ts.map +1 -0
  123. package/dist/lib/ui/popover.d.ts +7 -0
  124. package/dist/lib/ui/popover.d.ts.map +1 -0
  125. package/dist/lib/ui/radio-group.d.ts +6 -0
  126. package/dist/lib/ui/radio-group.d.ts.map +1 -0
  127. package/dist/lib/ui/select.d.ts +14 -0
  128. package/dist/lib/ui/select.d.ts.map +1 -0
  129. package/dist/lib/utils.d.ts +7 -0
  130. package/dist/lib/utils.d.ts.map +1 -0
  131. package/dist/types/index.d.ts +299 -0
  132. package/dist/types/index.d.ts.map +1 -0
  133. package/dist/utils/attachment-validators.d.ts +118 -0
  134. package/dist/utils/attachment-validators.d.ts.map +1 -0
  135. package/dist/utils/audit-trail.d.ts +27 -0
  136. package/dist/utils/audit-trail.d.ts.map +1 -0
  137. package/dist/utils/date-validation-iso.d.ts +11 -0
  138. package/dist/utils/date-validation-iso.d.ts.map +1 -0
  139. package/dist/utils/date-validation.d.ts +27 -0
  140. package/dist/utils/date-validation.d.ts.map +1 -0
  141. package/dist/utils/errors.d.ts +106 -0
  142. package/dist/utils/errors.d.ts.map +1 -0
  143. package/dist/utils/field-extraction.d.ts +59 -0
  144. package/dist/utils/field-extraction.d.ts.map +1 -0
  145. package/dist/utils/field-visibility.d.ts +108 -0
  146. package/dist/utils/field-visibility.d.ts.map +1 -0
  147. package/dist/utils/font-loader.d.ts +50 -0
  148. package/dist/utils/font-loader.d.ts.map +1 -0
  149. package/dist/utils/index.d.ts +20 -0
  150. package/dist/utils/index.d.ts.map +1 -0
  151. package/dist/utils/logger.d.ts +16 -0
  152. package/dist/utils/logger.d.ts.map +1 -0
  153. package/dist/utils/pdf-field-type-helpers.d.ts +87 -0
  154. package/dist/utils/pdf-field-type-helpers.d.ts.map +1 -0
  155. package/dist/utils/pdf-helpers.d.ts +38 -0
  156. package/dist/utils/pdf-helpers.d.ts.map +1 -0
  157. package/dist/utils/pdf-lib-loader.d.ts +45 -0
  158. package/dist/utils/pdf-lib-loader.d.ts.map +1 -0
  159. package/dist/utils/pdf-manipulation.d.ts +94 -0
  160. package/dist/utils/pdf-manipulation.d.ts.map +1 -0
  161. package/dist/utils/pdf-metadata.d.ts +44 -0
  162. package/dist/utils/pdf-metadata.d.ts.map +1 -0
  163. package/dist/utils/pdf-signer-utils.d.ts +35 -0
  164. package/dist/utils/pdf-signer-utils.d.ts.map +1 -0
  165. package/dist/utils/pdf-validators.d.ts +184 -0
  166. package/dist/utils/pdf-validators.d.ts.map +1 -0
  167. package/dist/utils/pdf-viewer-filter.d.ts +35 -0
  168. package/dist/utils/pdf-viewer-filter.d.ts.map +1 -0
  169. package/dist/utils/pdf-widget-helpers.d.ts +98 -0
  170. package/dist/utils/pdf-widget-helpers.d.ts.map +1 -0
  171. package/dist/utils/pdfjs-config.d.ts +56 -0
  172. package/dist/utils/pdfjs-config.d.ts.map +1 -0
  173. package/dist/utils/pdfjs-version-check.d.ts +28 -0
  174. package/dist/utils/pdfjs-version-check.d.ts.map +1 -0
  175. package/dist/utils/performance-monitor.d.ts +172 -0
  176. package/dist/utils/performance-monitor.d.ts.map +1 -0
  177. package/dist/utils/tracking.d.ts +89 -0
  178. package/dist/utils/tracking.d.ts.map +1 -0
  179. package/package.json +2 -2
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Audit Trail Utilities
3
+ * Captures device metadata, IP address, and geolocation for compliance and forensics
4
+ */
5
+ import type { AuditTrailMetadata } from '../types';
6
+ /**
7
+ * Synchronously capture device and browser metadata
8
+ */
9
+ export declare function captureDeviceMetadata(): Partial<AuditTrailMetadata>;
10
+ /**
11
+ * Capture IP address using public API
12
+ */
13
+ export declare function captureIpAddress(): Promise<string>;
14
+ /**
15
+ * Capture geolocation using browser geolocation API
16
+ */
17
+ export declare function captureGeolocation(): Promise<{
18
+ latitude: number;
19
+ longitude: number;
20
+ accuracy?: number;
21
+ } | null>;
22
+ /**
23
+ * Capture complete audit trail metadata
24
+ * Combines device metadata, IP address, and geolocation
25
+ */
26
+ export declare function captureAuditTrail(): Promise<AuditTrailMetadata>;
27
+ //# sourceMappingURL=audit-trail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-trail.d.ts","sourceRoot":"","sources":["../../src/utils/audit-trail.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAsCnE;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAuBxD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,IAAI,CAAC,CAiCR;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAgCrE"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ISO Date Validation Utility
3
+ * Lightweight validation for ISO 8601 date strings (YYYY-MM-DD)
4
+ * Separated from full date-validation to avoid pulling in the heavier `parse` dependency
5
+ * from date-fns when only ISO validation is needed.
6
+ */
7
+ /**
8
+ * Validate if a string is a valid ISO date (YYYY-MM-DD)
9
+ */
10
+ export declare function isValidISODate(value: string | null | undefined): boolean;
11
+ //# sourceMappingURL=date-validation-iso.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-validation-iso.d.ts","sourceRoot":"","sources":["../../src/utils/date-validation-iso.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAgBxE"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Date Validation and Parsing Utility
3
+ * Handles parsing of various date formats and validation
4
+ */
5
+ export { isValidISODate } from './date-validation-iso';
6
+ export interface DateValidationResult {
7
+ isValid: boolean;
8
+ date: Date | null;
9
+ isoString: string | null;
10
+ originalValue: string;
11
+ error?: string;
12
+ }
13
+ /**
14
+ * Parse and validate a date string from various formats
15
+ * Attempts to parse common formats: ISO, US, EU, timestamps
16
+ *
17
+ * Format priority:
18
+ * 1. ISO 8601 (YYYY-MM-DD)
19
+ * 2. US format (MM/DD/YYYY) - assumes US format for ambiguous dates
20
+ * 3. EU format (DD/MM/YYYY)
21
+ * 4. Timestamp (numeric string)
22
+ *
23
+ * @param value - The date string to parse
24
+ * @returns Validation result with parsed date or error
25
+ */
26
+ export declare function parseAndValidateDate(value: string | null | undefined): DateValidationResult;
27
+ //# sourceMappingURL=date-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-validation.d.ts","sourceRoot":"","sources":["../../src/utils/date-validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,oBAAoB,CAoJ3F"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Custom Error Classes
3
+ * Domain-specific error types for better error handling and debugging
4
+ */
5
+ /**
6
+ * Error thrown when PDF validation fails
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const validation = validatePdfBytes(bytes);
11
+ * if (!validation.valid) {
12
+ * throw new PdfValidationError(validation.error || 'Invalid PDF');
13
+ * }
14
+ * ```
15
+ */
16
+ export declare class PdfValidationError extends Error {
17
+ readonly details?: unknown | undefined;
18
+ constructor(message: string, details?: unknown | undefined);
19
+ }
20
+ /**
21
+ * Error thrown during PDF processing operations
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * try {
26
+ * const pdfDoc = await PDFDocument.load(bytes);
27
+ * } catch (err) {
28
+ * throw new PdfProcessingError('Failed to load PDF document', err);
29
+ * }
30
+ * ```
31
+ */
32
+ export declare class PdfProcessingError extends Error {
33
+ readonly details?: unknown | undefined;
34
+ constructor(message: string, details?: unknown | undefined);
35
+ }
36
+ /**
37
+ * Error thrown for form field related issues
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * if (!field.value && field.required) {
42
+ * throw new FormFieldError(
43
+ * 'Required field is empty',
44
+ * field.name
45
+ * );
46
+ * }
47
+ * ```
48
+ */
49
+ export declare class FormFieldError extends Error {
50
+ readonly fieldName?: string | undefined;
51
+ readonly details?: unknown | undefined;
52
+ constructor(message: string, fieldName?: string | undefined, details?: unknown | undefined);
53
+ }
54
+ /**
55
+ * Error thrown for attachment validation failures
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * if (file.size > maxFileSize) {
60
+ * throw new AttachmentValidationError(
61
+ * `File size exceeds limit: ${file.name}`,
62
+ * file.name
63
+ * );
64
+ * }
65
+ * ```
66
+ */
67
+ export declare class AttachmentValidationError extends Error {
68
+ readonly fileName?: string | undefined;
69
+ readonly details?: unknown | undefined;
70
+ constructor(message: string, fileName?: string | undefined, details?: unknown | undefined);
71
+ }
72
+ /**
73
+ * Type guard to check if an error is a PdfValidationError
74
+ */
75
+ export declare function isPdfValidationError(error: unknown): error is PdfValidationError;
76
+ /**
77
+ * Type guard to check if an error is a PdfProcessingError
78
+ */
79
+ export declare function isPdfProcessingError(error: unknown): error is PdfProcessingError;
80
+ /**
81
+ * Type guard to check if an error is a FormFieldError
82
+ */
83
+ export declare function isFormFieldError(error: unknown): error is FormFieldError;
84
+ /**
85
+ * Type guard to check if an error is an AttachmentValidationError
86
+ */
87
+ export declare function isAttachmentValidationError(error: unknown): error is AttachmentValidationError;
88
+ /**
89
+ * Extract error message from unknown error type
90
+ *
91
+ * @param error - The error to extract message from
92
+ * @param defaultMessage - Default message if extraction fails
93
+ * @returns Error message string
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * try {
98
+ * // ... operation
99
+ * } catch (err) {
100
+ * const message = getErrorMessage(err, 'Operation failed');
101
+ * logger.error(message);
102
+ * }
103
+ * ```
104
+ */
105
+ export declare function getErrorMessage(error: unknown, defaultMessage?: string): string;
106
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;aAGzB,OAAO,CAAC,EAAE,OAAO;gBADjC,OAAO,EAAE,MAAM,EACC,OAAO,CAAC,EAAE,OAAO,YAAA;CASpC;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;aAGzB,OAAO,CAAC,EAAE,OAAO;gBADjC,OAAO,EAAE,MAAM,EACC,OAAO,CAAC,EAAE,OAAO,YAAA;CAQpC;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAe,SAAQ,KAAK;aAGrB,SAAS,CAAC,EAAE,MAAM;aAClB,OAAO,CAAC,EAAE,OAAO;gBAFjC,OAAO,EAAE,MAAM,EACC,SAAS,CAAC,EAAE,MAAM,YAAA,EAClB,OAAO,CAAC,EAAE,OAAO,YAAA;CAQpC;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;aAGhC,QAAQ,CAAC,EAAE,MAAM;aACjB,OAAO,CAAC,EAAE,OAAO;gBAFjC,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA,EACjB,OAAO,CAAC,EAAE,OAAO,YAAA;CAQpC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,yBAAyB,CAE9F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,SAAkB,GAAG,MAAM,CAQxF"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * PDF Form Field Extraction Utilities
3
+ * Functions for extracting and decoding form fields from PDFs
4
+ */
5
+ import { EsignFormField, FormFieldType } from '../types';
6
+ /**
7
+ * Extract visible form fields from a PDF document
8
+ * @param pdfBytes - The PDF bytes to extract fields from
9
+ * @param currentSignerEmail - Optional email of the current signer (for multi-signer filtering)
10
+ * @returns Array of extracted form fields
11
+ */
12
+ export declare function extractVisibleFormFields(pdfBytes: Uint8Array, currentSignerEmail?: string): Promise<EsignFormField[]>;
13
+ /**
14
+ * Decode a field name to extract label, signer email, and placeholder
15
+ * Format: fieldName__LABEL__labelText__SIGNER__email__PLACEHOLDER__placeholderText
16
+ *
17
+ * @deprecated This function is deprecated and kept only for backward compatibility with old PDFs.
18
+ * New PDFs store metadata in the PDF's document information dictionary instead of encoding it in field names.
19
+ * Use getSigniphiMetadata() for new PDFs.
20
+ */
21
+ export declare function decodeFieldName(fieldName: string): {
22
+ decodedFieldName: string;
23
+ displayLabel: string;
24
+ assignedSignerEmail?: string;
25
+ fieldPlaceholder: string;
26
+ acknowledgements?: Array<{
27
+ id: string;
28
+ title: string;
29
+ description: string;
30
+ }>;
31
+ };
32
+ /**
33
+ * Generate a fallback label from a decoded field name
34
+ */
35
+ export declare function generateFallbackLabel(decodedFieldName: string, fieldType: FormFieldType): string;
36
+ /**
37
+ * Find field by UUID using the fieldIdIndex
38
+ * This is the SECURE way to lookup fields in multi-signer workflows
39
+ * @param fields - Array of fields to search
40
+ * @param uuid - The UUID to find
41
+ * @returns The field or undefined
42
+ */
43
+ export declare function findFieldByUuid(fields: EsignFormField[], uuid: string): EsignFormField | undefined;
44
+ /**
45
+ * Resolve a field name or UUID to the actual field
46
+ * Priority: UUID lookup first (secure), then field name fallback
47
+ * @param fields - Array of fields
48
+ * @param identifier - Either a UUID or field name
49
+ * @returns The field or undefined
50
+ */
51
+ export declare function resolveField(fields: EsignFormField[], identifier: string): EsignFormField | undefined;
52
+ /**
53
+ * Get all fields assigned to a specific signer by UUID
54
+ * @param fields - Array of fields
55
+ * @param signerEmail - Email of the signer
56
+ * @returns Array of field UUIDs assigned to this signer
57
+ */
58
+ export declare function getFieldUuidsForSigner(fields: EsignFormField[], signerEmail: string): string[];
59
+ //# sourceMappingURL=field-extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-extraction.d.ts","sourceRoot":"","sources":["../../src/utils/field-extraction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyBzD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,UAAU,EACpB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,cAAc,EAAE,CAAC,CA2N3B;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CAC5E,CAmFA;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAyChG;AAwCD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAElG;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAsBrG;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAI9F"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Field Visibility Utilities
3
+ * Core logic for determining which fields are visible/editable in multi-signer mode
4
+ *
5
+ * XIGNIPHI MODEL: All signers are equal - no primary/secondary hierarchy
6
+ * Signers are ordered by signOrder for sequential signing only
7
+ *
8
+ * CRITICAL: This logic must work identically in both flows:
9
+ * - Single-signer flow: isMultiSigner = false, all fields visible
10
+ * - Multi-signer flow: isMultiSigner = true, filtered by assignment rules
11
+ */
12
+ import type { EsignFormField, MultiSignerContext } from '../types';
13
+ /**
14
+ * Determine if a field should be visible to the current signer
15
+ *
16
+ * Implements signiphi's simple 4-rule visibility logic:
17
+ * - Rule 1: Unassigned fields → visible to all signers
18
+ * - Rule 2: Direct assignment → show if assigned to current signer
19
+ * - Rule 3: Grouped assignments ("to-recipients", "additional-signers") → visible to all signers
20
+ * - Rule 4: Assigned to different specific signer → hide
21
+ *
22
+ * @param field - The form field to check
23
+ * @param multiSignerContext - Multi-signer context with current signer info
24
+ * @returns true if field should be visible, false if hidden
25
+ *
26
+ * @example Single-signer flow
27
+ * ```ts
28
+ * const context = { isMultiSigner: false, ... };
29
+ * isFieldVisibleToSigner(anyField, context); // always returns true
30
+ * ```
31
+ *
32
+ * @example Multi-signer flow
33
+ * ```ts
34
+ * const context = {
35
+ * isMultiSigner: true,
36
+ * currentSignerEmail: 'signer1@example.com',
37
+ * isPrimarySigner: false, // Not used in signiphi
38
+ * isFinalSigner: false // Not used in signiphi
39
+ * };
40
+ *
41
+ * // Unassigned field - all signers see it
42
+ * isFieldVisibleToSigner({ assignedSignerEmail: undefined, ... }, context); // true
43
+ *
44
+ * // Direct assignment to current signer
45
+ * isFieldVisibleToSigner({ assignedSignerEmail: 'signer1@example.com', ... }, context); // true
46
+ *
47
+ * // Grouped assignment - all signers see it
48
+ * isFieldVisibleToSigner({ assignedSignerEmail: 'to-recipients', ... }, context); // true
49
+ * ```
50
+ */
51
+ export declare function isFieldVisibleToSigner(field: EsignFormField, multiSignerContext: MultiSignerContext): boolean;
52
+ /**
53
+ * Filter an array of fields to only those visible to the current signer
54
+ *
55
+ * @param fields - All form fields
56
+ * @param multiSignerContext - Multi-signer context
57
+ * @returns Filtered array of visible fields
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const allFields = [...]; // 10 fields
62
+ * const context = { isMultiSigner: true, isPrimarySigner: true, ... };
63
+ * const visible = filterFieldsBySigner(allFields, context); // 5 fields (only primary signer's)
64
+ * ```
65
+ */
66
+ export declare function filterFieldsBySigner(fields: EsignFormField[], multiSignerContext: MultiSignerContext): EsignFormField[];
67
+ /**
68
+ * Determine if a field should be flattened (made non-editable) by the current signer
69
+ *
70
+ * Used during PDF submission to determine which fields to flatten.
71
+ * In multi-signer mode, only flatten fields assigned to current signer.
72
+ * In single-signer mode, flatten all fields.
73
+ *
74
+ * XIGNIPHI MODEL: Flatten fields visible/assigned to current signer
75
+ *
76
+ * CRITICAL: This affects PDF flattening behavior - must preserve exact logic!
77
+ *
78
+ * @param field - The form field to check
79
+ * @param multiSignerContext - Multi-signer context
80
+ * @returns true if current signer should flatten this field
81
+ *
82
+ * @example Single-signer flow
83
+ * ```ts
84
+ * const context = { isMultiSigner: false, ... };
85
+ * shouldFlattenField(anyField, context); // always returns true
86
+ * ```
87
+ *
88
+ * @example Multi-signer flow
89
+ * ```ts
90
+ * const context = {
91
+ * isMultiSigner: true,
92
+ * currentSignerEmail: 'signer1@example.com',
93
+ * isPrimarySigner: false, // Not used in signiphi
94
+ * isFinalSigner: false // Not used in signiphi
95
+ * };
96
+ *
97
+ * // Current signer's field - flatten it
98
+ * shouldFlattenField({ assignedSignerEmail: 'signer1@example.com', ... }, context); // true
99
+ *
100
+ * // Different signer's field - don't flatten (keep editable for them)
101
+ * shouldFlattenField({ assignedSignerEmail: 'signer2@example.com', ... }, context); // false
102
+ *
103
+ * // Unassigned field - all signers flatten (visible to all)
104
+ * shouldFlattenField({ assignedSignerEmail: undefined, ... }, context); // true
105
+ * ```
106
+ */
107
+ export declare function shouldFlattenField(field: EsignFormField, multiSignerContext: MultiSignerContext): boolean;
108
+ //# sourceMappingURL=field-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-visibility.d.ts","sourceRoot":"","sources":["../../src/utils/field-visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,cAAc,EACrB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CA4BT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,cAAc,EAAE,EACxB,kBAAkB,EAAE,kBAAkB,GACrC,cAAc,EAAE,CAQlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CA0BT"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Font loading and text-to-signature generation utilities
3
+ * Uses Google Fonts for cursive/handwritten signature styles
4
+ */
5
+ export interface SignatureFont {
6
+ name: string;
7
+ family: string;
8
+ label: string;
9
+ }
10
+ /**
11
+ * Available signature fonts from Google Fonts
12
+ */
13
+ export declare const SIGNATURE_FONTS: SignatureFont[];
14
+ /**
15
+ * Default font to use
16
+ */
17
+ export declare const DEFAULT_SIGNATURE_FONT: SignatureFont;
18
+ /**
19
+ * Load all signature fonts from Google Fonts
20
+ * This function is idempotent - it will only load fonts once
21
+ */
22
+ export declare function loadSignatureFonts(): Promise<void>;
23
+ /**
24
+ * Check if a specific font is available/loaded
25
+ */
26
+ export declare function isFontLoaded(fontFamily: string): boolean;
27
+ /**
28
+ * Wait for a specific font to be ready
29
+ */
30
+ export declare function waitForFont(fontFamily: string): Promise<boolean>;
31
+ export interface GenerateSignatureOptions {
32
+ text: string;
33
+ fontFamily: string;
34
+ width?: number;
35
+ height?: number;
36
+ fontSize?: number;
37
+ color?: string;
38
+ backgroundColor?: string | null;
39
+ }
40
+ /**
41
+ * Generate a signature image from text using a canvas
42
+ * @returns PNG data URL (data:image/png;base64,...)
43
+ */
44
+ export declare function generateSignatureFromText(options: GenerateSignatureOptions): string;
45
+ /**
46
+ * Generate signature with automatic font loading
47
+ * Ensures the font is loaded before rendering
48
+ */
49
+ export declare function generateSignatureFromTextAsync(options: GenerateSignatureOptions): Promise<string>;
50
+ //# sourceMappingURL=font-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font-loader.d.ts","sourceRoot":"","sources":["../../src/utils/font-loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EAM1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAIpC,CAAC;AAWF;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAsCxD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAMxD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAWtE;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,wBAAwB,GAChC,MAAM,CAkDR;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAQjB"}
@@ -0,0 +1,20 @@
1
+ export * from './pdf-helpers';
2
+ export * from './pdf-metadata';
3
+ export * from './font-loader';
4
+ export * from './pdf-manipulation';
5
+ export * from './pdf-signer-utils';
6
+ export * from './field-extraction';
7
+ export * from './pdfjs-config';
8
+ export * from './pdfjs-version-check';
9
+ export * from './audit-trail';
10
+ export * from './pdf-validators';
11
+ export * from './field-visibility';
12
+ export * from './pdf-widget-helpers';
13
+ export * from './pdf-field-type-helpers';
14
+ export * from './errors';
15
+ export * from './attachment-validators';
16
+ export { logger } from './logger';
17
+ export * from './performance-monitor';
18
+ export * from './date-validation';
19
+ export * from './tracking';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Logger Utility
3
+ * Centralized logging system with environment-based log level control
4
+ */
5
+ interface Logger {
6
+ debug(message: string, ...args: unknown[]): void;
7
+ info(message: string, ...args: unknown[]): void;
8
+ warn(message: string, ...args: unknown[]): void;
9
+ error(message: string, ...args: unknown[]): void;
10
+ }
11
+ /**
12
+ * Singleton logger instance
13
+ */
14
+ export declare const logger: Logger;
15
+ export {};
16
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,UAAU,MAAM;IACd,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAClD;AAgDD;;GAEG;AACH,eAAO,MAAM,MAAM,QAAiB,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * PDF Field Type Helper Utilities
3
+ * Common utilities for detecting field types and extracting values
4
+ *
5
+ * Used across pdf-manipulation.ts for consistent field processing
6
+ *
7
+ * IMPORTANT: Uses duck typing (method detection) instead of constructor.name
8
+ * to ensure minification-safe field type detection. Constructor names are
9
+ * renamed during minification, breaking string comparisons.
10
+ */
11
+ /**
12
+ * PDF form field type for operations
13
+ */
14
+ interface PDFFormField {
15
+ getName(): string;
16
+ getText?(): string;
17
+ setText?(text: string): void;
18
+ isRequired?(): boolean;
19
+ isChecked?(): boolean;
20
+ check?(): void;
21
+ uncheck?(): void;
22
+ getSelected?(): string[];
23
+ getOptions?(): string[];
24
+ select?(value: string): void;
25
+ setOptions?(options: string[]): void;
26
+ addOptions?(options: string[]): void;
27
+ enableReadOnly?(): void;
28
+ }
29
+ /**
30
+ * Detect the field type from a PDF field using duck typing
31
+ *
32
+ * Uses method presence detection instead of constructor.name to ensure
33
+ * minification-safe field type detection. Each pdf-lib field type has
34
+ * unique methods that can be used to identify it.
35
+ *
36
+ * @param field - The PDF form field
37
+ * @returns Standardized field type string
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const fieldType = detectFieldType(field);
42
+ * // Returns: 'text', 'checkbox', 'dropdown', 'radiogroup', 'signature', etc.
43
+ * ```
44
+ */
45
+ export declare function detectFieldType(field: PDFFormField): string;
46
+ /**
47
+ * Extract the current value from a PDF field based on its type
48
+ *
49
+ * Handles different field types appropriately:
50
+ * - Text fields: getText()
51
+ * - Checkboxes: isChecked() → 'true'/'false'
52
+ * - Dropdowns: getSelected()[0]
53
+ * - Radio groups: getSelected()[0]
54
+ *
55
+ * @param field - The PDF form field
56
+ * @param fieldType - The field type (from detectFieldType)
57
+ * @returns The field value as a string, or empty string if no value
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const fieldType = detectFieldType(field);
62
+ * const value = extractFieldValue(field, fieldType);
63
+ * ```
64
+ */
65
+ export declare function extractFieldValue(field: PDFFormField, fieldType: string): string;
66
+ /**
67
+ * Check if a field is required based on field metadata and name patterns
68
+ *
69
+ * Attempts to determine required status through:
70
+ * 1. field.isRequired() method (if available)
71
+ * 2. Field name patterns (signature, initials, required)
72
+ * 3. Field type (signatures are always required)
73
+ *
74
+ * @param field - The PDF form field
75
+ * @param fieldName - The field name
76
+ * @param fieldType - The field type (from detectFieldType)
77
+ * @returns true if field is required
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const isRequired = isRequiredField(field, 'signature_1', 'text');
82
+ * // Returns: true (signature fields are required)
83
+ * ```
84
+ */
85
+ export declare function isRequiredField(field: PDFFormField, fieldName: string, fieldType: string): boolean;
86
+ export {};
87
+ //# sourceMappingURL=pdf-field-type-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-field-type-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/pdf-field-type-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,UAAU,YAAY;IACpB,OAAO,IAAI,MAAM,CAAC;IAClB,OAAO,CAAC,IAAI,MAAM,CAAC;IACnB,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,IAAI,OAAO,CAAC;IACvB,SAAS,CAAC,IAAI,OAAO,CAAC;IACtB,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB,WAAW,CAAC,IAAI,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,IAAI,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,UAAU,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,cAAc,CAAC,IAAI,IAAI,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA4C3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA8BhF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAyBT"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * PDF utility helper functions
3
+ */
4
+ /**
5
+ * Create a blob URL from PDF bytes for preview
6
+ */
7
+ export declare function createPdfBlobUrl(pdfBytes: Uint8Array): string;
8
+ /**
9
+ * Download PDF file
10
+ */
11
+ export declare function downloadPdf(pdfBytes: Uint8Array, filename: string): void;
12
+ /**
13
+ * Convert URL to PDF bytes
14
+ * @param url - The URL to fetch the PDF from
15
+ * @returns PDF bytes as Uint8Array
16
+ */
17
+ export declare function urlToPdfBytes(url: string): Promise<Uint8Array>;
18
+ /**
19
+ * Validate that data is a valid PDF
20
+ */
21
+ export declare function isValidPdf(pdfBytes: Uint8Array): boolean;
22
+ /**
23
+ * Convert base64 data URL to image bytes
24
+ */
25
+ export declare function dataUrlToBytes(dataUrl: string): Uint8Array;
26
+ /**
27
+ * Format field name for display
28
+ */
29
+ export declare function formatFieldName(fieldName: string): string;
30
+ /**
31
+ * Check if a field is a signature field
32
+ */
33
+ export declare function isSignatureField(fieldName: string): boolean;
34
+ /**
35
+ * Check if a field is an initials field
36
+ */
37
+ export declare function isInitialsField(fieldName: string): boolean;
38
+ //# sourceMappingURL=pdf-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/pdf-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAG7D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAOxE;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAyBpE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAGxD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAM1D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE1D"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Lazy loader for pdf-lib
3
+ *
4
+ * This module provides a lazy loading mechanism for the pdf-lib library (~150KB).
5
+ * By deferring the import until actually needed, we can significantly reduce
6
+ * the initial bundle size for consumers who only view PDFs without filling forms.
7
+ *
8
+ * The pdf-lib library is only loaded when:
9
+ * - fillPdf() is called
10
+ * - combinePdfs() is called
11
+ * - Other PDF manipulation functions are used
12
+ */
13
+ /**
14
+ * Dynamically import pdf-lib library
15
+ *
16
+ * This function lazily loads pdf-lib only when needed. The import is cached
17
+ * so subsequent calls return the same promise, avoiding multiple imports.
18
+ *
19
+ * @returns Promise resolving to the pdf-lib module
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const { PDFDocument, rgb, StandardFonts } = await loadPdfLib();
24
+ * const pdfDoc = await PDFDocument.load(pdfBytes);
25
+ * ```
26
+ */
27
+ export declare function loadPdfLib(): Promise<typeof import("pdf-lib")>;
28
+ /**
29
+ * Check if pdf-lib has been loaded
30
+ *
31
+ * Useful for debugging and testing to verify lazy loading behavior.
32
+ *
33
+ * @returns true if pdf-lib has been loaded, false otherwise
34
+ */
35
+ export declare function isPdfLibLoaded(): boolean;
36
+ /**
37
+ * Reset the pdf-lib cache (primarily for testing)
38
+ *
39
+ * This should only be used in test environments to reset state
40
+ * between tests.
41
+ *
42
+ * @internal
43
+ */
44
+ export declare function resetPdfLibCache(): void;
45
+ //# sourceMappingURL=pdf-lib-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-lib-loader.d.ts","sourceRoot":"","sources":["../../src/utils/pdf-lib-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,sCAK/B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}