@signiphi/pdf-signer 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALLING_LOCALLY.md +184 -0
- package/LICENSE +2 -0
- package/README.md +1093 -0
- package/assets/viewer.html +314 -0
- package/dist/__tests__/helpers/fixtures.d.ts +43 -0
- package/dist/__tests__/helpers/fixtures.d.ts.map +1 -0
- package/dist/__tests__/helpers/mocks.d.ts +333 -0
- package/dist/__tests__/helpers/mocks.d.ts.map +1 -0
- package/dist/__tests__/setup.d.ts +6 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/components/AttachmentUpload.d.ts +17 -0
- package/dist/components/AttachmentUpload.d.ts.map +1 -0
- package/dist/components/EditableFieldsPanel.d.ts +30 -0
- package/dist/components/EditableFieldsPanel.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +67 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/FormFieldsView.d.ts +42 -0
- package/dist/components/FormFieldsView.d.ts.map +1 -0
- package/dist/components/PdfViewerStyled.d.ts +16 -0
- package/dist/components/PdfViewerStyled.d.ts.map +1 -0
- package/dist/components/PoweredBySigniphi.d.ts +11 -0
- package/dist/components/PoweredBySigniphi.d.ts.map +1 -0
- package/dist/components/SignatureCanvas.d.ts +12 -0
- package/dist/components/SignatureCanvas.d.ts.map +1 -0
- package/dist/components/SignatureInitialsBox.d.ts +23 -0
- package/dist/components/SignatureInitialsBox.d.ts.map +1 -0
- package/dist/components/SignatureModal.d.ts +22 -0
- package/dist/components/SignatureModal.d.ts.map +1 -0
- package/dist/components/SigningInstructions.d.ts +12 -0
- package/dist/components/SigningInstructions.d.ts.map +1 -0
- package/dist/components/SubmissionForm.d.ts +52 -0
- package/dist/components/SubmissionForm.d.ts.map +1 -0
- package/dist/components/ViewToggleToolbar.d.ts +30 -0
- package/dist/components/ViewToggleToolbar.d.ts.map +1 -0
- package/dist/components/form-fields/CheckboxRenderer.d.ts +10 -0
- package/dist/components/form-fields/CheckboxRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/DateFieldRenderer.d.ts +14 -0
- package/dist/components/form-fields/DateFieldRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/DropdownRenderer.d.ts +14 -0
- package/dist/components/form-fields/DropdownRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/FormFieldRenderer.d.ts +20 -0
- package/dist/components/form-fields/FormFieldRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/InitialsFieldRenderer.d.ts +14 -0
- package/dist/components/form-fields/InitialsFieldRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/RadioGroupRenderer.d.ts +10 -0
- package/dist/components/form-fields/RadioGroupRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/SignatureFieldRenderer.d.ts +16 -0
- package/dist/components/form-fields/SignatureFieldRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/TextFieldRenderer.d.ts +14 -0
- package/dist/components/form-fields/TextFieldRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/TextLabelRenderer.d.ts +14 -0
- package/dist/components/form-fields/TextLabelRenderer.d.ts.map +1 -0
- package/dist/components/form-fields/index.d.ts +14 -0
- package/dist/components/form-fields/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +6297 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +6248 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/core/PdfViewerCore.d.ts +19 -0
- package/dist/core/PdfViewerCore.d.ts.map +1 -0
- package/dist/core/SignatureCaptureCore.d.ts +37 -0
- package/dist/core/SignatureCaptureCore.d.ts.map +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +907 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +884 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2167 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +2139 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/useAttachments.d.ts +25 -0
- package/dist/hooks/useAttachments.d.ts.map +1 -0
- package/dist/hooks/useFieldFiltering.d.ts +29 -0
- package/dist/hooks/useFieldFiltering.d.ts.map +1 -0
- package/dist/hooks/useFormFields.d.ts +23 -0
- package/dist/hooks/useFormFields.d.ts.map +1 -0
- package/dist/hooks/useMultiSignerContext.d.ts +25 -0
- package/dist/hooks/useMultiSignerContext.d.ts.map +1 -0
- package/dist/hooks/usePdfViewer.d.ts +52 -0
- package/dist/hooks/usePdfViewer.d.ts.map +1 -0
- package/dist/hooks/useSignatureCapture.d.ts +17 -0
- package/dist/hooks/useSignatureCapture.d.ts.map +1 -0
- package/dist/hooks/useSignatures.d.ts +25 -0
- package/dist/hooks/useSignatures.d.ts.map +1 -0
- package/dist/index.css +4929 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7220 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +7093 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integrations/index.d.ts +6 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +242 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/index.mjs +218 -0
- package/dist/integrations/index.mjs.map +1 -0
- package/dist/integrations/next-config.d.ts +46 -0
- package/dist/integrations/next-config.d.ts.map +1 -0
- package/dist/integrations/vite-plugin.d.ts +48 -0
- package/dist/integrations/vite-plugin.d.ts.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/ui/alert.d.ts +9 -0
- package/dist/lib/ui/alert.d.ts.map +1 -0
- package/dist/lib/ui/button.d.ts +12 -0
- package/dist/lib/ui/button.d.ts.map +1 -0
- package/dist/lib/ui/calendar.d.ts +10 -0
- package/dist/lib/ui/calendar.d.ts.map +1 -0
- package/dist/lib/ui/card.d.ts +9 -0
- package/dist/lib/ui/card.d.ts.map +1 -0
- package/dist/lib/ui/checkbox.d.ts +5 -0
- package/dist/lib/ui/checkbox.d.ts.map +1 -0
- package/dist/lib/ui/dialog.d.ts +20 -0
- package/dist/lib/ui/dialog.d.ts.map +1 -0
- package/dist/lib/ui/index.d.ts +12 -0
- package/dist/lib/ui/index.d.ts.map +1 -0
- package/dist/lib/ui/input.d.ts +6 -0
- package/dist/lib/ui/input.d.ts.map +1 -0
- package/dist/lib/ui/label.d.ts +6 -0
- package/dist/lib/ui/label.d.ts.map +1 -0
- package/dist/lib/ui/popover.d.ts +7 -0
- package/dist/lib/ui/popover.d.ts.map +1 -0
- package/dist/lib/ui/radio-group.d.ts +6 -0
- package/dist/lib/ui/radio-group.d.ts.map +1 -0
- package/dist/lib/ui/select.d.ts +14 -0
- package/dist/lib/ui/select.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/styles/index.css +5004 -0
- package/dist/types/index.d.ts +265 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +26 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +23 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/attachment-validators.d.ts +118 -0
- package/dist/utils/attachment-validators.d.ts.map +1 -0
- package/dist/utils/audit-trail.d.ts +27 -0
- package/dist/utils/audit-trail.d.ts.map +1 -0
- package/dist/utils/date-validation.d.ts +30 -0
- package/dist/utils/date-validation.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +106 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/field-extraction.d.ts +27 -0
- package/dist/utils/field-extraction.d.ts.map +1 -0
- package/dist/utils/field-visibility.d.ts +104 -0
- package/dist/utils/field-visibility.d.ts.map +1 -0
- package/dist/utils/index.d.ts +17 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2501 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +2404 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/pdf-field-type-helpers.d.ts +78 -0
- package/dist/utils/pdf-field-type-helpers.d.ts.map +1 -0
- package/dist/utils/pdf-helpers.d.ts +38 -0
- package/dist/utils/pdf-helpers.d.ts.map +1 -0
- package/dist/utils/pdf-lib-loader.d.ts +45 -0
- package/dist/utils/pdf-lib-loader.d.ts.map +1 -0
- package/dist/utils/pdf-manipulation.d.ts +93 -0
- package/dist/utils/pdf-manipulation.d.ts.map +1 -0
- package/dist/utils/pdf-validators.d.ts +149 -0
- package/dist/utils/pdf-validators.d.ts.map +1 -0
- package/dist/utils/pdf-viewer-filter.d.ts +35 -0
- package/dist/utils/pdf-viewer-filter.d.ts.map +1 -0
- package/dist/utils/pdf-widget-helpers.d.ts +98 -0
- package/dist/utils/pdf-widget-helpers.d.ts.map +1 -0
- package/dist/utils/pdfjs-config.d.ts +56 -0
- package/dist/utils/pdfjs-config.d.ts.map +1 -0
- package/dist/utils/pdfjs-version-check.d.ts +28 -0
- package/dist/utils/pdfjs-version-check.d.ts.map +1 -0
- package/dist/utils/performance-monitor.d.ts +172 -0
- package/dist/utils/performance-monitor.d.ts.map +1 -0
- package/dist/utils/tracking.d.ts +89 -0
- package/dist/utils/tracking.d.ts.map +1 -0
- package/package.json +180 -0
- package/scripts/analyze-bundle.js +271 -0
- package/scripts/copy-utils.js +227 -0
- package/scripts/copy-utils.test.js +164 -0
- package/scripts/postinstall.js +109 -0
- package/scripts/setup.js +108 -0
- package/src/styles/index.css +139 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>PDF.js Viewer</title>
|
|
7
|
+
<link rel="stylesheet" href="pdf_viewer.css">
|
|
8
|
+
<style>
|
|
9
|
+
* {
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
html, body {
|
|
16
|
+
height: 100%;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
font-family: sans-serif;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#viewerContainer {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 0;
|
|
24
|
+
right: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
overflow: auto;
|
|
28
|
+
background-color: #525659;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#viewer {
|
|
32
|
+
/* pdfViewer styles from pdf_viewer.css will apply here */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.page {
|
|
36
|
+
position: relative;
|
|
37
|
+
overflow: visible;
|
|
38
|
+
margin: 1rem auto;
|
|
39
|
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Loading indicator */
|
|
43
|
+
.loading {
|
|
44
|
+
position: fixed;
|
|
45
|
+
top: 50%;
|
|
46
|
+
left: 50%;
|
|
47
|
+
transform: translate(-50%, -50%);
|
|
48
|
+
background: rgba(0, 0, 0, 0.7);
|
|
49
|
+
color: white;
|
|
50
|
+
padding: 1rem 2rem;
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
z-index: 1000;
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.loading.visible {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Error display */
|
|
61
|
+
.error {
|
|
62
|
+
position: fixed;
|
|
63
|
+
top: 50%;
|
|
64
|
+
left: 50%;
|
|
65
|
+
transform: translate(-50%, -50%);
|
|
66
|
+
background: #f44336;
|
|
67
|
+
color: white;
|
|
68
|
+
padding: 1rem 2rem;
|
|
69
|
+
border-radius: 4px;
|
|
70
|
+
z-index: 1000;
|
|
71
|
+
display: none;
|
|
72
|
+
max-width: 80%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.error.visible {
|
|
76
|
+
display: block;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
79
|
+
</head>
|
|
80
|
+
<body>
|
|
81
|
+
<div class="loading" id="loadingIndicator">Loading PDF...</div>
|
|
82
|
+
<div class="error" id="errorIndicator"></div>
|
|
83
|
+
<div id="viewerContainer">
|
|
84
|
+
<div id="viewer" class="pdfViewer"></div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<!-- Initialize PDFViewerApplication stub immediately (before modules load) -->
|
|
88
|
+
<script>
|
|
89
|
+
// Create a basic stub immediately so components don't get "not available" errors
|
|
90
|
+
// This will be replaced/enhanced once modules load
|
|
91
|
+
window.PDFViewerApplication = {
|
|
92
|
+
pdfViewer: null,
|
|
93
|
+
eventBus: null,
|
|
94
|
+
pdfLinkService: null,
|
|
95
|
+
pdfDocument: null,
|
|
96
|
+
pdfLoadingTask: null,
|
|
97
|
+
initialized: false,
|
|
98
|
+
initializedPromise: new Promise((resolve) => {
|
|
99
|
+
window._pdfjsInitResolver = resolve;
|
|
100
|
+
}),
|
|
101
|
+
open: async function() {
|
|
102
|
+
throw new Error('PDFViewerApplication not yet initialized. Wait for initializedPromise.');
|
|
103
|
+
},
|
|
104
|
+
close: async function() {},
|
|
105
|
+
currentPageNumber: 1,
|
|
106
|
+
pagesCount: 0,
|
|
107
|
+
currentScale: 1
|
|
108
|
+
};
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<script type="module">
|
|
112
|
+
// Import PDF.js modules (5.x structure)
|
|
113
|
+
import * as pdfjsLib from '../build/pdf.mjs';
|
|
114
|
+
import {
|
|
115
|
+
PDFViewer,
|
|
116
|
+
EventBus,
|
|
117
|
+
PDFLinkService
|
|
118
|
+
} from './pdf_viewer.mjs';
|
|
119
|
+
|
|
120
|
+
// Configure worker
|
|
121
|
+
if (typeof pdfjsLib.GlobalWorkerOptions !== 'undefined') {
|
|
122
|
+
pdfjsLib.GlobalWorkerOptions.workerSrc = '../build/pdf.worker.mjs';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// UI elements
|
|
126
|
+
const loadingIndicator = document.getElementById('loadingIndicator');
|
|
127
|
+
const errorIndicator = document.getElementById('errorIndicator');
|
|
128
|
+
|
|
129
|
+
function showLoading() {
|
|
130
|
+
loadingIndicator.classList.add('visible');
|
|
131
|
+
errorIndicator.classList.remove('visible');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function hideLoading() {
|
|
135
|
+
loadingIndicator.classList.remove('visible');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function showError(message) {
|
|
139
|
+
errorIndicator.textContent = message;
|
|
140
|
+
errorIndicator.classList.add('visible');
|
|
141
|
+
loadingIndicator.classList.remove('visible');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Create event bus
|
|
145
|
+
const eventBus = new EventBus();
|
|
146
|
+
|
|
147
|
+
// Create link service
|
|
148
|
+
const pdfLinkService = new PDFLinkService({
|
|
149
|
+
eventBus,
|
|
150
|
+
externalLinkTarget: 2, // Open external links in new window
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Create PDF viewer
|
|
154
|
+
const pdfViewer = new PDFViewer({
|
|
155
|
+
container: document.getElementById('viewerContainer'),
|
|
156
|
+
viewer: document.getElementById('viewer'),
|
|
157
|
+
eventBus,
|
|
158
|
+
linkService: pdfLinkService,
|
|
159
|
+
textLayerMode: 2, // Enable text layer
|
|
160
|
+
annotationMode: 2, // Enable form annotations
|
|
161
|
+
annotationEditorMode: 0, // Disable editor mode
|
|
162
|
+
removePageBorders: false,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
pdfLinkService.setViewer(pdfViewer);
|
|
166
|
+
|
|
167
|
+
// Listen to events
|
|
168
|
+
eventBus.on('pagesinit', function () {
|
|
169
|
+
// Set initial zoom
|
|
170
|
+
pdfViewer.currentScaleValue = 'auto';
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
eventBus.on('documentloaded', function () {
|
|
174
|
+
hideLoading();
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// Replace the stub with the real PDFViewerApplication implementation
|
|
178
|
+
// This provides the same API that the @signiphi/pdf-signer package expects
|
|
179
|
+
|
|
180
|
+
// Update simple properties
|
|
181
|
+
window.PDFViewerApplication.pdfViewer = pdfViewer;
|
|
182
|
+
window.PDFViewerApplication.eventBus = eventBus;
|
|
183
|
+
window.PDFViewerApplication.pdfLinkService = pdfLinkService;
|
|
184
|
+
window.PDFViewerApplication.pdfDocument = null;
|
|
185
|
+
window.PDFViewerApplication.pdfLoadingTask = null;
|
|
186
|
+
window.PDFViewerApplication.initialized = true;
|
|
187
|
+
|
|
188
|
+
// Add methods
|
|
189
|
+
window.PDFViewerApplication.open = async function(params) {
|
|
190
|
+
const url = typeof params === 'string' ? params : (params.url || params);
|
|
191
|
+
|
|
192
|
+
if (!url) {
|
|
193
|
+
throw new Error('No URL provided to open');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
showLoading();
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
// Close any existing document
|
|
200
|
+
if (this.pdfLoadingTask) {
|
|
201
|
+
await this.close();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Load the document
|
|
205
|
+
this.pdfLoadingTask = pdfjsLib.getDocument({
|
|
206
|
+
url,
|
|
207
|
+
cMapUrl: '../cmaps/',
|
|
208
|
+
cMapPacked: true,
|
|
209
|
+
standardFontDataUrl: '../standard_fonts/',
|
|
210
|
+
withCredentials: false,
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
this.pdfDocument = await this.pdfLoadingTask.promise;
|
|
214
|
+
|
|
215
|
+
// Set document in viewer
|
|
216
|
+
pdfViewer.setDocument(this.pdfDocument);
|
|
217
|
+
pdfLinkService.setDocument(this.pdfDocument, null);
|
|
218
|
+
|
|
219
|
+
// Dispatch event
|
|
220
|
+
eventBus.dispatch('documentloaded', {
|
|
221
|
+
source: this,
|
|
222
|
+
pdfDocument: this.pdfDocument
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
console.log('PDF loaded successfully:', {
|
|
226
|
+
numPages: this.pdfDocument.numPages,
|
|
227
|
+
fingerprints: this.pdfDocument.fingerprints
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return this.pdfDocument;
|
|
231
|
+
} catch (error) {
|
|
232
|
+
console.error('Error loading PDF:', error);
|
|
233
|
+
showError(`Failed to load PDF: ${error.message}`);
|
|
234
|
+
eventBus.dispatch('documenterror', { source: this, error });
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Close the current PDF document
|
|
241
|
+
*/
|
|
242
|
+
window.PDFViewerApplication.close = async function() {
|
|
243
|
+
if (this.pdfLoadingTask) {
|
|
244
|
+
try {
|
|
245
|
+
await this.pdfLoadingTask.destroy();
|
|
246
|
+
} catch (error) {
|
|
247
|
+
console.warn('Error destroying PDF loading task:', error);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.pdfDocument = null;
|
|
251
|
+
this.pdfLoadingTask = null;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
// Define getters and setters using Object.defineProperty to avoid conflicts
|
|
255
|
+
Object.defineProperty(window.PDFViewerApplication, 'currentPageNumber', {
|
|
256
|
+
get: function() { return pdfViewer.currentPageNumber; },
|
|
257
|
+
set: function(val) { pdfViewer.currentPageNumber = val; },
|
|
258
|
+
configurable: true,
|
|
259
|
+
enumerable: true
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
Object.defineProperty(window.PDFViewerApplication, 'pagesCount', {
|
|
263
|
+
get: function() { return pdfViewer.pagesCount; },
|
|
264
|
+
configurable: true,
|
|
265
|
+
enumerable: true
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
Object.defineProperty(window.PDFViewerApplication, 'currentScale', {
|
|
269
|
+
get: function() { return pdfViewer.currentScale; },
|
|
270
|
+
set: function(val) { pdfViewer.currentScale = val; },
|
|
271
|
+
configurable: true,
|
|
272
|
+
enumerable: true
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// Resolve the initialization promise so components know we're ready
|
|
276
|
+
if (window._pdfjsInitResolver) {
|
|
277
|
+
window._pdfjsInitResolver();
|
|
278
|
+
delete window._pdfjsInitResolver;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Make event bus globally accessible for debugging
|
|
282
|
+
window.PDFViewerEventBus = eventBus;
|
|
283
|
+
|
|
284
|
+
// Parse URL parameters and auto-load PDF
|
|
285
|
+
const params = new URLSearchParams(window.location.search);
|
|
286
|
+
const fileParam = params.get('file');
|
|
287
|
+
|
|
288
|
+
if (fileParam) {
|
|
289
|
+
const decodedUrl = decodeURIComponent(fileParam);
|
|
290
|
+
console.log('Auto-loading PDF from URL parameter:', decodedUrl);
|
|
291
|
+
|
|
292
|
+
window.PDFViewerApplication.open(decodedUrl)
|
|
293
|
+
.catch(error => {
|
|
294
|
+
console.error('Failed to auto-load PDF:', error);
|
|
295
|
+
});
|
|
296
|
+
} else {
|
|
297
|
+
console.log('No file parameter provided in URL');
|
|
298
|
+
hideLoading();
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Handle window resize
|
|
302
|
+
window.addEventListener('resize', function() {
|
|
303
|
+
pdfViewer.update();
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
// Log that viewer is ready
|
|
307
|
+
console.log('PDF.js Viewer initialized', {
|
|
308
|
+
version: pdfjsLib.version,
|
|
309
|
+
build: pdfjsLib.build,
|
|
310
|
+
workerSrc: pdfjsLib.GlobalWorkerOptions.workerSrc
|
|
311
|
+
});
|
|
312
|
+
</script>
|
|
313
|
+
</body>
|
|
314
|
+
</html>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Fixtures
|
|
3
|
+
* Sample data for testing hooks
|
|
4
|
+
*/
|
|
5
|
+
import type { EsignFormField, Signer, Attachment, MultiSignerContext } from '../../types';
|
|
6
|
+
export declare const validPdfBytes: Uint8Array<ArrayBuffer>;
|
|
7
|
+
export declare const invalidPdfBytes: Uint8Array<ArrayBuffer>;
|
|
8
|
+
export declare const sampleTextField: EsignFormField;
|
|
9
|
+
export declare const sampleSignatureField: EsignFormField;
|
|
10
|
+
export declare const sampleInitialsField: EsignFormField;
|
|
11
|
+
export declare const sampleCheckboxField: EsignFormField;
|
|
12
|
+
export declare const sampleRadioField: EsignFormField;
|
|
13
|
+
export declare const sampleDropdownField: EsignFormField;
|
|
14
|
+
export declare const sampleDateField: EsignFormField;
|
|
15
|
+
export declare const sampleFormFields: EsignFormField[];
|
|
16
|
+
export declare const primarySignerField: EsignFormField;
|
|
17
|
+
export declare const secondarySignerField: EsignFormField;
|
|
18
|
+
export declare const finalSignerField: EsignFormField;
|
|
19
|
+
export declare const recipientsField: EsignFormField;
|
|
20
|
+
export declare const signersField: EsignFormField;
|
|
21
|
+
export declare const primarySigner: Signer;
|
|
22
|
+
export declare const secondarySigner: Signer;
|
|
23
|
+
export declare const finalSigner: Signer;
|
|
24
|
+
export declare const singleSignerContext: MultiSignerContext;
|
|
25
|
+
export declare const primarySignerContext: MultiSignerContext;
|
|
26
|
+
export declare const secondarySignerContext: MultiSignerContext;
|
|
27
|
+
export declare const finalSignerContext: MultiSignerContext;
|
|
28
|
+
export declare const sampleAttachment: Attachment;
|
|
29
|
+
export declare const sampleImageAttachment: Attachment;
|
|
30
|
+
export declare const sampleSignatureDataUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
|
|
31
|
+
export declare const sampleInitialsDataUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==";
|
|
32
|
+
export declare const sampleFieldValues: {
|
|
33
|
+
firstName: string;
|
|
34
|
+
lastName: string;
|
|
35
|
+
email: string;
|
|
36
|
+
agree: string;
|
|
37
|
+
choice: string;
|
|
38
|
+
dropdown: string;
|
|
39
|
+
date: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const samplePdfUrl = "https://example.com/sample.pdf";
|
|
42
|
+
export declare const sampleLocalPdfPath = "/path/to/sample.pdf";
|
|
43
|
+
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/fixtures.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGzG,eAAO,MAAM,aAAa,yBAKxB,CAAC;AAEH,eAAO,MAAM,eAAe,yBAA2C,CAAC;AAGxE,eAAO,MAAM,eAAe,EAAE,cAO7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAOlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAOjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAOjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAQ9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAQjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAO7B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAQ5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAKhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAMlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAM9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAK7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAK1B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,MAM3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAM7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAMzB,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,kBAMjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,kBAMlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,kBAMpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAMhC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,UAO9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,UAOnC,CAAC;AAGF,eAAO,MAAM,sBAAsB,2HAA2H,CAAC;AAE/J,eAAO,MAAM,qBAAqB,2HAA2H,CAAC;AAG9J,eAAO,MAAM,iBAAiB;;;;;;;;CAQ7B,CAAC;AAGF,eAAO,MAAM,YAAY,mCAAmC,CAAC;AAC7D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Mocks
|
|
3
|
+
* Mock implementations for PDF.js and pdf-lib
|
|
4
|
+
*/
|
|
5
|
+
export declare const mockPdfJsPage: {
|
|
6
|
+
getViewport: import("vitest").Mock<[], {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
scale: number;
|
|
10
|
+
}>;
|
|
11
|
+
render: import("vitest").Mock<[], {
|
|
12
|
+
promise: Promise<void>;
|
|
13
|
+
}>;
|
|
14
|
+
getAnnotations: import("vitest").Mock<[], Promise<never[]>>;
|
|
15
|
+
getTextContent: import("vitest").Mock<[], Promise<{
|
|
16
|
+
items: never[];
|
|
17
|
+
}>>;
|
|
18
|
+
};
|
|
19
|
+
export declare const mockPdfJsDocument: {
|
|
20
|
+
numPages: number;
|
|
21
|
+
getPage: import("vitest").Mock<[_pageNum: number], Promise<{
|
|
22
|
+
getViewport: import("vitest").Mock<[], {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
scale: number;
|
|
26
|
+
}>;
|
|
27
|
+
render: import("vitest").Mock<[], {
|
|
28
|
+
promise: Promise<void>;
|
|
29
|
+
}>;
|
|
30
|
+
getAnnotations: import("vitest").Mock<[], Promise<never[]>>;
|
|
31
|
+
getTextContent: import("vitest").Mock<[], Promise<{
|
|
32
|
+
items: never[];
|
|
33
|
+
}>>;
|
|
34
|
+
}>>;
|
|
35
|
+
getMetadata: import("vitest").Mock<[], Promise<{
|
|
36
|
+
info: {};
|
|
37
|
+
metadata: null;
|
|
38
|
+
}>>;
|
|
39
|
+
getData: import("vitest").Mock<[], Promise<Uint8Array<ArrayBuffer>>>;
|
|
40
|
+
destroy: import("vitest").Mock<any, any>;
|
|
41
|
+
};
|
|
42
|
+
export declare const mockPdfJsLoadingTask: {
|
|
43
|
+
promise: Promise<{
|
|
44
|
+
numPages: number;
|
|
45
|
+
getPage: import("vitest").Mock<[_pageNum: number], Promise<{
|
|
46
|
+
getViewport: import("vitest").Mock<[], {
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
scale: number;
|
|
50
|
+
}>;
|
|
51
|
+
render: import("vitest").Mock<[], {
|
|
52
|
+
promise: Promise<void>;
|
|
53
|
+
}>;
|
|
54
|
+
getAnnotations: import("vitest").Mock<[], Promise<never[]>>;
|
|
55
|
+
getTextContent: import("vitest").Mock<[], Promise<{
|
|
56
|
+
items: never[];
|
|
57
|
+
}>>;
|
|
58
|
+
}>>;
|
|
59
|
+
getMetadata: import("vitest").Mock<[], Promise<{
|
|
60
|
+
info: {};
|
|
61
|
+
metadata: null;
|
|
62
|
+
}>>;
|
|
63
|
+
getData: import("vitest").Mock<[], Promise<Uint8Array<ArrayBuffer>>>;
|
|
64
|
+
destroy: import("vitest").Mock<any, any>;
|
|
65
|
+
}>;
|
|
66
|
+
destroy: import("vitest").Mock<any, any>;
|
|
67
|
+
};
|
|
68
|
+
export declare const mockGetDocument: import("vitest").Mock<[], {
|
|
69
|
+
promise: Promise<{
|
|
70
|
+
numPages: number;
|
|
71
|
+
getPage: import("vitest").Mock<[_pageNum: number], Promise<{
|
|
72
|
+
getViewport: import("vitest").Mock<[], {
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
scale: number;
|
|
76
|
+
}>;
|
|
77
|
+
render: import("vitest").Mock<[], {
|
|
78
|
+
promise: Promise<void>;
|
|
79
|
+
}>;
|
|
80
|
+
getAnnotations: import("vitest").Mock<[], Promise<never[]>>;
|
|
81
|
+
getTextContent: import("vitest").Mock<[], Promise<{
|
|
82
|
+
items: never[];
|
|
83
|
+
}>>;
|
|
84
|
+
}>>;
|
|
85
|
+
getMetadata: import("vitest").Mock<[], Promise<{
|
|
86
|
+
info: {};
|
|
87
|
+
metadata: null;
|
|
88
|
+
}>>;
|
|
89
|
+
getData: import("vitest").Mock<[], Promise<Uint8Array<ArrayBuffer>>>;
|
|
90
|
+
destroy: import("vitest").Mock<any, any>;
|
|
91
|
+
}>;
|
|
92
|
+
destroy: import("vitest").Mock<any, any>;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const mockPdfLibField: {
|
|
95
|
+
getName: import("vitest").Mock<[], string>;
|
|
96
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
97
|
+
getText: import("vitest").Mock<[], string>;
|
|
98
|
+
setValue: import("vitest").Mock<any, any>;
|
|
99
|
+
};
|
|
100
|
+
export declare const mockPdfLibForm: {
|
|
101
|
+
getFields: import("vitest").Mock<[], {
|
|
102
|
+
getName: import("vitest").Mock<[], string>;
|
|
103
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
104
|
+
getText: import("vitest").Mock<[], string>;
|
|
105
|
+
setValue: import("vitest").Mock<any, any>;
|
|
106
|
+
}[]>;
|
|
107
|
+
getField: import("vitest").Mock<[], {
|
|
108
|
+
getName: import("vitest").Mock<[], string>;
|
|
109
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
110
|
+
getText: import("vitest").Mock<[], string>;
|
|
111
|
+
setValue: import("vitest").Mock<any, any>;
|
|
112
|
+
}>;
|
|
113
|
+
getFieldMaybe: import("vitest").Mock<[], {
|
|
114
|
+
getName: import("vitest").Mock<[], string>;
|
|
115
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
116
|
+
getText: import("vitest").Mock<[], string>;
|
|
117
|
+
setValue: import("vitest").Mock<any, any>;
|
|
118
|
+
}>;
|
|
119
|
+
getTextField: import("vitest").Mock<[], {
|
|
120
|
+
getName: import("vitest").Mock<[], string>;
|
|
121
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
122
|
+
getText: import("vitest").Mock<[], string>;
|
|
123
|
+
setValue: import("vitest").Mock<any, any>;
|
|
124
|
+
}>;
|
|
125
|
+
getCheckBox: import("vitest").Mock<[], {
|
|
126
|
+
getName: import("vitest").Mock<[], string>;
|
|
127
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
128
|
+
getText: import("vitest").Mock<[], string>;
|
|
129
|
+
setValue: import("vitest").Mock<any, any>;
|
|
130
|
+
}>;
|
|
131
|
+
getRadioGroup: import("vitest").Mock<[], {
|
|
132
|
+
getName: import("vitest").Mock<[], string>;
|
|
133
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
134
|
+
getText: import("vitest").Mock<[], string>;
|
|
135
|
+
setValue: import("vitest").Mock<any, any>;
|
|
136
|
+
}>;
|
|
137
|
+
getDropdown: import("vitest").Mock<[], {
|
|
138
|
+
getName: import("vitest").Mock<[], string>;
|
|
139
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
140
|
+
getText: import("vitest").Mock<[], string>;
|
|
141
|
+
setValue: import("vitest").Mock<any, any>;
|
|
142
|
+
}>;
|
|
143
|
+
removeField: import("vitest").Mock<any, any>;
|
|
144
|
+
flatten: import("vitest").Mock<any, any>;
|
|
145
|
+
updateFieldAppearances: import("vitest").Mock<any, any>;
|
|
146
|
+
};
|
|
147
|
+
export declare const mockPdfLibPage: {
|
|
148
|
+
getWidth: import("vitest").Mock<[], number>;
|
|
149
|
+
getHeight: import("vitest").Mock<[], number>;
|
|
150
|
+
getSize: import("vitest").Mock<[], {
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
}>;
|
|
154
|
+
drawText: import("vitest").Mock<any, any>;
|
|
155
|
+
drawRectangle: import("vitest").Mock<any, any>;
|
|
156
|
+
drawImage: import("vitest").Mock<any, any>;
|
|
157
|
+
};
|
|
158
|
+
export declare const mockPdfLibDocument: {
|
|
159
|
+
getPages: import("vitest").Mock<[], {
|
|
160
|
+
getWidth: import("vitest").Mock<[], number>;
|
|
161
|
+
getHeight: import("vitest").Mock<[], number>;
|
|
162
|
+
getSize: import("vitest").Mock<[], {
|
|
163
|
+
width: number;
|
|
164
|
+
height: number;
|
|
165
|
+
}>;
|
|
166
|
+
drawText: import("vitest").Mock<any, any>;
|
|
167
|
+
drawRectangle: import("vitest").Mock<any, any>;
|
|
168
|
+
drawImage: import("vitest").Mock<any, any>;
|
|
169
|
+
}[]>;
|
|
170
|
+
getPage: import("vitest").Mock<[_index: number], {
|
|
171
|
+
getWidth: import("vitest").Mock<[], number>;
|
|
172
|
+
getHeight: import("vitest").Mock<[], number>;
|
|
173
|
+
getSize: import("vitest").Mock<[], {
|
|
174
|
+
width: number;
|
|
175
|
+
height: number;
|
|
176
|
+
}>;
|
|
177
|
+
drawText: import("vitest").Mock<any, any>;
|
|
178
|
+
drawRectangle: import("vitest").Mock<any, any>;
|
|
179
|
+
drawImage: import("vitest").Mock<any, any>;
|
|
180
|
+
}>;
|
|
181
|
+
getPageCount: import("vitest").Mock<[], number>;
|
|
182
|
+
getForm: import("vitest").Mock<[], {
|
|
183
|
+
getFields: import("vitest").Mock<[], {
|
|
184
|
+
getName: import("vitest").Mock<[], string>;
|
|
185
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
186
|
+
getText: import("vitest").Mock<[], string>;
|
|
187
|
+
setValue: import("vitest").Mock<any, any>;
|
|
188
|
+
}[]>;
|
|
189
|
+
getField: import("vitest").Mock<[], {
|
|
190
|
+
getName: import("vitest").Mock<[], string>;
|
|
191
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
192
|
+
getText: import("vitest").Mock<[], string>;
|
|
193
|
+
setValue: import("vitest").Mock<any, any>;
|
|
194
|
+
}>;
|
|
195
|
+
getFieldMaybe: import("vitest").Mock<[], {
|
|
196
|
+
getName: import("vitest").Mock<[], string>;
|
|
197
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
198
|
+
getText: import("vitest").Mock<[], string>;
|
|
199
|
+
setValue: import("vitest").Mock<any, any>;
|
|
200
|
+
}>;
|
|
201
|
+
getTextField: import("vitest").Mock<[], {
|
|
202
|
+
getName: import("vitest").Mock<[], string>;
|
|
203
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
204
|
+
getText: import("vitest").Mock<[], string>;
|
|
205
|
+
setValue: import("vitest").Mock<any, any>;
|
|
206
|
+
}>;
|
|
207
|
+
getCheckBox: import("vitest").Mock<[], {
|
|
208
|
+
getName: import("vitest").Mock<[], string>;
|
|
209
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
210
|
+
getText: import("vitest").Mock<[], string>;
|
|
211
|
+
setValue: import("vitest").Mock<any, any>;
|
|
212
|
+
}>;
|
|
213
|
+
getRadioGroup: import("vitest").Mock<[], {
|
|
214
|
+
getName: import("vitest").Mock<[], string>;
|
|
215
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
216
|
+
getText: import("vitest").Mock<[], string>;
|
|
217
|
+
setValue: import("vitest").Mock<any, any>;
|
|
218
|
+
}>;
|
|
219
|
+
getDropdown: import("vitest").Mock<[], {
|
|
220
|
+
getName: import("vitest").Mock<[], string>;
|
|
221
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
222
|
+
getText: import("vitest").Mock<[], string>;
|
|
223
|
+
setValue: import("vitest").Mock<any, any>;
|
|
224
|
+
}>;
|
|
225
|
+
removeField: import("vitest").Mock<any, any>;
|
|
226
|
+
flatten: import("vitest").Mock<any, any>;
|
|
227
|
+
updateFieldAppearances: import("vitest").Mock<any, any>;
|
|
228
|
+
}>;
|
|
229
|
+
save: import("vitest").Mock<[], Promise<Uint8Array<ArrayBuffer>>>;
|
|
230
|
+
embedFont: import("vitest").Mock<[], Promise<{}>>;
|
|
231
|
+
embedPng: import("vitest").Mock<[], Promise<{}>>;
|
|
232
|
+
embedJpg: import("vitest").Mock<[], Promise<{}>>;
|
|
233
|
+
setTitle: import("vitest").Mock<any, any>;
|
|
234
|
+
setAuthor: import("vitest").Mock<any, any>;
|
|
235
|
+
setSubject: import("vitest").Mock<any, any>;
|
|
236
|
+
setKeywords: import("vitest").Mock<any, any>;
|
|
237
|
+
setProducer: import("vitest").Mock<any, any>;
|
|
238
|
+
setCreator: import("vitest").Mock<any, any>;
|
|
239
|
+
setCreationDate: import("vitest").Mock<any, any>;
|
|
240
|
+
setModificationDate: import("vitest").Mock<any, any>;
|
|
241
|
+
};
|
|
242
|
+
export declare const mockPdfLibLoad: import("vitest").Mock<[], Promise<{
|
|
243
|
+
getPages: import("vitest").Mock<[], {
|
|
244
|
+
getWidth: import("vitest").Mock<[], number>;
|
|
245
|
+
getHeight: import("vitest").Mock<[], number>;
|
|
246
|
+
getSize: import("vitest").Mock<[], {
|
|
247
|
+
width: number;
|
|
248
|
+
height: number;
|
|
249
|
+
}>;
|
|
250
|
+
drawText: import("vitest").Mock<any, any>;
|
|
251
|
+
drawRectangle: import("vitest").Mock<any, any>;
|
|
252
|
+
drawImage: import("vitest").Mock<any, any>;
|
|
253
|
+
}[]>;
|
|
254
|
+
getPage: import("vitest").Mock<[_index: number], {
|
|
255
|
+
getWidth: import("vitest").Mock<[], number>;
|
|
256
|
+
getHeight: import("vitest").Mock<[], number>;
|
|
257
|
+
getSize: import("vitest").Mock<[], {
|
|
258
|
+
width: number;
|
|
259
|
+
height: number;
|
|
260
|
+
}>;
|
|
261
|
+
drawText: import("vitest").Mock<any, any>;
|
|
262
|
+
drawRectangle: import("vitest").Mock<any, any>;
|
|
263
|
+
drawImage: import("vitest").Mock<any, any>;
|
|
264
|
+
}>;
|
|
265
|
+
getPageCount: import("vitest").Mock<[], number>;
|
|
266
|
+
getForm: import("vitest").Mock<[], {
|
|
267
|
+
getFields: import("vitest").Mock<[], {
|
|
268
|
+
getName: import("vitest").Mock<[], string>;
|
|
269
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
270
|
+
getText: import("vitest").Mock<[], string>;
|
|
271
|
+
setValue: import("vitest").Mock<any, any>;
|
|
272
|
+
}[]>;
|
|
273
|
+
getField: import("vitest").Mock<[], {
|
|
274
|
+
getName: import("vitest").Mock<[], string>;
|
|
275
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
276
|
+
getText: import("vitest").Mock<[], string>;
|
|
277
|
+
setValue: import("vitest").Mock<any, any>;
|
|
278
|
+
}>;
|
|
279
|
+
getFieldMaybe: import("vitest").Mock<[], {
|
|
280
|
+
getName: import("vitest").Mock<[], string>;
|
|
281
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
282
|
+
getText: import("vitest").Mock<[], string>;
|
|
283
|
+
setValue: import("vitest").Mock<any, any>;
|
|
284
|
+
}>;
|
|
285
|
+
getTextField: import("vitest").Mock<[], {
|
|
286
|
+
getName: import("vitest").Mock<[], string>;
|
|
287
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
288
|
+
getText: import("vitest").Mock<[], string>;
|
|
289
|
+
setValue: import("vitest").Mock<any, any>;
|
|
290
|
+
}>;
|
|
291
|
+
getCheckBox: import("vitest").Mock<[], {
|
|
292
|
+
getName: import("vitest").Mock<[], string>;
|
|
293
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
294
|
+
getText: import("vitest").Mock<[], string>;
|
|
295
|
+
setValue: import("vitest").Mock<any, any>;
|
|
296
|
+
}>;
|
|
297
|
+
getRadioGroup: import("vitest").Mock<[], {
|
|
298
|
+
getName: import("vitest").Mock<[], string>;
|
|
299
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
300
|
+
getText: import("vitest").Mock<[], string>;
|
|
301
|
+
setValue: import("vitest").Mock<any, any>;
|
|
302
|
+
}>;
|
|
303
|
+
getDropdown: import("vitest").Mock<[], {
|
|
304
|
+
getName: import("vitest").Mock<[], string>;
|
|
305
|
+
isRequired: import("vitest").Mock<[], boolean>;
|
|
306
|
+
getText: import("vitest").Mock<[], string>;
|
|
307
|
+
setValue: import("vitest").Mock<any, any>;
|
|
308
|
+
}>;
|
|
309
|
+
removeField: import("vitest").Mock<any, any>;
|
|
310
|
+
flatten: import("vitest").Mock<any, any>;
|
|
311
|
+
updateFieldAppearances: import("vitest").Mock<any, any>;
|
|
312
|
+
}>;
|
|
313
|
+
save: import("vitest").Mock<[], Promise<Uint8Array<ArrayBuffer>>>;
|
|
314
|
+
embedFont: import("vitest").Mock<[], Promise<{}>>;
|
|
315
|
+
embedPng: import("vitest").Mock<[], Promise<{}>>;
|
|
316
|
+
embedJpg: import("vitest").Mock<[], Promise<{}>>;
|
|
317
|
+
setTitle: import("vitest").Mock<any, any>;
|
|
318
|
+
setAuthor: import("vitest").Mock<any, any>;
|
|
319
|
+
setSubject: import("vitest").Mock<any, any>;
|
|
320
|
+
setKeywords: import("vitest").Mock<any, any>;
|
|
321
|
+
setProducer: import("vitest").Mock<any, any>;
|
|
322
|
+
setCreator: import("vitest").Mock<any, any>;
|
|
323
|
+
setCreationDate: import("vitest").Mock<any, any>;
|
|
324
|
+
setModificationDate: import("vitest").Mock<any, any>;
|
|
325
|
+
}>>;
|
|
326
|
+
export declare const mockFetch: import("vitest").Mock<[url: string], Promise<Response>>;
|
|
327
|
+
export declare function setupFetchMock(): void;
|
|
328
|
+
export declare function resetAllMocks(): void;
|
|
329
|
+
export declare function createMockFile(name: string, size: number, type: string, content?: string): File;
|
|
330
|
+
export declare function createMockPdfResponse(valid?: boolean): Response;
|
|
331
|
+
export declare function waitForAsync(): Promise<unknown>;
|
|
332
|
+
export declare function createMockCanvasContext(): any;
|
|
333
|
+
//# sourceMappingURL=mocks.d.ts.map
|