@gembox/pdfviewer 2026.5.101 → 2026.5.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.
@@ -1,42 +1,1858 @@
1
- import { ApplicationContext } from "./models/application-context.ts";
2
- export interface ViewerOptions {
3
- container: HTMLElement | string;
4
- initialDocument?: string | Uint8Array | ArrayBuffer | null;
5
- theme?: "light" | "dark" | "red" | "dark-red" | "blue" | "dark-blue" | "green" | "dark-green" | null;
6
- visibility?: VisibilityOptions | null;
7
- localization?: "en" | "de" | "es" | NestedMessages | null;
8
- digitalSigning?: DigitalSignatureOptions | null;
9
- }
10
- export interface VisibilityOptions {
11
- sideMenu?: boolean | null;
12
- open?: boolean | null;
13
- download?: boolean | null;
14
- print?: boolean | null;
15
- pageNavigation?: boolean | null;
16
- zoom?: boolean | null;
17
- panMode?: boolean | null;
18
- search?: boolean | null;
19
- }
20
- export interface DigitalSignatureOptions {
21
- serverUrl: string;
22
- autoDownload?: boolean | null;
23
- apiPassword?: string | null;
24
- }
25
- export interface NestedMessages {
26
- [key: string]: string | NestedMessages;
27
- }
28
- export declare class GemBoxPdfViewer {
29
- private applicationContext;
30
- private static releaseDate;
31
- private static licensing;
32
- constructor(applicationContext: ApplicationContext);
33
- open(document: string | Uint8Array | ArrayBuffer): Promise<void>;
34
- static setLicense(licenseKey: string): void;
35
- private static validate;
36
- static create(options: ViewerOptions): Promise<GemBoxPdfViewer>;
37
- setZoom(zoom: number | "fitPage" | "fitWidth"): void;
38
- setCurrentPage(page: number): void;
39
- getCurrentPage(): number;
40
- getPageCount(): number;
41
- search(text: string | null): void;
42
- }
1
+ /**
2
+ * Represents an annotation in a PDF document.
3
+ */
4
+ export declare interface Annotation {
5
+ /**
6
+ * Gets the index of the page where this annotation is located.
7
+ *
8
+ * @remarks
9
+ * This value represents the zero-based index of the page in the PDF document.
10
+ */
11
+ readonly pageIndex: number;
12
+ /**
13
+ * Gets the type of this annotation.
14
+ *
15
+ * @remarks
16
+ * The annotation type categorizes the annotation (e.g. e-signature).
17
+ */
18
+ readonly type: AnnotationType;
19
+ /**
20
+ * Gets the name or title of this annotation.
21
+ *
22
+ * @remarks
23
+ * This is typically a short descriptive label for the annotation.
24
+ */
25
+ readonly name: string;
26
+ /**
27
+ * Gets the description or content of this annotation.
28
+ *
29
+ * @remarks
30
+ * This contains the main text or content associated with the annotation.
31
+ */
32
+ readonly description: string;
33
+ }
34
+
35
+ /**
36
+ * Represents an event that is emitted when a new annotation has been successfully created.
37
+ *
38
+ * @remarks
39
+ * This event is fired after the annotation has been added to the document,
40
+ * providing access to the fully initialized annotation object.
41
+ */
42
+ export declare interface AnnotationCreatedEvent extends ViewerEvent {
43
+ readonly annotation: Annotation;
44
+ }
45
+
46
+ /**
47
+ * Represents an event that is emitted when a new annotation is being created.
48
+ *
49
+ * @remarks
50
+ * This event is fired before the annotation is actually added to the document,
51
+ * allowing listeners to modify or cancel the creation process through the annotation options.
52
+ */
53
+ export declare interface AnnotationCreatingEvent extends ViewerEvent {
54
+ annotation: AnnotationOptions;
55
+ }
56
+
57
+ /**
58
+ * AnnotationEventMap is an interface used to provide type-safe event listeners and is not instantiated
59
+ * or used directly. It maps event names to their corresponding event object types and
60
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
61
+ *
62
+ * @remarks
63
+ * This interface defines the types of events that can be emitted by the annotations system,
64
+ * including events for when annotations are being created and when they have been successfully created.
65
+ */
66
+ export declare interface AnnotationEventMap {
67
+ /**
68
+ * Event emitted when a new annotation is being created.
69
+ *
70
+ * @remarks
71
+ * This event is fired before the annotation is actually added to the document,
72
+ * allowing listeners to modify or cancel the creation process through the annotation options.
73
+ */
74
+ annotationCreating: AnnotationCreatingEvent;
75
+ /**
76
+ * Event emitted when a new annotation has been successfully created.
77
+ *
78
+ * @remarks
79
+ * This event is fired after the annotation has been added to the document,
80
+ * providing access to the fully initialized annotation object.
81
+ */
82
+ annotationCreated: AnnotationCreatedEvent;
83
+ }
84
+
85
+ /**
86
+ * Represents options for creating or modifying an annotation.
87
+ *
88
+ * @remarks
89
+ * This interface defines the properties needed to configure an annotation,
90
+ * including its location, type, appearance, and content.
91
+ */
92
+ export declare interface AnnotationOptions {
93
+ /**
94
+ * Gets the index of the page where this annotation is located.
95
+ *
96
+ * @remarks
97
+ * This value represents the zero-based index of the page in the PDF document.
98
+ */
99
+ readonly pageIndex: number;
100
+ /**
101
+ * Gets or sets the type of this annotation.
102
+ *
103
+ * @remarks
104
+ * The annotation type categorizes the annotation (e.g., text, highlight, underline).
105
+ */
106
+ readonly type: AnnotationType;
107
+ /**
108
+ * Gets or sets the name or title of this annotation.
109
+ *
110
+ * @remarks
111
+ * This is typically a short descriptive label for the annotation.
112
+ */
113
+ name: string;
114
+ /**
115
+ * Gets or sets the description or content of this annotation.
116
+ *
117
+ * @remarks
118
+ * This contains the main text or content associated with the annotation.
119
+ */
120
+ description: string;
121
+ /**
122
+ * Gets or sets the height of this annotation in points.
123
+ *
124
+ * @remarks
125
+ * This value represents the vertical dimension of the annotation on the page.
126
+ */
127
+ height: number;
128
+ }
129
+
130
+ /**
131
+ * Provides functionality for managing and interacting with PDF annotations.
132
+ *
133
+ * @remarks
134
+ * This class handles the creation, management, and events related to PDF annotations.
135
+ * It provides access to all annotations in the document through the `items` property
136
+ * and manages various annotation services including electronic signatures.
137
+ */
138
+ export declare class Annotations implements EventElement<AnnotationEventMap> {
139
+ /** @inheritdoc */
140
+ addEventListener<K extends keyof AnnotationEventMap>(type: K, listener: (event: AnnotationEventMap[K]) => void): void;
141
+ /**
142
+ * Gets all annotations in the document.
143
+ *
144
+ * @remarks
145
+ * This read-only property returns an array of all annotations currently present in the PDF document.
146
+ * The returned array is immutable and cannot be modified directly. Use the appropriate annotation
147
+ * creation methods to add new annotations to the document.
148
+ */
149
+ get items(): ReadonlyArray<Annotation>;
150
+ }
151
+
152
+ /**
153
+ * Represents the types of annotations that can be added to a PDF document.
154
+ *
155
+ * @remarks
156
+ * This enum defines the various annotation types supported by the PDF viewer.
157
+ */
158
+ export declare enum AnnotationType {
159
+ /**
160
+ * Represents a free text annotation.
161
+ *
162
+ * @remarks
163
+ * This annotation type is used for adding free text to PDF documents.
164
+ */
165
+ FREETEXT,
166
+ /**
167
+ * Represents an electronic signature annotation.
168
+ *
169
+ * @remarks
170
+ * This annotation type is used for adding electronic signatures to PDF documents.
171
+ */
172
+ ESIGNATURE,
173
+ /**
174
+ * Represents a hand drawing annotation.
175
+ *
176
+ * @remarks
177
+ * This annotation type is used for adding hand drawing to PDF documents.
178
+ */
179
+ HANDDRAWING
180
+ }
181
+
182
+ /**
183
+ * Represents the automatic zoom mode value.
184
+ *
185
+ * @remarks
186
+ * This constant is used to indicate that the zoom level should be automatically determined by the viewer.
187
+ */
188
+ export declare const automatic = "automatic";
189
+
190
+ /**
191
+ * Represents a basic button component that can emit events and be clicked.
192
+ *
193
+ * @remarks
194
+ * This abstract class provides the foundation for creating button components in the PDF viewer.
195
+ */
196
+ export declare abstract class BasicButtonUI implements VisibilityElement, EventElement<ButtonEventMap> {
197
+ /**
198
+ * Simulates a click on the button.
199
+ *
200
+ * @returns A promise that resolves when the click operation is complete.
201
+ *
202
+ * @remarks
203
+ * This method emits a `buttonClicking` event. If the event's default action is not prevented,
204
+ * it calls the abstract `onClick` method to handle the actual click logic.
205
+ */
206
+ click(): Promise<void>;
207
+ /** @inheritdoc */
208
+ get isVisible(): boolean;
209
+ /** @inheritdoc */
210
+ set isVisible(value: boolean);
211
+ /** @inheritdoc */
212
+ addEventListener<K extends keyof ButtonEventMap>(type: K, listener: (event: ButtonEventMap[K]) => void): void;
213
+ }
214
+
215
+ /**
216
+ * Represents an event that is emitted when a button is clicked.
217
+ *
218
+ * @remarks
219
+ * This interface defines the structure of the `buttonClicking` event, which includes a reference
220
+ * to the button that was clicked through the `source` property.
221
+ */
222
+ export declare interface ButtonClickingEvent extends ViewerEvent {
223
+ /**
224
+ * The button that was clicked.
225
+ */
226
+ readonly source: BasicButtonUI;
227
+ }
228
+
229
+ /**
230
+ * ButtonEventMap is an interface used to provide type-safe event listeners and is not instantiated
231
+ * or used directly. It maps event names to their corresponding event object types and
232
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
233
+ *
234
+ * @remarks
235
+ * This interface defines the types of events that can be emitted by a button component.
236
+ */
237
+ export declare interface ButtonEventMap {
238
+ /**
239
+ * Event fired when a button is clicked.
240
+ */
241
+ buttonClicking: ButtonClickingEvent;
242
+ }
243
+
244
+ export declare namespace constants {
245
+ export {
246
+ automatic,
247
+ pageFit,
248
+ pageWidth,
249
+ zoomPercentageDropdownValues
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Represents an event that is emitted when a digital signing operation completes successfully.
255
+ *
256
+ * @remarks
257
+ * This event contains the signed PDF document data that can be loaded back into the viewer.
258
+ */
259
+ export declare interface DigitallySignedEvent extends ViewerEvent {
260
+ readonly documentBytes: ArrayBuffer;
261
+ }
262
+
263
+ /**
264
+ * Represents the digital signature panel in the PDF viewer's side panel.
265
+ *
266
+ * @remarks
267
+ * This class provides configuration options for the digital signature panel,
268
+ * including title, description, and button text. It controls whether the panel is visible or hidden.
269
+ */
270
+ export declare class DigitalSignatureUI implements VisibilityElement {
271
+ /** @inheritdoc */
272
+ get isVisible(): boolean;
273
+ /** @inheritdoc */
274
+ set isVisible(value: boolean);
275
+ /**
276
+ * The title of the digital signature section on the side panel.
277
+ *
278
+ * @remarks
279
+ * This property controls the title shown for digital signature on the side panel.
280
+ * When the value is `undefined`, the default translation is used.
281
+ */
282
+ get title(): string | undefined;
283
+ /**
284
+ * The title of the digital signature section on the side panel.
285
+ *
286
+ * @param value - The title text to display, or undefined to clear it.
287
+ *
288
+ * @remarks
289
+ * This property controls the title shown for digital signature on the side panel.
290
+ * When the value is `undefined`, the default translation is used.
291
+ */
292
+ set title(value: string | undefined);
293
+ /**
294
+ * The description of the digital signature section on the side panel.
295
+ *
296
+ * @remarks
297
+ * This property controls the description shown below the title on the side panel.
298
+ * When the value is `undefined`, the default translation is used.
299
+ */
300
+ get description(): string | undefined;
301
+ /**
302
+ * The description of the digital signature section on the side panel.
303
+ *
304
+ * @param value - The description text to display, or undefined to clear it
305
+ *
306
+ * @remarks
307
+ * This property controls the description shown below the title on the side panel.
308
+ * When the value is `undefined`, the default translation is used.
309
+ */
310
+ set description(value: string | undefined);
311
+ /**
312
+ * The text of the button for the digital signature section on the side panel.
313
+ *
314
+ * @remarks
315
+ * This property controls the text shown on the button on the side panel that triggers the signature action.
316
+ * When the value is `undefined`, the default translation is used.
317
+ */
318
+ get buttonText(): string | undefined;
319
+ /**
320
+ * The text of the button for the digital signature section on the side panel.
321
+ *
322
+ * @param value - The button text to display, or undefined to clear it
323
+ *
324
+ * @remarks
325
+ * This property controls the text shown on the button on the side panel that triggers the signature action.
326
+ * When the value is `undefined`, the default translation is used.
327
+ */
328
+ set buttonText(value: string | undefined);
329
+ }
330
+
331
+ /**
332
+ * Represents the configuration options for the digital signature panel in the PDF viewer.
333
+ *
334
+ * @remarks
335
+ * This interface defines the properties that control the visibility and appearance of the
336
+ * digital signature panel, which allows users to sign PDF documents electronically.
337
+ */
338
+ export declare interface DigitalSignatureUIOptions {
339
+ /**
340
+ * Gets or sets a value indicating whether the digital signature panel is visible.
341
+ * Defaults to true if not specified.
342
+ */
343
+ isVisible?: boolean;
344
+ /**
345
+ * Gets or sets the title text displayed in the digital signature panel.
346
+ */
347
+ title?: string;
348
+ /**
349
+ * Gets or sets the description text displayed in the digital signature panel.
350
+ */
351
+ description?: string;
352
+ /**
353
+ * Gets or sets the text displayed on the sign button in the digital signature panel.
354
+ */
355
+ buttonText?: string;
356
+ }
357
+
358
+ /**
359
+ * Provides functionality for digitally signing PDF documents.
360
+ *
361
+ * @remarks
362
+ * This class handles the digital signing process, including communication with a signing server,
363
+ * event handling for signing operations, and management of signing appearance options.
364
+ */
365
+ export declare class DigitalSigning implements EventElement<DigitalSigningEventMap> {
366
+ /**
367
+ * Gets or sets the URL of the digital signing server.
368
+ *
369
+ * @remarks
370
+ * This property specifies the endpoint where PDF documents will be sent for digital signing.
371
+ */
372
+ serverUrl: string;
373
+ /**
374
+ * Gets or sets the API password used to authenticate with the digital signing server.
375
+ *
376
+ * @remarks
377
+ * This password is sent as a Bearer token in the Authorization header when making requests to the signing server.
378
+ * If not set, the user will be prompted to enter a password during the signing process.
379
+ */
380
+ apiPassword?: string;
381
+ /**
382
+ * Gets or sets whether the signed document should be automatically downloaded after successful signing.
383
+ *
384
+ * @remarks
385
+ * When set to true, the signed PDF will be downloaded to the user's device upon completion of the signing process. Defaults to true.
386
+ */
387
+ autoDownload: boolean;
388
+ /**
389
+ * Gets or sets the appearance annotation for the digital signature.
390
+ *
391
+ * @remarks
392
+ * This property allows customization of how the digital signature appears in the PDF document.
393
+ */
394
+ appearance?: Annotation;
395
+ /** @inheritdoc */
396
+ addEventListener<K extends keyof DigitalSigningEventMap>(type: K, listener: (event: DigitalSigningEventMap[K]) => void): void;
397
+ /**
398
+ * Initiates the digital signing process for the current PDF document.
399
+ *
400
+ * @param password - Optional password to override the default API password for this signing operation.
401
+ * @returns A promise that resolves when the signing process is complete.
402
+ *
403
+ * @remarks
404
+ * <ul>
405
+ * <li>Extracts the current PDF document data.</li>
406
+ * <li>Emits a digitalSigning event to allow customization.</li>
407
+ * <li>Sends the document to the signing server.</li>
408
+ * <li>Handles the signed document response.</li>
409
+ * <li>Loads the signed PDF back into the viewer.</li>
410
+ * </ul>
411
+ */
412
+ sign(password?: string): Promise<void>;
413
+ }
414
+
415
+ /**
416
+ * Represents an event that is emitted when a digital signing operation is initiated.
417
+ *
418
+ * @remarks
419
+ * This event contains the PDF document data and optional appearance information for the signature.
420
+ */
421
+ export declare interface DigitalSigningEvent extends ViewerEvent {
422
+ /**
423
+ * Gets the raw bytes of the PDF document to be signed.
424
+ *
425
+ * @remarks
426
+ * This property contains the binary data that will be sent to the signing server for digital signature processing.
427
+ */
428
+ readonly documentBytes: ArrayBuffer;
429
+ /**
430
+ * Gets or sets optional appearance information for the digital signature.
431
+ *
432
+ * @remarks
433
+ * This property can be used to specify how the signature should appear in the PDF document.
434
+ */
435
+ appearanceAnnotation?: Annotation;
436
+ }
437
+
438
+ /**
439
+ * DigitalSigningEventMap is an interface used to provide type-safe event listeners and is not instantiated
440
+ * or used directly. It maps event names to their corresponding event object types and
441
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
442
+ *
443
+ * @remarks
444
+ * This interface defines the types of events that can be emitted during the digital signing process,
445
+ * including the initial signing request and the completion of the signing operation.
446
+ */
447
+ export declare interface DigitalSigningEventMap {
448
+ /**
449
+ * Event emitted when the digital signing process is initiated.
450
+ *
451
+ * @remarks
452
+ * This event contains the PDF document data and optional appearance information before sending to the signing server.
453
+ */
454
+ digitalSigning: DigitalSigningEvent;
455
+ /**
456
+ * Event emitted when the digital signing process completes successfully.
457
+ *
458
+ * @remarks
459
+ * This event contains the signed PDF document data that can be loaded back into the viewer after successful signing.
460
+ */
461
+ digitallySigned: DigitallySignedEvent;
462
+ }
463
+
464
+ /**
465
+ * Represents options for digital signing functionality in the PDF viewer.
466
+ *
467
+ * @remarks
468
+ * These options configure the connection to a digital signing service and control
469
+ * whether signed documents are automatically downloaded after signing.
470
+ */
471
+ export declare interface DigitalSigningOptions {
472
+ /**
473
+ * The URL of the server that provides digital signing services.
474
+ *
475
+ * @remarks
476
+ * This should be the endpoint where the PDF viewer will send documents for signing.
477
+ */
478
+ serverUrl: string;
479
+ /**
480
+ * The API password required to authenticate with the digital signing service.
481
+ *
482
+ * @remarks
483
+ * This password is used to authorize requests to the signing server.
484
+ * If not set, the user will be prompted to enter a password during the signing process.
485
+ */
486
+ apiPassword?: string;
487
+ /**
488
+ * Optional flag indicating whether signed documents should be automatically downloaded.
489
+ *
490
+ * @remarks
491
+ * When set to true, the viewer will automatically download and display the signed document
492
+ * after the signing process completes. Defaults to true if not specified.
493
+ */
494
+ autoDownload?: boolean;
495
+ }
496
+
497
+ /**
498
+ * Represents a download button in the PDF viewer toolbar that allows users to download the current document.
499
+ *
500
+ * @remarks
501
+ * This button triggers the download of the currently loaded PDF document when clicked, providing specific behavior for document downloading.
502
+ */
503
+ export declare class DownloadButtonUI extends BasicButtonUI {
504
+ }
505
+
506
+ /**
507
+ * Represents options for configuring the download button in the PDF viewer.
508
+ *
509
+ * @remarks
510
+ * This interface provides control over whether the download button is visible.
511
+ * It provides a simple way to enable or disable the ability to download the current PDF document from the viewer.
512
+ */
513
+ export declare interface DownloadButtonUIOptions extends VisibilityOption {
514
+ }
515
+
516
+ /**
517
+ * Represents the e-signature element in the PDF viewer's side panel.
518
+ *
519
+ * @remarks
520
+ * This class provides functionality for configuring and displaying an e-signature element,
521
+ * including title, description, and button text.
522
+ */
523
+ export declare class ESignatureUI implements VisibilityElement {
524
+ /** @inheritdoc */
525
+ get isVisible(): boolean;
526
+ /** @inheritdoc */
527
+ set isVisible(value: boolean);
528
+ /**
529
+ * The title of the e-signature section on the side panel.
530
+ *
531
+ * @remarks
532
+ * This property controls the title shown for e-signature on the side panel.
533
+ * When the value is `undefined`, the default translation is used.
534
+ */
535
+ get titleText(): string;
536
+ /**
537
+ * The title of the e-signature section on the side panel.
538
+ *
539
+ * @param value - The title text to display.
540
+ *
541
+ * @remarks
542
+ * This property controls the title shown for e-signature on the side panel.
543
+ * When the value is `undefined`, the default translation is used.
544
+ */
545
+ set titleText(value: string | undefined);
546
+ /**
547
+ * The description of the e-signature section on the side panel.
548
+ *
549
+ * @remarks
550
+ * This property controls the description shown below the title on the side panel.
551
+ * When the value is `undefined`, the default translation is used.
552
+ */
553
+ get descriptionText(): string;
554
+ /**
555
+ * The description of the e-signature section on the side panel.
556
+ *
557
+ * @param value - The description text to display.
558
+ *
559
+ * @remarks
560
+ * This property controls the description shown below the title on the side panel.
561
+ * When the value is `undefined`, the default translation is used.
562
+ */
563
+ set descriptionText(value: string | undefined);
564
+ /**
565
+ * The text of the button for the e-signature section on the side panel.
566
+ *
567
+ * @remarks
568
+ * This property controls the text shown on the button on the side panel that opens e-signature popup.
569
+ * When the value is `undefined`, the default translation is used.
570
+ */
571
+ get buttonText(): string;
572
+ /**
573
+ * The text of the button for the e-signature section on the side panel.
574
+ *
575
+ * @param value - The button text to display.
576
+ *
577
+ * @remarks
578
+ * This property controls the text shown on the button on the side panel that opens e-signature popup.
579
+ * When the value is `undefined`, the default translation is used.
580
+ */
581
+ set buttonText(value: string | undefined);
582
+ }
583
+
584
+ /**
585
+ * Represents options for configuring the electronic signature feature in the PDF viewer.
586
+ *
587
+ * @remarks
588
+ * These options control the visibility and appearance of the electronic signature UI element,
589
+ * allowing customization of labels, descriptions, and button text.
590
+ */
591
+ export declare interface ESignatureUIOptions {
592
+ /**
593
+ * Gets or sets whether the electronic signature panel is visible. Defaults to true if not specified.
594
+ */
595
+ isVisible?: boolean;
596
+ /**
597
+ * Gets or sets the title displayed in the electronic signature panel.
598
+ */
599
+ title?: string;
600
+ /**
601
+ * Gets or sets the description text shown in the electronic signature panel.
602
+ */
603
+ description?: string;
604
+ /**
605
+ * Gets or sets the text displayed on the signature button.
606
+ */
607
+ buttonText?: string;
608
+ }
609
+
610
+ /**
611
+ * An event-emitting interface that allows for type-safe event handling.
612
+ *
613
+ * @typeParam TEventMap - A dictionary type representing the mapping of event names (strings).
614
+ * to their corresponding event data types. Each key in TEventMap represents an event name,
615
+ * and its value represents the type of data associated with that event.
616
+ *
617
+ * @remarks
618
+ * This interface provides a generic way to handle events with strongly-typed event data.
619
+ * It supports both synchronous and asynchronous event listeners, allowing for flexible
620
+ * event handling patterns.
621
+ */
622
+ export declare interface EventElement<TEventMap extends {
623
+ [key: string]: any;
624
+ }> {
625
+ /**
626
+ * Adds an event listener for the specified event type.
627
+ *
628
+ * @param type - The event type/name to listen for.
629
+ * @param listener - The callback function that will be invoked when the event is emitted.
630
+ *
631
+ * @remarks
632
+ * Multiple listeners can be registered for the same event type.
633
+ * The listener will be called with the strongly-typed event data when the event is emitted.
634
+ */
635
+ addEventListener<K extends keyof TEventMap & string>(type: K, listener: (event: TEventMap[K]) => void): void;
636
+ }
637
+
638
+ /**
639
+ * Provides access to various features available in the PDF viewer.
640
+ *
641
+ * @remarks
642
+ * This class contains references to feature modules that handle specific aspects of PDF viewing and manipulation,
643
+ * such as annotations, digital signing, zoom controls, page navigation, and search functionality.
644
+ */
645
+ export declare class Features {
646
+ /**
647
+ * Gets the annotations feature module.
648
+ *
649
+ * @remarks
650
+ * Provides functionality for working with PDF annotations including highlighting, underlining, sticky notes, etc.
651
+ */
652
+ readonly annotations: Annotations;
653
+ /**
654
+ * Gets the digital signing feature module (if enabled).
655
+ *
656
+ * @remarks
657
+ * Provides functionality for digitally signing PDF documents. This property is optional and only available when
658
+ * digital signing is configured in the viewer options.
659
+ */
660
+ readonly digitalSigning?: DigitalSigning;
661
+ /**
662
+ * Gets the zoom feature module.
663
+ *
664
+ * @remarks
665
+ * Provides functionality for zooming and scaling the PDF document view.
666
+ */
667
+ readonly zoom: Zoom;
668
+ /**
669
+ * Gets the page navigation feature module.
670
+ *
671
+ * @remarks
672
+ * Provides functionality for navigating between pages in the PDF document.
673
+ */
674
+ readonly page: PageNavigation;
675
+ /**
676
+ * Gets the search feature module.
677
+ *
678
+ * @remarks
679
+ * Provides functionality for searching text within the PDF document.
680
+ */
681
+ readonly search: Search;
682
+ }
683
+
684
+ /**
685
+ * Represents the configuration options for various features available in the PDF viewer.
686
+ *
687
+ * @remarks
688
+ * This interface provides access to configure different features such as digital signing functionality.
689
+ * It allows you to enable or disable specific features and customize their behavior.
690
+ */
691
+ export declare interface FeaturesOptions {
692
+ /**
693
+ * Gets or sets the options for digital signing functionality.
694
+ *
695
+ * @remarks
696
+ * This property configures the connection to a digital signing service and controls whether signed documents are automatically downloaded after signing.
697
+ * If not set, the digital signing feature will not be available.
698
+ */
699
+ digitalSigning?: DigitalSigningOptions;
700
+ }
701
+
702
+ /**
703
+ * Represents the free text annotation component in the PDF viewer's toolbar.
704
+ *
705
+ * @remarks
706
+ * This class provides functionality for configuring and managing free text annotations,
707
+ * including visibility control, font size, color settings, and an add button for creating new annotations.
708
+ */
709
+ export declare class FreeTextUI implements VisibilityElement {
710
+ /** @inheritdoc */
711
+ get isVisible(): boolean;
712
+ /** @inheritdoc */
713
+ set isVisible(value: boolean);
714
+ }
715
+
716
+ /**
717
+ * Represents options for configuring the free text annotation feature in the PDF viewer.
718
+ *
719
+ * @remarks
720
+ * This interface provides control over whether the free text annotation controls are visible.
721
+ * It allows users to enable or disable the ability to add and configure free text annotations in the viewer.
722
+ */
723
+ export declare interface FreeTextUIOptions extends VisibilityOption {
724
+ }
725
+
726
+ /**
727
+ * Represents the main PDF viewer class that provides functionality for displaying and interacting with PDF documents.
728
+ */
729
+ export declare class GemBoxPdfViewer {
730
+ /**
731
+ * Gets the features available in the PDF viewer.
732
+ *
733
+ * @remarks
734
+ * This property provides access to various features such as annotations, digital signing, zoom, page navigation, and search functionality.
735
+ */
736
+ readonly features: Features;
737
+ /**
738
+ * Gets the user interface components of the PDF viewer.
739
+ *
740
+ * @remarks
741
+ * This property provides access to UI elements like theme, toolbar, and side panel configuration.
742
+ */
743
+ readonly ui: UI;
744
+ /**
745
+ * Opens a PDF document for viewing.
746
+ *
747
+ * @param document - The PDF document to open, which can be a string (URL or base64), Uint8Array, or ArrayBuffer.
748
+ * @returns A promise that resolves when the document is successfully loaded and rendered.
749
+ *
750
+ * @remarks
751
+ * This method loads the specified PDF document into the viewer. The document can be provided as:
752
+ * <ul>
753
+ * <li>A URL string pointing to a PDF file.</li>
754
+ * <li>A base64 encoded string representing the PDF content.</li>
755
+ * <li>A Uint8Array containing the raw PDF bytes.</li>
756
+ * <li>An ArrayBuffer containing the raw PDF data.</li>
757
+ * </ul>
758
+ */
759
+ open(document: string | Uint8Array | ArrayBuffer): Promise<void>;
760
+ /**
761
+ * Sets the license (serial) key for the GemBox.PdfViewer.
762
+ *
763
+ * @param licenseKey - The serial key to use for licensing.
764
+ *
765
+ * @remarks
766
+ * <para>You should call this method before creating any PDF Viewer instance.</para>
767
+ * <para>Key can only be set once (if you try to set another key, it will be ignored).</para>
768
+ * <para>The best place to call this method is during application initialization, before calling `GemBoxPdfViewer.create()`.</para>
769
+ * <para>Valid serial key has multiple groups of alphanumeric characters, separated with dashes.</para>
770
+ * <para>To use the assembly in free limited mode, use `FREE-LIMITED-KEY` as `licenseKey`.</para>
771
+ */
772
+ static setLicense(licenseKey: string): void;
773
+ /**
774
+ * Creates a new instance of the PDF viewer and initializes it with the specified options.
775
+ *
776
+ * @param options - The configuration options for the PDF viewer.
777
+ * @returns A promise that resolves to a new GemBoxPdfViewer instance.
778
+ *
779
+ * @remarks
780
+ * This static method creates and initializes a new PDF viewer instance. It:
781
+ * <ul>
782
+ * <li>Validates the license key.</li>
783
+ * <li>Sets up the Vue application.</li>
784
+ * <li>Initializes worker threads for PDF processing.</li>
785
+ * <li>Mounts the viewer to the specified container element.</li>
786
+ * </li>
787
+ *
788
+ * The options parameter allows you to configure various aspects of the viewer including UI elements, features, and initial document.
789
+ */
790
+ static create(options: ViewerOptions): Promise<GemBoxPdfViewer>;
791
+ }
792
+
793
+ /**
794
+ * Represents the hand drawing annotation component in the PDF viewer's toolbar.
795
+ *
796
+ * @remarks
797
+ * This class provides functionality for configuring and managing hand-drawn annotations,
798
+ * including visibility control, color, thickness, opacity settings, and an add button for creating new drawings.
799
+ */
800
+ export declare class HandDrawingUI implements VisibilityElement {
801
+ /** @inheritdoc */
802
+ get isVisible(): boolean;
803
+ /** @inheritdoc */
804
+ set isVisible(value: boolean);
805
+ }
806
+
807
+ /**
808
+ * Represents options for configuring the hand drawing annotation feature in the PDF viewer.
809
+ *
810
+ * @remarks
811
+ * This interface provides control over whether the hand drawing annotation controls are visible.
812
+ * It allows users to enable or disable the ability to add and configure hand-drawn annotations in the viewer.
813
+ */
814
+ export declare interface HandDrawingUIOptions extends VisibilityOption {
815
+ }
816
+
817
+ /**
818
+ * Represents nested message structures where each key can map to either a string or another nested messages object.
819
+ *
820
+ * @remarks
821
+ * This type is commonly used for localization and internationalization purposes, allowing for hierarchical message structures.
822
+ */
823
+ export declare type NestedMessages = {
824
+ [key: string]: string | NestedMessages;
825
+ };
826
+
827
+ /**
828
+ * Represents a button in the PDF viewer toolbar that opens file dialog for loading PDF documents.
829
+ *
830
+ * @remarks
831
+ * This button allows users to select and open PDF files from their local system,
832
+ * providing specific behavior for file selection and loading.
833
+ */
834
+ export declare class OpenButtonUI extends BasicButtonUI {
835
+ }
836
+
837
+ /**
838
+ * Represents options for configuring the open button in the PDF viewer.
839
+ *
840
+ * @remarks
841
+ * This interface provides control over whether the open button is visible.
842
+ * It provides a simple way to enable or disable the ability to open new PDF documents in the viewer.
843
+ */
844
+ export declare interface OpenButtonUIOptions extends VisibilityOption {
845
+ }
846
+
847
+ /**
848
+ * Event triggered when changing pages in a PDF document.
849
+ *
850
+ * @remarks
851
+ * This event provides access to both previous and target page numbers during navigation,
852
+ * allowing listeners to cancel or modify the page change before it occurs.
853
+ */
854
+ export declare interface PageChangingEvent extends ViewerEvent {
855
+ /**
856
+ * Gets the zero-based index of the page that was previously active before navigation.
857
+ *
858
+ * @remarks
859
+ * This property represents the page index (zero-based) from which the navigation originated.
860
+ */
861
+ readonly previousPage: number;
862
+ /**
863
+ * The target page index (zero-based index). Can be modified to change the destination page.
864
+ */
865
+ page: number;
866
+ }
867
+
868
+ /**
869
+ * PageEventMap is an interface used to provide type-safe event listeners and is not instantiated
870
+ * or used directly. It maps event names to their corresponding event object types and
871
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
872
+ *
873
+ * @remarks
874
+ * This interface defines the structure of events that can be emitted by the Page class,
875
+ * specifically the pageChanging event which is triggered when the current page is about to change.
876
+ */
877
+ export declare interface PageEventMap {
878
+ /**
879
+ * Event triggered when the current page is about to change.
880
+ *
881
+ * @remarks
882
+ * This event is emitted before navigating to a new page, allowing listeners to cancel
883
+ * or modify the navigation. The event contains information about both the previous and target pages.
884
+ */
885
+ pageChanging: PageChangingEvent;
886
+ }
887
+
888
+ /**
889
+ * Represents the page fit zoom mode value.
890
+ *
891
+ * @remarks
892
+ * This constant is used to indicate that the zoom level should fit the entire page within the viewport.
893
+ */
894
+ export declare const pageFit = "pageFit";
895
+
896
+ /**
897
+ * Provides functionality for managing and navigating through pages in a PDF document.
898
+ *
899
+ * @remarks
900
+ * This class handles page navigation, including setting the current page, moving to next/previous pages,
901
+ * and emitting events when page changes occur. It extends EventElement to support event-based communication.
902
+ */
903
+ export declare class PageNavigation implements EventElement<PageEventMap> {
904
+ /** @inheritdoc */
905
+ addEventListener<K extends keyof PageEventMap>(type: K, listener: (event: PageEventMap[K]) => void): void;
906
+ /**
907
+ * Gets the total number of pages in the currently loaded PDF document.
908
+ *
909
+ * @remarks
910
+ * This property returns the count of pages available in the document. The value is updated
911
+ * automatically when a new document is loaded or when the page count changes.
912
+ */
913
+ get numberOfPages(): number;
914
+ /**
915
+ * Gets the current page index that is being displayed.
916
+ *
917
+ * @remarks
918
+ * This property returns the zero-based index of the currently active page. The value is updated
919
+ * automatically when navigation occurs or when a new page is set programmatically.
920
+ */
921
+ get currentPage(): number;
922
+ /**
923
+ * Sets the current page to display in the PDF viewer.
924
+ *
925
+ * @param page - The page index to navigate to (zero-based index).
926
+ *
927
+ * @remarks
928
+ * This method changes the currently displayed page. It validates that the requested page index
929
+ * is within bounds before attempting to change pages. If the page index is invalid, the method
930
+ * returns without making any changes.
931
+ *
932
+ * The method emits a pageChanging event before changing the page, allowing listeners to cancel
933
+ * or modify the navigation. If the event is not prevented, the current page index is updated.
934
+ * The method also handles the case where the page index is out of bounds and prevents invalid navigation.
935
+ */
936
+ setCurrentPage(page: number): void;
937
+ /**
938
+ * Navigates to the next page in the PDF document.
939
+ *
940
+ * @remarks
941
+ * This convenience method increments the current page index by 1 and calls setPage internally.
942
+ * If already on the last page, this method has no effect.
943
+ */
944
+ nextPage(): void;
945
+ /**
946
+ * Navigates to the previous page in the PDF document.
947
+ *
948
+ * @remarks
949
+ * This convenience method decrements the current page index by 1 and calls setPage internally.
950
+ * If already on the first page, this method has no effect.
951
+ */
952
+ previousPage(): void;
953
+ }
954
+
955
+ /**
956
+ * Represents page navigation controls for the viewer toolbar.
957
+ */
958
+ export declare class PageNavigationUI implements VisibilityElement {
959
+ /** @inheritdoc */
960
+ get isVisible(): boolean;
961
+ /** @inheritdoc */
962
+ set isVisible(value: boolean);
963
+ }
964
+
965
+ /**
966
+ * Represents options for configuring the page navigation controls in the PDF viewer.
967
+ *
968
+ * @remarks
969
+ * This interface provides control over whether the page navigation controls are visible.
970
+ * It provides a simple way to enable or disable the ability to navigate between pages in the viewer.
971
+ */
972
+ export declare interface PageNavigationUIOptions extends VisibilityOption {
973
+ }
974
+
975
+ /**
976
+ * Represents the page width zoom mode value.
977
+ *
978
+ * @remarks
979
+ * This constant is used to indicate that the zoom level should fit the page width within the viewport.
980
+ */
981
+ export declare const pageWidth = "pageWidth";
982
+
983
+ /**
984
+ * Represents a button in the PDF viewer toolbar that enables pan mode for document navigation.
985
+ *
986
+ * @remarks
987
+ * This button allows users to switch to pan mode, which enables dragging and panning through the document,
988
+ * providing specific behavior for cursor mode switching.
989
+ */
990
+ export declare class PanModeButtonUI extends BasicButtonUI {
991
+ }
992
+
993
+ /**
994
+ * Represents options for configuring the pan mode button in the PDF viewer.
995
+ *
996
+ * @remarks
997
+ * This interface provides control over whether the pan mode button is visible.
998
+ * It provides a simple way to enable or disable the ability to switch to pan mode in the viewer.
999
+ */
1000
+ export declare interface PanModeButtonUIOptions extends VisibilityOption {
1001
+ }
1002
+
1003
+ /**
1004
+ * Represents a button in the PDF viewer toolbar that allows users to print the current document.
1005
+ *
1006
+ * @remarks
1007
+ * This button triggers the printing functionality for the currently loaded PDF document when clicked,
1008
+ * providing specific behavior for document printing.
1009
+ */
1010
+ export declare class PrintButtonUI extends BasicButtonUI {
1011
+ }
1012
+
1013
+ /**
1014
+ * Represents options for configuring the print button in the PDF viewer.
1015
+ *
1016
+ * @remarks
1017
+ * This interface provides control over whether the print button is visible.
1018
+ * It provides a simple way to enable or disable the ability to print the current PDF document from the viewer.
1019
+ */
1020
+ export declare interface PrintButtonUIOptions extends VisibilityOption {
1021
+ }
1022
+
1023
+ /**
1024
+ * Provides search functionality for finding text within PDF documents.
1025
+ *
1026
+ * @remarks
1027
+ * The Search class enables users to search for specific text within a PDF document,
1028
+ * navigate between search results, and receive notifications about search progress
1029
+ * through events. It integrates with the underlying PDF.js library to perform
1030
+ * the actual search operations.
1031
+ */
1032
+ export declare class Search implements EventElement<SearchEventMap> {
1033
+ /** @inheritdoc */
1034
+ addEventListener<K extends keyof SearchEventMap>(type: K, listener: (event: SearchEventMap[K]) => void): void;
1035
+ /**
1036
+ * Gets the current search query text.
1037
+ *
1038
+ * @remarks
1039
+ * This property returns the text that is currently being searched for in the document.
1040
+ */
1041
+ get query(): string;
1042
+ /**
1043
+ * Gets the current position in the search results.
1044
+ *
1045
+ * @remarks
1046
+ * This property returns the index of the currently selected search result (zero-based).
1047
+ */
1048
+ get currentMatch(): number;
1049
+ /**
1050
+ * Gets the total number of search matches found.
1051
+ *
1052
+ * @remarks
1053
+ * This property returns the total count of all matches for the current search query.
1054
+ */
1055
+ get matchCount(): number;
1056
+ /**
1057
+ * Starts a new search operation with the specified query.
1058
+ *
1059
+ * @param query - The text to search for in the document. If undefined or empty, any active search is cancelled and cleared.
1060
+ *
1061
+ * @remarks
1062
+ * This method initiates a search for the specified query text. It emits a {@link SearchStartingEvent}
1063
+ * before performing the search, allowing listeners to cancel the operation if needed.
1064
+ * If the query is undefined or empty, it cancels any active search and clears the search state.
1065
+ */
1066
+ search(query: string | undefined): void;
1067
+ /**
1068
+ * Navigates to the next search match in the document.
1069
+ *
1070
+ * @remarks
1071
+ * This method moves the selection to the next occurrence of the current search query.
1072
+ * If there are no more matches after the current position, this method has no effect.
1073
+ */
1074
+ nextMatch(): void;
1075
+ /**
1076
+ * Navigates to the previous search match in the document.
1077
+ *
1078
+ * @remarks
1079
+ * This method moves the selection to the previous occurrence of the current search query.
1080
+ * If there are no matches before the current position, this method has no effect.
1081
+ */
1082
+ previousMatch(): void;
1083
+ /**
1084
+ * Ends the current search operation and clears all search state.
1085
+ *
1086
+ * @remarks
1087
+ * This method stops any active search, clears the query text, resets the match counter,
1088
+ * and hides the search UI elements. It should be called when search is no longer needed.
1089
+ */
1090
+ clear(): void;
1091
+ }
1092
+
1093
+ /**
1094
+ * Event emitted when a search operation is cancelled.
1095
+ *
1096
+ * @remarks
1097
+ * This event is fired when an active search is cancelled, either by the user
1098
+ * or programmatically. It indicates that no search results are currently available.
1099
+ */
1100
+ export declare interface SearchCancelledEvent {
1101
+ }
1102
+
1103
+ /**
1104
+ * Event emitted when a search operation completes.
1105
+ *
1106
+ * @remarks
1107
+ * This event is fired after a search operation finishes, containing information about
1108
+ * the search results including the query text, current match position, and total matches found.
1109
+ */
1110
+ export declare interface SearchCompletedEvent {
1111
+ /**
1112
+ * The search query text that was used to find matches in the document.
1113
+ *
1114
+ * @remarks
1115
+ * This property contains the actual query string that was searched for,
1116
+ * allowing consumers of this event to know what text produced the results.
1117
+ */
1118
+ readonly query: string;
1119
+ /**
1120
+ * The current position/index of the selected search match (0-based).
1121
+ *
1122
+ * @remarks
1123
+ * This property indicates which specific match is currently highlighted or selected
1124
+ * in the document. It's useful for tracking navigation through search results.
1125
+ */
1126
+ readonly currentPosition: number;
1127
+ /**
1128
+ * The total number of matches found for the search query.
1129
+ *
1130
+ * @remarks
1131
+ * This property provides the complete count of all occurrences of the search term
1132
+ * throughout the entire document, allowing UI elements to display progress information.
1133
+ */
1134
+ readonly matchCount: number;
1135
+ }
1136
+
1137
+ /**
1138
+ * SearchEventMap is an interface used to provide type-safe event listeners and is not instantiated
1139
+ * or used directly. It maps event names to their corresponding event object types and
1140
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
1141
+ *
1142
+ * @remarks
1143
+ * This interface defines the types of events that can be emitted during search operations,
1144
+ * including when a search starts, is cancelled, or completes.
1145
+ */
1146
+ export declare interface SearchEventMap {
1147
+ /**
1148
+ * Event emitted when a search operation is starting.
1149
+ *
1150
+ * @remarks
1151
+ * This event is fired before the actual search begins, allowing listeners to cancel
1152
+ * or modify the search operation. The event contains the query text that will be searched for.
1153
+ */
1154
+ searchStarting: SearchStartingEvent;
1155
+ /**
1156
+ * Event emitted when a search operation is cancelled.
1157
+ *
1158
+ * @remarks
1159
+ * This event is fired when an active search is cancelled, either by the user
1160
+ * or programmatically. It indicates that no search results are currently available.
1161
+ */
1162
+ searchCancelled: SearchCancelledEvent;
1163
+ /**
1164
+ * Event emitted when a search operation completes.
1165
+ *
1166
+ * @remarks
1167
+ * This event is fired after a search operation finishes, containing information about
1168
+ * the search results including the query text, current match position, and total matches found.
1169
+ */
1170
+ searchCompleted: SearchCompletedEvent;
1171
+ }
1172
+
1173
+ /**
1174
+ * Event emitted when a search operation is starting.
1175
+ *
1176
+ * @remarks
1177
+ * This event is fired before the actual search begins, allowing listeners to cancel
1178
+ * or modify the search operation. The event contains the query text that will be searched for.
1179
+ */
1180
+ export declare interface SearchStartingEvent extends ViewerEvent {
1181
+ /**
1182
+ * The search query text that will be searched for in the document.
1183
+ *
1184
+ * @remarks
1185
+ * This property contains the text that users want to find within the PDF document.
1186
+ */
1187
+ query: string;
1188
+ }
1189
+
1190
+ /**
1191
+ * Represents search controls for the viewer toolbar.
1192
+ */
1193
+ export declare class SearchUI implements VisibilityElement {
1194
+ /** @inheritdoc */
1195
+ get isVisible(): boolean;
1196
+ /** @inheritdoc */
1197
+ set isVisible(value: boolean);
1198
+ }
1199
+
1200
+ /**
1201
+ * Represents options for configuring the search functionality in the PDF viewer.
1202
+ *
1203
+ * @remarks
1204
+ * This interface provides control over whether the search button is visible.
1205
+ * It provides a simple way to enable or disable the search feature in the viewer.
1206
+ */
1207
+ export declare interface SearchUIOptions extends VisibilityOption {
1208
+ }
1209
+
1210
+ /**
1211
+ * Represents a button that toggles the visibility of the side panel in the PDF viewer.
1212
+ *
1213
+ * @remarks
1214
+ * This button handles side panel visibility toggling.
1215
+ * When clicked, it emits an event to toggle the side panel's visibility state.
1216
+ */
1217
+ export declare class SidePanelButtonUI extends BasicButtonUI {
1218
+ }
1219
+
1220
+ /**
1221
+ * Represents options for configuring the side panel button in the PDF viewer.
1222
+ *
1223
+ * @remarks
1224
+ * This interface provides control over whether the side panel button is visible.
1225
+ * It provides a simple way to enable or disable the ability to access the side panel from the viewer.
1226
+ */
1227
+ export declare interface SidePanelButtonUIOptions extends VisibilityOption {
1228
+ }
1229
+
1230
+ /**
1231
+ * Represents the different types of panels that can be displayed in the side panel.
1232
+ *
1233
+ * @remarks
1234
+ * This enum defines the available panel types for the side panel component, including
1235
+ * thumbnails, bookmarks, and signature panels.
1236
+ */
1237
+ export declare enum SidePanelType {
1238
+ /**
1239
+ * The thumbnail panel type.
1240
+ *
1241
+ * @remarks
1242
+ * Displays thumbnail images of all pages in the PDF document.
1243
+ */
1244
+ THUMBNAIL = 1,
1245
+ /**
1246
+ * The bookmarks panel type.
1247
+ *
1248
+ * @remarks
1249
+ * Displays a hierarchical list of bookmarks/outline items from the PDF document.
1250
+ */
1251
+ BOOKMARKS = 2
1252
+ }
1253
+
1254
+ /**
1255
+ * Represents the side panel component of the PDF viewer.
1256
+ *
1257
+ * @remarks
1258
+ * This class manages the side panel UI element, including its visibility, pinned state,
1259
+ * and the currently active panel type (thumbnails, bookmarks, etc.).
1260
+ */
1261
+ export declare class SidePanelUI implements VisibilityElement {
1262
+ /**
1263
+ * Gets the digital signature component of the side panel.
1264
+ *
1265
+ * @remarks
1266
+ * This property provides access to the digital signature functionality and configuration.
1267
+ */
1268
+ readonly digitalSignature: DigitalSignatureUI;
1269
+ /**
1270
+ * Gets the electronic signature component of the side panel.
1271
+ *
1272
+ * @remarks
1273
+ * This property provides access to the electronic signature functionality and configuration.
1274
+ */
1275
+ readonly eSignature: ESignatureUI;
1276
+ /**
1277
+ * The value indicating whether the side panel is visible.
1278
+ *
1279
+ * @remarks
1280
+ * When setting this property to false, the panel will be unpinned and reset to show thumbnails.
1281
+ */
1282
+ get isVisible(): boolean;
1283
+ /**
1284
+ * The value indicating whether the side panel is visible.
1285
+ *
1286
+ * @remarks
1287
+ * When setting this property to false, the panel will be unpinned and reset to show thumbnails.
1288
+ *
1289
+ * @param value - The boolean value to set for visibility
1290
+ */
1291
+ set isVisible(value: boolean);
1292
+ /**
1293
+ * The value indicating whether the side panel is pinned open.
1294
+ *
1295
+ * @remarks
1296
+ * When pinned, the side panel remains visible even when not actively used. When unpinned,
1297
+ * the panel will close automatically after inactivity.
1298
+ */
1299
+ get isPinned(): boolean;
1300
+ /**
1301
+ * The value indicating whether the side panel is pinned open.
1302
+ *
1303
+ * @param value - The boolean value to set for pinned state
1304
+ */
1305
+ set isPinned(value: boolean);
1306
+ /**
1307
+ * The active {@link SidePanelType} for the side panel.
1308
+ *
1309
+ * @remarks
1310
+ * This property determines which sub-panel is currently being displayed within
1311
+ * the side panel, such as thumbnails or bookmarks.
1312
+ */
1313
+ get activeSidePanelType(): SidePanelType;
1314
+ /**
1315
+ * The active {@link SidePanelType} for the side panel.
1316
+ *
1317
+ * @param value - The {@link SidePanelType} to set as active
1318
+ *
1319
+ * @remarks
1320
+ * This property determines which sub-panel is currently being displayed within
1321
+ * the side panel, such as thumbnails or bookmarks.
1322
+ */
1323
+ set activeSidePanelType(value: SidePanelType);
1324
+ }
1325
+
1326
+ /**
1327
+ * Represents configuration options for the side panel in the PDF viewer.
1328
+ *
1329
+ * @remarks
1330
+ * The side panel provides access to additional features like electronic signatures and digital signatures.
1331
+ * This interface allows you to control the visibility of the side panel and configure the available features.
1332
+ */
1333
+ export declare interface SidePanelUIOptions {
1334
+ /**
1335
+ * Gets or sets a value indicating whether the side panel is visible.
1336
+ * Defaults to false if not specified.
1337
+ */
1338
+ isVisible?: boolean;
1339
+ /**
1340
+ * Gets or sets options for electronic signature functionality on the side panel.
1341
+ */
1342
+ eSignature?: ESignatureUIOptions;
1343
+ /**
1344
+ * Gets or sets options for digital signature functionality on the side panel.
1345
+ */
1346
+ digitalSignature?: DigitalSignatureUIOptions;
1347
+ }
1348
+
1349
+ /**
1350
+ * Represents a button in the PDF viewer toolbar that opens the signature panel for digital signing and e-signature.
1351
+ *
1352
+ * @remarks
1353
+ * This button allows users to access digital signature and e-signature functionality,
1354
+ * enabling them to add e-signatures and sign documents electronically.
1355
+ */
1356
+ export declare class SignatureButtonUI extends BasicButtonUI {
1357
+ }
1358
+
1359
+ /**
1360
+ * Represents options for configuring the signature button in the PDF viewer toolbar.
1361
+ *
1362
+ * @remarks
1363
+ * This interface provides control over whether the signature button is visible.
1364
+ * It provides a simple way to enable or disable the ability to add electronic signatures or signing the PDF document from the viewer.
1365
+ */
1366
+ export declare interface SignatureButtonUIOptions extends VisibilityOption {
1367
+ }
1368
+
1369
+ /**
1370
+ * Represents a button in the PDF viewer toolbar that enables text selection mode.
1371
+ *
1372
+ * @remarks
1373
+ * This button allows users to switch to text selection mode, which enables selecting and copying text from the document,
1374
+ * providing specific behavior for cursor mode switching.
1375
+ */
1376
+ export declare class TextSelectionButtonUI extends BasicButtonUI {
1377
+ }
1378
+
1379
+ /**
1380
+ * Represents options for configuring the text selection button in the PDF viewer toolbar.
1381
+ *
1382
+ * @remarks
1383
+ * This interface provides control over whether the text selection button is visible.
1384
+ * It provides a simple way to enable or disable the ability to switch to text selection in the viewer.
1385
+ */
1386
+ export declare interface TextSelectionButtonUIOptions extends VisibilityOption {
1387
+ }
1388
+
1389
+ /**
1390
+ * Represents the available theme options for the PDF viewer UI.
1391
+ *
1392
+ * @remarks
1393
+ * Themes control the color scheme and appearance of the viewer interface. Available themes include light, dark, and various colored variants.
1394
+ */
1395
+ export declare type Theme = "light" | "dark" | "red" | "dark-red" | "blue" | "dark-blue" | "green" | "dark-green";
1396
+
1397
+ /**
1398
+ * Represents the toolbar component in the PDF viewer that contains various buttons and controls for document interaction.
1399
+ */
1400
+ export declare class ToolbarUI {
1401
+ /**
1402
+ * Gets the side panel button that toggles the visibility of the side panel.
1403
+ */
1404
+ readonly sidePanelButton: SidePanelButtonUI;
1405
+ /**
1406
+ * Gets the open button that allows users to select and open PDF files from their local system.
1407
+ */
1408
+ readonly openButton: OpenButtonUI;
1409
+ /**
1410
+ * Gets the download button that triggers the download of the currently loaded PDF document.
1411
+ */
1412
+ readonly downloadButton: DownloadButtonUI;
1413
+ /**
1414
+ * Gets the print button that initiates the printing functionality for the current document.
1415
+ */
1416
+ readonly printButton: PrintButtonUI;
1417
+ /**
1418
+ * Gets the signature button that opens the digital signature panel for electronic signing.
1419
+ */
1420
+ readonly signatureButton: SignatureButtonUI;
1421
+ /**
1422
+ * Gets the free text annotation controls for adding and configuring free text annotations.
1423
+ *
1424
+ * @remarks
1425
+ * The free text controls allow users to add, edit, and customize free text annotations in PDF documents.
1426
+ */
1427
+ readonly freeText: FreeTextUI;
1428
+ /**
1429
+ * Gets the hand drawing annotation controls for adding and configuring freehand drawings.
1430
+ *
1431
+ * @remarks
1432
+ * The hand drawing controls allow users to create, edit, and customize freehand drawings in PDF documents.
1433
+ */
1434
+ readonly handDrawing: HandDrawingUI;
1435
+ /**
1436
+ * Gets the text selection button that enables text selection mode for copying text from the document.
1437
+ */
1438
+ readonly textSelectionButton: TextSelectionButtonUI;
1439
+ /**
1440
+ * Gets the pan mode button that enables dragging and panning through the document.
1441
+ */
1442
+ readonly panModeButton: PanModeButtonUI;
1443
+ /**
1444
+ * Gets the zoom controls that manage document magnification.
1445
+ *
1446
+ * @remarks
1447
+ * The zoom controls appear as buttons, field, and dropdown in the toolbar
1448
+ * and control the zoom level of the PDF document.
1449
+ */
1450
+ readonly zoom: ZoomUI;
1451
+ /**
1452
+ * Gets the page navigation controls for moving between pages in the document.
1453
+ *
1454
+ * @remarks
1455
+ * The navigation controls appear as buttons in the toolbar and control the visual
1456
+ * representation of which page is currently displayed in the HTML view.
1457
+ */
1458
+ readonly pageNavigation: PageNavigationUI;
1459
+ /**
1460
+ * Gets the search controls for finding text within the document.
1461
+ *
1462
+ * @remarks
1463
+ * The search controls appear as input fields and buttons in the toolbar and control
1464
+ * the visual highlighting of search results within the HTML-rendered PDF content.
1465
+ */
1466
+ readonly search: SearchUI;
1467
+ }
1468
+
1469
+ /**
1470
+ * Configuration options for the toolbar in the PDF viewer.
1471
+ *
1472
+ * @remarks
1473
+ * This interface defines all available toolbar buttons and their configuration options,
1474
+ * allowing customization of which buttons or elements appear and how they behave. Each property is optional,
1475
+ * enabling selective inclusion of toolbar functionality based on application requirements.
1476
+ */
1477
+ export declare interface ToolbarUIOptions {
1478
+ /**
1479
+ * Options for the side panel button in the toolbar.
1480
+ */
1481
+ sidePanelButton?: SidePanelButtonUIOptions;
1482
+ /**
1483
+ * Options for the open button in the toolbar.
1484
+ */
1485
+ openButton?: OpenButtonUIOptions;
1486
+ /**
1487
+ * Options for the download button in the toolbar.
1488
+ */
1489
+ downloadButton?: DownloadButtonUIOptions;
1490
+ /**
1491
+ * Options for the print button in the toolbar.
1492
+ */
1493
+ printButton?: PrintButtonUIOptions;
1494
+ /**
1495
+ * Options for the signature button in the toolbar.
1496
+ */
1497
+ signatureButton?: SignatureButtonUIOptions;
1498
+ /**
1499
+ * All page navigation options including first, previous, next, and last page buttons.
1500
+ */
1501
+ pageNavigation?: PageNavigationUIOptions;
1502
+ /**
1503
+ * All zooming options including zoom in, zoom out, and fit width/height buttons.
1504
+ */
1505
+ zoom?: ZoomUIOptions;
1506
+ /**
1507
+ * Options for the text selection button in the toolbar.
1508
+ */
1509
+ textSelectionButton?: TextSelectionButtonUIOptions;
1510
+ /**
1511
+ * Options for the pan mode button in the toolbar.
1512
+ */
1513
+ panModeButton?: PanModeButtonUIOptions;
1514
+ /**
1515
+ * Options for the search functionality in the toolbar.
1516
+ */
1517
+ search?: SearchUIOptions;
1518
+ /**
1519
+ * Options for the free text annotation feature in the toolbar.
1520
+ *
1521
+ * @remarks
1522
+ * This property configures the visibility and behavior of free text annotation controls,
1523
+ * allowing users to add and customize free text annotations in PDF documents.
1524
+ */
1525
+ freeText?: FreeTextUIOptions;
1526
+ /**
1527
+ * Options for the hand drawing annotation feature in the toolbar.
1528
+ *
1529
+ * @remarks
1530
+ * This property configures the visibility and behavior of hand drawing annotation controls,
1531
+ * allowing users to add and customize freehand drawings in PDF documents.
1532
+ */
1533
+ handDrawing?: HandDrawingUIOptions;
1534
+ }
1535
+
1536
+ /**
1537
+ * Provides access to user interface components and configuration options for the PDF viewer.
1538
+ *
1539
+ * @remarks
1540
+ * This class contains references to UI elements that can be customized, including theme settings,
1541
+ * toolbar configuration, and side panel options.
1542
+ */
1543
+ export declare class UI {
1544
+ /**
1545
+ * Gets or sets the theme for the PDF viewer.
1546
+ *
1547
+ * @remarks
1548
+ * Controls the color scheme of the viewer.
1549
+ * Predefined theme from {@link Theme} can be picked to match your application's color palette.
1550
+ * Defaults to "light".
1551
+ */
1552
+ readonly theme?: Theme;
1553
+ /**
1554
+ * Gets the toolbar component of the PDF viewer.
1555
+ *
1556
+ * @remarks
1557
+ * Provides access to toolbar configuration and functionality, including buttons for common actions
1558
+ * like opening files, printing, zooming, and navigating through pages.
1559
+ */
1560
+ readonly toolbar: ToolbarUI;
1561
+ /**
1562
+ * Gets the side panel component of the PDF viewer.
1563
+ *
1564
+ * @remarks
1565
+ * Controls the side panel that typically contains additional functionality such as layers,
1566
+ * outlines, thumbnails, and other navigation aids.
1567
+ */
1568
+ readonly sidePanel: SidePanelUI;
1569
+ }
1570
+
1571
+ /**
1572
+ * Options for configuring the user interface of the PDF viewer.
1573
+ *
1574
+ * @remarks
1575
+ * This interface provides configuration options for the PDF viewer's user interface, including
1576
+ * theme, toolbar, localization, and side panel settings. These options allow you to customize
1577
+ * the appearance and behavior of the viewer to match your application's design requirements.
1578
+ */
1579
+ export declare interface UIOptions {
1580
+ /**
1581
+ * Gets or sets the theme for the PDF viewer user interface.
1582
+ *
1583
+ * @remarks
1584
+ * This property allows you to configure the visual appearance of the viewer. The theme can be customized to match your application's design.
1585
+ */
1586
+ theme?: Theme;
1587
+ /**
1588
+ * Gets or sets the toolbar options for the PDF viewer.
1589
+ *
1590
+ * @remarks
1591
+ * This property provides configuration options for the toolbar, including which buttons to display and their layout.
1592
+ */
1593
+ toolbar?: ToolbarUIOptions;
1594
+ /**
1595
+ * Gets or sets the localization options for the PDF viewer.
1596
+ *
1597
+ * @remarks
1598
+ * This property allows you to specify the language for the user interface. You can use predefined languages ("en", "de", "es")
1599
+ * or provide custom localized messages through a {@link NestedMessages} object.
1600
+ */
1601
+ localization?: "en" | "de" | "es" | NestedMessages;
1602
+ /**
1603
+ * Gets or sets the side panel options for the PDF viewer.
1604
+ *
1605
+ * @remarks
1606
+ * This property provides configuration options for the side panel, including which panels to display and their initial state.
1607
+ * The side panel provides access to additional features like electronic signatures and digital signatures.
1608
+ */
1609
+ sidePanel?: SidePanelUIOptions;
1610
+ }
1611
+
1612
+ /**
1613
+ * Represents a base event interface for the PDF viewer that provides functionality
1614
+ * similar to the standard DOM Event interface, allowing events to be canceled.
1615
+ *
1616
+ * @remarks
1617
+ * This interface defines the core event handling capabilities including:
1618
+ * <ul>
1619
+ * <li>The ability to check if an event's default action has been prevented.</li>
1620
+ * <li>The ability to prevent the default action of an event.</li>
1621
+ * </ul>
1622
+ */
1623
+ export declare interface ViewerEvent {
1624
+ /**
1625
+ * Gets a value indicating whether the event's default action has been canceled.
1626
+ *
1627
+ * @remarks
1628
+ * The **`defaultPrevented`** read-only property returns `true` if the call to Event.preventDefault()
1629
+ * canceled the event, otherwise it returns `false`.
1630
+ */
1631
+ readonly defaultPrevented: boolean;
1632
+ /**
1633
+ * Cancels the event if it is cancelable, without stopping further propagation of the event.
1634
+ *
1635
+ * @remarks
1636
+ * This method call indicates that the event's default action should be prevented.
1637
+ * If the event is not cancelable, this method has no effect.
1638
+ * The event can be prevented to stop the default behavior from occurring.
1639
+ */
1640
+ preventDefault(): void;
1641
+ }
1642
+
1643
+ /**
1644
+ * Represents the configuration options for the PDF viewer.
1645
+ *
1646
+ * @remarks
1647
+ * This interface defines the various settings that can be used to customize the behavior and appearance of the PDF viewer when it's created.
1648
+ */
1649
+ export declare interface ViewerOptions {
1650
+ /**
1651
+ * The container element where the PDF viewer will be mounted.
1652
+ *
1653
+ * @remarks
1654
+ * Can be either an {@link HTMLElement} reference or id selector as {@link string} (e.g., "#myContainer").
1655
+ * If the container cannot be found using the provided selector, an error will be thrown.
1656
+ */
1657
+ container: HTMLElement | string;
1658
+ /**
1659
+ * The initial PDF document to load when the viewer is created.
1660
+ *
1661
+ * @remarks
1662
+ * This is an optional property. If not provided, the viewer will be created without a loaded document.
1663
+ * This can be:
1664
+ * <ul>
1665
+ * <li>A URL string pointing to a PDF file.</li>
1666
+ * <li>A base64 encoded string representing the PDF content.</li>
1667
+ * <li>A Uint8Array containing the raw PDF bytes.</li>
1668
+ * <li>An ArrayBuffer containing the raw PDF data.</li>
1669
+ * </ul>
1670
+ * If the document cannot be loaded, the promise will reject with an error.
1671
+ */
1672
+ initialDocument?: string | Uint8Array | ArrayBuffer;
1673
+ /**
1674
+ * Configuration options for the user interface components.
1675
+ *
1676
+ * @remarks
1677
+ * Allows customization of UI elements like theme, toolbar, and side panel configuration.
1678
+ */
1679
+ ui?: UIOptions;
1680
+ /**
1681
+ * Configuration options for various features such as annotations, digital signing, zoom, page navigation, and search functionality.
1682
+ *
1683
+ * @remarks
1684
+ * Controls which features are enabled and how they behave in the PDF viewer.
1685
+ */
1686
+ features?: FeaturesOptions;
1687
+ }
1688
+
1689
+ /**
1690
+ * Represents an element that supports visibility capabilities.
1691
+ *
1692
+ * @remarks
1693
+ * This interface provides functionality to get and update the visibility of the element.
1694
+ * It allows controlling whether the element is displayed or hidden in the UI.
1695
+ */
1696
+ export declare interface VisibilityElement {
1697
+ /**
1698
+ * The current visibility state of the element.
1699
+ *
1700
+ * @remarks
1701
+ * This property returns true if the element is currently visible, false otherwise.
1702
+ * The value is updated automatically when the visibility changes.
1703
+ */
1704
+ get isVisible(): boolean;
1705
+ /**
1706
+ * The current visibility state of the element.
1707
+ *
1708
+ * @param value - The new visibility state (true to show, false to hide).
1709
+ */
1710
+ set isVisible(value: boolean);
1711
+ }
1712
+
1713
+ /**
1714
+ * Represents options for controlling the visibility of PDF viewer elements.
1715
+ *
1716
+ * @remarks
1717
+ * This interface provides a simple way to control whether certain UI elements or features should be visible in the PDF viewer.
1718
+ */
1719
+ export declare interface VisibilityOption {
1720
+ /**
1721
+ * Gets or sets whether the element is visible.
1722
+ *
1723
+ * @remarks
1724
+ * When set to true, the element will be displayed. When false, the element will be hidden.
1725
+ * If not specified, defaults to true (visible).
1726
+ */
1727
+ isVisible?: boolean;
1728
+ }
1729
+
1730
+ /**
1731
+ * Provides zoom functionality for the PDF viewer.
1732
+ *
1733
+ * @remarks
1734
+ * The Zoom class manages zoom operations including setting zoom levels, handling zoom events,
1735
+ * and providing access to current zoom state.
1736
+ */
1737
+ export declare class Zoom implements EventElement<ZoomEventMap> {
1738
+ /** @inheritdoc */
1739
+ addEventListener<K extends keyof ZoomEventMap>(type: K, listener: (event: ZoomEventMap[K]) => void): void;
1740
+ /**
1741
+ * Gets the current zoom level.
1742
+ */
1743
+ get zoomLevel(): ZoomLevel;
1744
+ /**
1745
+ * Sets the zoom level for the PDF viewer.
1746
+ *
1747
+ * @param value - The zoom level to set (e.g., "automatic", "pageFit", or a percentage value).
1748
+ *
1749
+ * @remarks
1750
+ * This method changes the zoom level of the PDF viewer. It emits zoomChanging and zoomChanged events,
1751
+ * allowing listeners to respond to the zoom change. The zoomLevel parameter can be:
1752
+ * <ul>
1753
+ * <li>A predefined zoom level like "automatic", "pageFit", or "pageWidth".</li>
1754
+ * <li>A numeric value representing a percentage (e.g., 150 for 150%).</li>
1755
+ * </ul>
1756
+ */
1757
+ set zoomLevel(value: ZoomLevel);
1758
+ /**
1759
+ * Zooms the PDF viewer by a relative scale factor.
1760
+ *
1761
+ * @param scale - The relative scale factor to apply (e.g., 1.2 for 20% zoom in, 0.8 for 20% zoom out).
1762
+ *
1763
+ * @remarks
1764
+ * This method adjusts the current zoom level by multiplying it with the provided scale factor.
1765
+ * For example, a scale of 1.5 will increase the zoom by 50%, while a scale of 0.75 will decrease
1766
+ * the zoom by 25%.
1767
+ */
1768
+ zoomRelative(scale: number): void;
1769
+ }
1770
+
1771
+ /**
1772
+ * Represents an event that is emitted when the zoom level has changed.
1773
+ *
1774
+ * @remarks
1775
+ * This interface defines the properties available in a zoom changed event,
1776
+ * including the previous and current zoom levels. This event is emitted after
1777
+ * the zoom operation has been completed successfully.
1778
+ */
1779
+ export declare interface ZoomChangedEvent extends ViewerEvent {
1780
+ /**
1781
+ * The zoom level before the change.
1782
+ */
1783
+ readonly zoomLevelBefore: ZoomLevel;
1784
+ /**
1785
+ * The zoom level after the change.
1786
+ */
1787
+ readonly zoomLevelAfter: ZoomLevel;
1788
+ }
1789
+
1790
+ /**
1791
+ * Represents an event that is emitted when the zoom level is about to change.
1792
+ *
1793
+ * @remarks
1794
+ * This interface defines the properties available in a zoom changing event,
1795
+ * including the current and future zoom levels. The zoomLevelAfter property can be modified
1796
+ * by event listeners to change the target zoom level.
1797
+ */
1798
+ export declare interface ZoomChangingEvent extends ViewerEvent {
1799
+ /**
1800
+ * The zoom level before the change.
1801
+ */
1802
+ readonly zoomLevelBefore: ZoomLevel;
1803
+ /**
1804
+ * The target zoom level that can be modified by event listeners.
1805
+ */
1806
+ zoomLevelAfter: ZoomLevel;
1807
+ }
1808
+
1809
+ /**
1810
+ * ZoomEventMap is an interface used to provide type-safe event listeners and is not instantiated
1811
+ * or used directly. It maps event names to their corresponding event object types and
1812
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
1813
+ *
1814
+ * @remarks
1815
+ * This interface defines the types of events that can be emitted by the Zoom class,
1816
+ * including zoom changing and zoom changed events.
1817
+ */
1818
+ export declare interface ZoomEventMap {
1819
+ zoomChanging: ZoomChangingEvent;
1820
+ zoomChanged: ZoomChangedEvent;
1821
+ }
1822
+
1823
+ /**
1824
+ * Represents the zoom level that can be applied to the PDF viewer.
1825
+ *
1826
+ * @remarks
1827
+ * Zoom levels can be specified as a numeric value (percentage) or using predefined constants for automatic fitting, page fit, or page width.
1828
+ */
1829
+ export declare type ZoomLevel = number | typeof constants.automatic | typeof constants.pageFit | typeof constants.pageWidth;
1830
+
1831
+ /**
1832
+ * Represents the default zoom percentage values for the dropdown menu.
1833
+ *
1834
+ * @remarks
1835
+ * This array contains the standard zoom percentages available in the viewer's zoom dropdown.
1836
+ */
1837
+ export declare const zoomPercentageDropdownValues: readonly [25, 50, 75, 100, 150, 200, 300, 400, 500];
1838
+
1839
+ /**
1840
+ * Represents zoom controls for the viewer toolbar.
1841
+ */
1842
+ export declare class ZoomUI implements VisibilityElement {
1843
+ /** @inheritdoc */
1844
+ get isVisible(): boolean;
1845
+ /** @inheritdoc */
1846
+ set isVisible(value: boolean);
1847
+ }
1848
+
1849
+ /**
1850
+ * Represents options for configuring the zoom controls in the PDF viewer.
1851
+ *
1852
+ * @remarks
1853
+ * This interface provides control over whether the zoom controls are visible.
1854
+ * It provides a simple way to enable or disable the zoom functionality in the viewer.
1855
+ */
1856
+ export declare interface ZoomUIOptions extends VisibilityOption {
1857
+ }
1858
+