@gembox/pdfviewer 2026.5.101 → 2026.5.103

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,2235 @@
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
+ * Defines the cursor modes available in the PDF viewer.
255
+ *
256
+ * @remarks
257
+ * The cursor mode determines how the mouse or touch interactions work with the PDF document.
258
+ */
259
+ export declare enum CursorMode {
260
+ /**
261
+ * Text selection mode. Allows selecting and copying text from the PDF document.
262
+ */
263
+ TextSelection = 0,
264
+ /**
265
+ * Draggable mode. Allows dragging the PDF document with mouse or touch instead of text selection.
266
+ */
267
+ Draggable = 1
268
+ }
269
+
270
+ /**
271
+ * Represents an event that is emitted when a digital signing operation completes successfully.
272
+ *
273
+ * @remarks
274
+ * This event contains the signed PDF document data that can be loaded back into the viewer.
275
+ */
276
+ export declare interface DigitallySignedEvent extends ViewerEvent {
277
+ readonly documentBytes: ArrayBuffer;
278
+ }
279
+
280
+ /**
281
+ * Represents the digital signature panel in the PDF viewer's side panel.
282
+ *
283
+ * @remarks
284
+ * This class provides configuration options for the digital signature panel,
285
+ * including title, description, and button text. It controls whether the panel is visible or hidden.
286
+ */
287
+ export declare class DigitalSignatureUI implements VisibilityElement {
288
+ /** @inheritdoc */
289
+ get isVisible(): boolean;
290
+ /** @inheritdoc */
291
+ set isVisible(value: boolean);
292
+ /**
293
+ * The title of the digital signature section on the side panel.
294
+ *
295
+ * @remarks
296
+ * This property controls the title shown for digital signature on the side panel.
297
+ * When the value is `undefined`, the default translation is used.
298
+ */
299
+ get title(): string | undefined;
300
+ /**
301
+ * The title of the digital signature section on the side panel.
302
+ *
303
+ * @param value - The title text to display, or undefined to clear it.
304
+ *
305
+ * @remarks
306
+ * This property controls the title shown for digital signature on the side panel.
307
+ * When the value is `undefined`, the default translation is used.
308
+ */
309
+ set title(value: string | undefined);
310
+ /**
311
+ * The description of the digital signature section on the side panel.
312
+ *
313
+ * @remarks
314
+ * This property controls the description shown below the title on the side panel.
315
+ * When the value is `undefined`, the default translation is used.
316
+ */
317
+ get description(): string | undefined;
318
+ /**
319
+ * The description of the digital signature section on the side panel.
320
+ *
321
+ * @param value - The description text to display, or undefined to clear it
322
+ *
323
+ * @remarks
324
+ * This property controls the description shown below the title on the side panel.
325
+ * When the value is `undefined`, the default translation is used.
326
+ */
327
+ set description(value: string | undefined);
328
+ /**
329
+ * The text of the button for the digital signature section on the side panel.
330
+ *
331
+ * @remarks
332
+ * This property controls the text shown on the button on the side panel that triggers the signature action.
333
+ * When the value is `undefined`, the default translation is used.
334
+ */
335
+ get buttonText(): string | undefined;
336
+ /**
337
+ * The text of the button for the digital signature section on the side panel.
338
+ *
339
+ * @param value - The button text to display, or undefined to clear it
340
+ *
341
+ * @remarks
342
+ * This property controls the text shown on the button on the side panel that triggers the signature action.
343
+ * When the value is `undefined`, the default translation is used.
344
+ */
345
+ set buttonText(value: string | undefined);
346
+ }
347
+
348
+ /**
349
+ * Represents the configuration options for the digital signature panel in the PDF viewer.
350
+ *
351
+ * @remarks
352
+ * This interface defines the properties that control the visibility and appearance of the
353
+ * digital signature panel, which allows users to sign PDF documents electronically.
354
+ */
355
+ export declare interface DigitalSignatureUIOptions {
356
+ /**
357
+ * Gets or sets a value indicating whether the digital signature panel is visible.
358
+ * Defaults to true if not specified.
359
+ */
360
+ isVisible?: boolean;
361
+ /**
362
+ * Gets or sets the title text displayed in the digital signature panel.
363
+ */
364
+ title?: string;
365
+ /**
366
+ * Gets or sets the description text displayed in the digital signature panel.
367
+ */
368
+ description?: string;
369
+ /**
370
+ * Gets or sets the text displayed on the sign button in the digital signature panel.
371
+ */
372
+ buttonText?: string;
373
+ }
374
+
375
+ /**
376
+ * Provides functionality for digitally signing PDF documents.
377
+ *
378
+ * @remarks
379
+ * This class handles the digital signing process, including communication with a signing server,
380
+ * event handling for signing operations, and management of signing appearance options.
381
+ */
382
+ export declare class DigitalSigning implements EventElement<DigitalSigningEventMap> {
383
+ /**
384
+ * Gets or sets the URL of the digital signing server.
385
+ *
386
+ * @remarks
387
+ * This property specifies the endpoint where PDF documents will be sent for digital signing.
388
+ */
389
+ serverUrl: string;
390
+ /**
391
+ * Gets or sets the API password used to authenticate with the digital signing server.
392
+ *
393
+ * @remarks
394
+ * This password is sent as a Bearer token in the Authorization header when making requests to the signing server.
395
+ * If not set, the user will be prompted to enter a password during the signing process.
396
+ */
397
+ apiPassword?: string;
398
+ /**
399
+ * Gets or sets whether the signed document should be automatically downloaded after successful signing.
400
+ *
401
+ * @remarks
402
+ * When set to true, the signed PDF will be downloaded to the user's device upon completion of the signing process. Defaults to true.
403
+ */
404
+ autoDownload: boolean;
405
+ /**
406
+ * Gets or sets the appearance annotation for the digital signature.
407
+ *
408
+ * @remarks
409
+ * This property allows customization of how the digital signature appears in the PDF document.
410
+ */
411
+ appearance?: Annotation;
412
+ /** @inheritdoc */
413
+ addEventListener<K extends keyof DigitalSigningEventMap>(type: K, listener: (event: DigitalSigningEventMap[K]) => void): void;
414
+ /**
415
+ * Initiates the digital signing process for the current PDF document.
416
+ *
417
+ * @param password - Optional password to override the default API password for this signing operation.
418
+ * @returns A promise that resolves when the signing process is complete.
419
+ *
420
+ * @remarks
421
+ * <ul>
422
+ * <li>Extracts the current PDF document data.</li>
423
+ * <li>Emits a digitalSigning event to allow customization.</li>
424
+ * <li>Sends the document to the signing server.</li>
425
+ * <li>Handles the signed document response.</li>
426
+ * <li>Loads the signed PDF back into the viewer.</li>
427
+ * </ul>
428
+ */
429
+ sign(password?: string): Promise<void>;
430
+ }
431
+
432
+ /**
433
+ * Represents an event that is emitted when a digital signing operation is initiated.
434
+ *
435
+ * @remarks
436
+ * This event contains the PDF document data and optional appearance information for the signature.
437
+ */
438
+ export declare interface DigitalSigningEvent extends ViewerEvent {
439
+ /**
440
+ * Gets the raw bytes of the PDF document to be signed.
441
+ *
442
+ * @remarks
443
+ * This property contains the binary data that will be sent to the signing server for digital signature processing.
444
+ */
445
+ readonly documentBytes: ArrayBuffer;
446
+ /**
447
+ * Gets or sets optional appearance information for the digital signature.
448
+ *
449
+ * @remarks
450
+ * This property can be used to specify how the signature should appear in the PDF document.
451
+ */
452
+ appearanceAnnotation?: Annotation;
453
+ }
454
+
455
+ /**
456
+ * DigitalSigningEventMap is an interface used to provide type-safe event listeners and is not instantiated
457
+ * or used directly. It maps event names to their corresponding event object types and
458
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
459
+ *
460
+ * @remarks
461
+ * This interface defines the types of events that can be emitted during the digital signing process,
462
+ * including the initial signing request and the completion of the signing operation.
463
+ */
464
+ export declare interface DigitalSigningEventMap {
465
+ /**
466
+ * Event emitted when the digital signing process is initiated.
467
+ *
468
+ * @remarks
469
+ * This event contains the PDF document data and optional appearance information before sending to the signing server.
470
+ */
471
+ digitalSigning: DigitalSigningEvent;
472
+ /**
473
+ * Event emitted when the digital signing process completes successfully.
474
+ *
475
+ * @remarks
476
+ * This event contains the signed PDF document data that can be loaded back into the viewer after successful signing.
477
+ */
478
+ digitallySigned: DigitallySignedEvent;
479
+ }
480
+
481
+ /**
482
+ * Represents options for digital signing functionality in the PDF viewer.
483
+ *
484
+ * @remarks
485
+ * These options configure the connection to a digital signing service and control
486
+ * whether signed documents are automatically downloaded after signing.
487
+ */
488
+ export declare interface DigitalSigningOptions {
489
+ /**
490
+ * The URL of the server that provides digital signing services.
491
+ *
492
+ * @remarks
493
+ * This should be the endpoint where the PDF viewer will send documents for signing.
494
+ */
495
+ serverUrl: string;
496
+ /**
497
+ * The API password required to authenticate with the digital signing service.
498
+ *
499
+ * @remarks
500
+ * This password is used to authorize requests to the signing server.
501
+ * If not set, the user will be prompted to enter a password during the signing process.
502
+ */
503
+ apiPassword?: string;
504
+ /**
505
+ * Optional flag indicating whether signed documents should be automatically downloaded.
506
+ *
507
+ * @remarks
508
+ * When set to true, the viewer will automatically download and display the signed document
509
+ * after the signing process completes. Defaults to true if not specified.
510
+ */
511
+ autoDownload?: boolean;
512
+ }
513
+
514
+ /**
515
+ * Represents a download button in the PDF viewer toolbar that allows users to download the current document.
516
+ *
517
+ * @remarks
518
+ * This button triggers the download of the currently loaded PDF document when clicked, providing specific behavior for document downloading.
519
+ */
520
+ export declare class DownloadButtonUI extends BasicButtonUI {
521
+ }
522
+
523
+ /**
524
+ * Represents options for configuring the download button in the PDF viewer.
525
+ *
526
+ * @remarks
527
+ * This interface provides control over whether the download button is visible.
528
+ * It provides a simple way to enable or disable the ability to download the current PDF document from the viewer.
529
+ */
530
+ export declare interface DownloadButtonUIOptions extends VisibilityOption {
531
+ }
532
+
533
+ /**
534
+ * Represents the available values that can be displayed in dropdown menus for zoom options.
535
+ *
536
+ * @remarks
537
+ * This type includes constants for page fit and page width, as well as predefined zoom percentage values from the constants module.
538
+ */
539
+ export declare type DropdownValues = typeof constants.pageFit | typeof constants.pageWidth | (typeof constants.zoomPercentageDropdownValues)[number];
540
+
541
+ /**
542
+ * Represents the e-signature element in the PDF viewer's side panel.
543
+ *
544
+ * @remarks
545
+ * This class provides functionality for configuring and displaying an e-signature element,
546
+ * including title, description, and button text.
547
+ */
548
+ export declare class ESignatureUI implements VisibilityElement {
549
+ /** @inheritdoc */
550
+ get isVisible(): boolean;
551
+ /** @inheritdoc */
552
+ set isVisible(value: boolean);
553
+ /**
554
+ * The title of the e-signature section on the side panel.
555
+ *
556
+ * @remarks
557
+ * This property controls the title shown for e-signature on the side panel.
558
+ * When the value is `undefined`, the default translation is used.
559
+ */
560
+ get titleText(): string;
561
+ /**
562
+ * The title of the e-signature section on the side panel.
563
+ *
564
+ * @param value - The title text to display.
565
+ *
566
+ * @remarks
567
+ * This property controls the title shown for e-signature on the side panel.
568
+ * When the value is `undefined`, the default translation is used.
569
+ */
570
+ set titleText(value: string | undefined);
571
+ /**
572
+ * The description of the e-signature section on the side panel.
573
+ *
574
+ * @remarks
575
+ * This property controls the description shown below the title on the side panel.
576
+ * When the value is `undefined`, the default translation is used.
577
+ */
578
+ get descriptionText(): string;
579
+ /**
580
+ * The description of the e-signature section on the side panel.
581
+ *
582
+ * @param value - The description text to display.
583
+ *
584
+ * @remarks
585
+ * This property controls the description shown below the title on the side panel.
586
+ * When the value is `undefined`, the default translation is used.
587
+ */
588
+ set descriptionText(value: string | undefined);
589
+ /**
590
+ * The text of the button for the e-signature section on the side panel.
591
+ *
592
+ * @remarks
593
+ * This property controls the text shown on the button on the side panel that opens e-signature popup.
594
+ * When the value is `undefined`, the default translation is used.
595
+ */
596
+ get buttonText(): string;
597
+ /**
598
+ * The text of the button for the e-signature section on the side panel.
599
+ *
600
+ * @param value - The button text to display.
601
+ *
602
+ * @remarks
603
+ * This property controls the text shown on the button on the side panel that opens e-signature popup.
604
+ * When the value is `undefined`, the default translation is used.
605
+ */
606
+ set buttonText(value: string | undefined);
607
+ }
608
+
609
+ /**
610
+ * Represents options for configuring the electronic signature feature in the PDF viewer.
611
+ *
612
+ * @remarks
613
+ * These options control the visibility and appearance of the electronic signature UI element,
614
+ * allowing customization of labels, descriptions, and button text.
615
+ */
616
+ export declare interface ESignatureUIOptions {
617
+ /**
618
+ * Gets or sets whether the electronic signature panel is visible. Defaults to true if not specified.
619
+ */
620
+ isVisible?: boolean;
621
+ /**
622
+ * Gets or sets the title displayed in the electronic signature panel.
623
+ */
624
+ title?: string;
625
+ /**
626
+ * Gets or sets the description text shown in the electronic signature panel.
627
+ */
628
+ description?: string;
629
+ /**
630
+ * Gets or sets the text displayed on the signature button.
631
+ */
632
+ buttonText?: string;
633
+ }
634
+
635
+ /**
636
+ * An event-emitting interface that allows for type-safe event handling.
637
+ *
638
+ * @typeParam TEventMap - A dictionary type representing the mapping of event names (strings).
639
+ * to their corresponding event data types. Each key in TEventMap represents an event name,
640
+ * and its value represents the type of data associated with that event.
641
+ *
642
+ * @remarks
643
+ * This interface provides a generic way to handle events with strongly-typed event data.
644
+ * It supports both synchronous and asynchronous event listeners, allowing for flexible
645
+ * event handling patterns.
646
+ */
647
+ export declare interface EventElement<TEventMap extends {
648
+ [key: string]: any;
649
+ }> {
650
+ /**
651
+ * Adds an event listener for the specified event type.
652
+ *
653
+ * @param type - The event type/name to listen for.
654
+ * @param listener - The callback function that will be invoked when the event is emitted.
655
+ *
656
+ * @remarks
657
+ * Multiple listeners can be registered for the same event type.
658
+ * The listener will be called with the strongly-typed event data when the event is emitted.
659
+ */
660
+ addEventListener<K extends keyof TEventMap & string>(type: K, listener: (event: TEventMap[K]) => void): void;
661
+ }
662
+
663
+ /**
664
+ * Provides access to various features available in the PDF viewer.
665
+ *
666
+ * @remarks
667
+ * This class contains references to feature modules that handle specific aspects of PDF viewing and manipulation,
668
+ * such as annotations, digital signing, zoom controls, page navigation, and search functionality.
669
+ */
670
+ export declare class Features {
671
+ /**
672
+ * Gets the annotations feature module.
673
+ *
674
+ * @remarks
675
+ * Provides functionality for working with PDF annotations including highlighting, underlining, sticky notes, etc.
676
+ */
677
+ readonly annotations: Annotations;
678
+ /**
679
+ * Gets the digital signing feature module (if enabled).
680
+ *
681
+ * @remarks
682
+ * Provides functionality for digitally signing PDF documents. This property is optional and only available when
683
+ * digital signing is configured in the viewer options.
684
+ */
685
+ readonly digitalSigning?: DigitalSigning;
686
+ /**
687
+ * Gets the zoom feature module.
688
+ *
689
+ * @remarks
690
+ * Provides functionality for zooming and scaling the PDF document view.
691
+ */
692
+ readonly zoom: Zoom;
693
+ /**
694
+ * Gets the page navigation feature module.
695
+ *
696
+ * @remarks
697
+ * Provides functionality for navigating between pages in the PDF document.
698
+ */
699
+ readonly page: PageNavigation;
700
+ /**
701
+ * Gets the search feature module.
702
+ *
703
+ * @remarks
704
+ * Provides functionality for searching text within the PDF document.
705
+ */
706
+ readonly search: Search;
707
+ }
708
+
709
+ /**
710
+ * Represents the configuration options for various features available in the PDF viewer.
711
+ *
712
+ * @remarks
713
+ * This interface provides access to configure different features such as digital signing functionality.
714
+ * It allows you to enable or disable specific features and customize their behavior.
715
+ */
716
+ export declare interface FeaturesOptions {
717
+ /**
718
+ * Gets or sets the options for digital signing functionality.
719
+ *
720
+ * @remarks
721
+ * This property configures the connection to a digital signing service and controls whether signed documents are automatically downloaded after signing.
722
+ * If not set, the digital signing feature will not be available.
723
+ */
724
+ digitalSigning?: DigitalSigningOptions;
725
+ }
726
+
727
+ export declare class FreeText {
728
+ get fontSize(): number;
729
+ set fontSize(value: number);
730
+ }
731
+
732
+ /**
733
+ * Represents the free text annotation component in the PDF viewer's toolbar.
734
+ *
735
+ * @remarks
736
+ * This class provides functionality for configuring and managing free text annotations,
737
+ * including visibility control, font size, color settings, and an add button for creating new annotations.
738
+ */
739
+ export declare class FreeTextUI implements VisibilityElement {
740
+ /** @inheritdoc */
741
+ get isVisible(): boolean;
742
+ /** @inheritdoc */
743
+ set isVisible(value: boolean);
744
+ }
745
+
746
+ /**
747
+ * Represents options for configuring the free text annotation feature in the PDF viewer.
748
+ *
749
+ * @remarks
750
+ * This interface provides control over whether the free text annotation controls are visible.
751
+ * It allows users to enable or disable the ability to add and configure free text annotations in the viewer.
752
+ */
753
+ export declare interface FreeTextUIOptions extends VisibilityOption {
754
+ }
755
+
756
+ /**
757
+ * Represents the main PDF viewer class that provides functionality for displaying and interacting with PDF documents.
758
+ */
759
+ export declare class GemBoxPdfViewer {
760
+ /**
761
+ * Gets the features available in the PDF viewer.
762
+ *
763
+ * @remarks
764
+ * This property provides access to various features such as annotations, digital signing, zoom, page navigation, and search functionality.
765
+ */
766
+ readonly features: Features;
767
+ /**
768
+ * Gets the user interface components of the PDF viewer.
769
+ *
770
+ * @remarks
771
+ * This property provides access to UI elements like theme, toolbar, and side panel configuration.
772
+ */
773
+ readonly ui: UI;
774
+ /**
775
+ * Opens a PDF document for viewing.
776
+ *
777
+ * @param document - The PDF document to open, which can be a string (URL or base64), Uint8Array, or ArrayBuffer.
778
+ * @returns A promise that resolves when the document is successfully loaded and rendered.
779
+ *
780
+ * @remarks
781
+ * This method loads the specified PDF document into the viewer. The document can be provided as:
782
+ * <ul>
783
+ * <li>A URL string pointing to a PDF file.</li>
784
+ * <li>A base64 encoded string representing the PDF content.</li>
785
+ * <li>A Uint8Array containing the raw PDF bytes.</li>
786
+ * <li>An ArrayBuffer containing the raw PDF data.</li>
787
+ * </ul>
788
+ */
789
+ open(document: string | Uint8Array | ArrayBuffer): Promise<void>;
790
+ /**
791
+ * Sets the license (serial) key for the GemBox.PdfViewer.
792
+ *
793
+ * @param licenseKey - The serial key to use for licensing.
794
+ *
795
+ * @remarks
796
+ * <para>You should call this method before creating any PDF Viewer instance.</para>
797
+ * <para>Key can only be set once (if you try to set another key, it will be ignored).</para>
798
+ * <para>The best place to call this method is during application initialization, before calling `GemBoxPdfViewer.create()`.</para>
799
+ * <para>Valid serial key has multiple groups of alphanumeric characters, separated with dashes.</para>
800
+ * <para>To use the assembly in free limited mode, use `FREE-LIMITED-KEY` as `licenseKey`.</para>
801
+ */
802
+ static setLicense(licenseKey: string): void;
803
+ /**
804
+ * Creates a new instance of the PDF viewer and initializes it with the specified options.
805
+ *
806
+ * @param options - The configuration options for the PDF viewer.
807
+ * @returns A promise that resolves to a new GemBoxPdfViewer instance.
808
+ *
809
+ * @remarks
810
+ * This static method creates and initializes a new PDF viewer instance. It:
811
+ * <ul>
812
+ * <li>Validates the license key.</li>
813
+ * <li>Sets up the Vue application.</li>
814
+ * <li>Initializes worker threads for PDF processing.</li>
815
+ * <li>Mounts the viewer to the specified container element.</li>
816
+ * </li>
817
+ *
818
+ * The options parameter allows you to configure various aspects of the viewer including UI elements, features, and initial document.
819
+ */
820
+ static create(options: ViewerOptions): Promise<GemBoxPdfViewer>;
821
+ }
822
+
823
+ /**
824
+ * Represents the hand drawing annotation component in the PDF viewer's toolbar.
825
+ *
826
+ * @remarks
827
+ * This class provides functionality for configuring and managing hand-drawn annotations,
828
+ * including visibility control, color, thickness, opacity settings, and an add button for creating new drawings.
829
+ */
830
+ export declare class HandDrawingUI implements VisibilityElement {
831
+ /** @inheritdoc */
832
+ get isVisible(): boolean;
833
+ /** @inheritdoc */
834
+ set isVisible(value: boolean);
835
+ }
836
+
837
+ /**
838
+ * Represents options for configuring the hand drawing annotation feature in the PDF viewer.
839
+ *
840
+ * @remarks
841
+ * This interface provides control over whether the hand drawing annotation controls are visible.
842
+ * It allows users to enable or disable the ability to add and configure hand-drawn annotations in the viewer.
843
+ */
844
+ export declare interface HandDrawingUIOptions extends VisibilityOption {
845
+ }
846
+
847
+ /**
848
+ * Represents nested message structures where each key can map to either a string or another nested messages object.
849
+ *
850
+ * @remarks
851
+ * This type is commonly used for localization and internationalization purposes, allowing for hierarchical message structures.
852
+ */
853
+ export declare type NestedMessages = {
854
+ [key: string]: string | NestedMessages;
855
+ };
856
+
857
+ /**
858
+ * Represents a button in the PDF viewer toolbar that navigates to the next page of the document.
859
+ *
860
+ * @remarks
861
+ * This button allows users to move forward through the pages of the loaded PDF document, providing specific behavior for page navigation.
862
+ */
863
+ export declare class NextPageButtonUI extends BasicButtonUI {
864
+ }
865
+
866
+ /**
867
+ * Represents a button in the PDF viewer toolbar that navigates to the next search match.
868
+ *
869
+ * @remarks
870
+ * This button allows users to move to the next occurrence of their search query within the document,
871
+ * providing specific behavior for search navigation.
872
+ */
873
+ export declare class NextSearchButtonUI extends BasicButtonUI {
874
+ }
875
+
876
+ /**
877
+ * Represents a button in the PDF viewer toolbar that opens file dialog for loading PDF documents.
878
+ *
879
+ * @remarks
880
+ * This button allows users to select and open PDF files from their local system,
881
+ * providing specific behavior for file selection and loading.
882
+ */
883
+ export declare class OpenButtonUI extends BasicButtonUI {
884
+ }
885
+
886
+ /**
887
+ * Represents options for configuring the open button in the PDF viewer.
888
+ *
889
+ * @remarks
890
+ * This interface provides control over whether the open button is visible.
891
+ * It provides a simple way to enable or disable the ability to open new PDF documents in the viewer.
892
+ */
893
+ export declare interface OpenButtonUIOptions extends VisibilityOption {
894
+ }
895
+
896
+ /**
897
+ * Event triggered when changing pages in a PDF document.
898
+ *
899
+ * @remarks
900
+ * This event provides access to both previous and target page numbers during navigation,
901
+ * allowing listeners to cancel or modify the page change before it occurs.
902
+ */
903
+ export declare interface PageChangingEvent extends ViewerEvent {
904
+ /**
905
+ * Gets the zero-based index of the page that was previously active before navigation.
906
+ *
907
+ * @remarks
908
+ * This property represents the page index (zero-based) from which the navigation originated.
909
+ */
910
+ readonly previousPage: number;
911
+ /**
912
+ * The target page index (zero-based index). Can be modified to change the destination page.
913
+ */
914
+ page: number;
915
+ }
916
+
917
+ /**
918
+ * PageEventMap is an interface used to provide type-safe event listeners and is not instantiated
919
+ * or used directly. It maps event names to their corresponding event object types and
920
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
921
+ *
922
+ * @remarks
923
+ * This interface defines the structure of events that can be emitted by the Page class,
924
+ * specifically the pageChanging event which is triggered when the current page is about to change.
925
+ */
926
+ export declare interface PageEventMap {
927
+ /**
928
+ * Event triggered when the current page is about to change.
929
+ *
930
+ * @remarks
931
+ * This event is emitted before navigating to a new page, allowing listeners to cancel
932
+ * or modify the navigation. The event contains information about both the previous and target pages.
933
+ */
934
+ pageChanging: PageChangingEvent;
935
+ }
936
+
937
+ /**
938
+ * Represents the page fit zoom mode value.
939
+ *
940
+ * @remarks
941
+ * This constant is used to indicate that the zoom level should fit the entire page within the viewport.
942
+ */
943
+ export declare const pageFit = "pageFit";
944
+
945
+ /**
946
+ * Represents an event that is fired when the input value has changed and page navigation occurs.
947
+ *
948
+ * @remarks
949
+ * This event provides read-only access to the target page number after validation.
950
+ */
951
+ export declare interface PageInputChangedEvent extends ViewerEvent {
952
+ /**
953
+ * The target page number (entered as 1-based number) that has been applied.
954
+ */
955
+ readonly pageNumber: number;
956
+ }
957
+
958
+ /**
959
+ * Represents an event that is fired when the input value is about to change.
960
+ *
961
+ * @remarks
962
+ * This event can be prevented to stop the page navigation from occurring.
963
+ */
964
+ export declare interface PageInputChangingEvent extends ViewerEvent {
965
+ /**
966
+ * The page number string that is about to be applied.
967
+ */
968
+ value: string;
969
+ }
970
+
971
+ /**
972
+ * Provides functionality for managing and navigating through pages in a PDF document.
973
+ *
974
+ * @remarks
975
+ * This class handles page navigation, including setting the current page, moving to next/previous pages,
976
+ * and emitting events when page changes occur. It extends EventElement to support event-based communication.
977
+ */
978
+ export declare class PageNavigation implements EventElement<PageEventMap> {
979
+ /** @inheritdoc */
980
+ addEventListener<K extends keyof PageEventMap>(type: K, listener: (event: PageEventMap[K]) => void): void;
981
+ /**
982
+ * Gets the total number of pages in the currently loaded PDF document.
983
+ *
984
+ * @remarks
985
+ * This property returns the count of pages available in the document. The value is updated
986
+ * automatically when a new document is loaded or when the page count changes.
987
+ */
988
+ get numberOfPages(): number;
989
+ /**
990
+ * Gets the current page index that is being displayed.
991
+ *
992
+ * @remarks
993
+ * This property returns the zero-based index of the currently active page. The value is updated
994
+ * automatically when navigation occurs or when a new page is set programmatically.
995
+ */
996
+ get currentPage(): number;
997
+ /**
998
+ * Sets the current page to display in the PDF viewer.
999
+ *
1000
+ * @param page - The page index to navigate to (zero-based index).
1001
+ *
1002
+ * @remarks
1003
+ * This method changes the currently displayed page. It validates that the requested page index
1004
+ * is within bounds before attempting to change pages. If the page index is invalid, the method
1005
+ * returns without making any changes.
1006
+ *
1007
+ * The method emits a pageChanging event before changing the page, allowing listeners to cancel
1008
+ * or modify the navigation. If the event is not prevented, the current page index is updated.
1009
+ * The method also handles the case where the page index is out of bounds and prevents invalid navigation.
1010
+ */
1011
+ setCurrentPage(page: number): void;
1012
+ /**
1013
+ * Navigates to the next page in the PDF document.
1014
+ *
1015
+ * @remarks
1016
+ * This convenience method increments the current page index by 1 and calls setPage internally.
1017
+ * If already on the last page, this method has no effect.
1018
+ */
1019
+ nextPage(): void;
1020
+ /**
1021
+ * Navigates to the previous page in the PDF document.
1022
+ *
1023
+ * @remarks
1024
+ * This convenience method decrements the current page index by 1 and calls setPage internally.
1025
+ * If already on the first page, this method has no effect.
1026
+ */
1027
+ previousPage(): void;
1028
+ }
1029
+
1030
+ /**
1031
+ * PageNavigationFieldEventMap is an interface used to provide type-safe event listeners and is not instantiated
1032
+ * or used directly. It maps event names to their corresponding event object types and
1033
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
1034
+ */
1035
+ export declare interface PageNavigationFieldEventMap {
1036
+ /**
1037
+ * Event fired when the input value is about to change.
1038
+ */
1039
+ inputChanging: PageInputChangingEvent;
1040
+ /**
1041
+ * Event fired when the input value has changed and page navigation occurs.
1042
+ */
1043
+ inputChanged: PageInputChangedEvent;
1044
+ }
1045
+
1046
+ /**
1047
+ * Represents a field in the PDF viewer toolbar that allows users to navigate to specific pages by entering page numbers.
1048
+ *
1049
+ * @remarks
1050
+ * This component provides functionality for direct page navigation through user input, handling page number changes and validation.
1051
+ */
1052
+ export declare class PageNavigationFieldUI implements VisibilityElement, EventElement<PageNavigationFieldEventMap> {
1053
+ /** @inheritdoc */
1054
+ get isVisible(): boolean;
1055
+ /** @inheritdoc */
1056
+ set isVisible(value: boolean);
1057
+ /** @inheritdoc */
1058
+ addEventListener<K extends keyof PageNavigationFieldEventMap>(type: K, listener: (event: PageNavigationFieldEventMap[K]) => void): void;
1059
+ /**
1060
+ * Sets the input value and handles page navigation.
1061
+ *
1062
+ * @param value - The page number string to navigate to.
1063
+ */
1064
+ setInput(value: string): void;
1065
+ }
1066
+
1067
+ /**
1068
+ * Represents page navigation controls for the viewer toolbar.
1069
+ */
1070
+ export declare class PageNavigationUI implements VisibilityElement {
1071
+ /** @inheritdoc */
1072
+ get isVisible(): boolean;
1073
+ /** @inheritdoc */
1074
+ set isVisible(value: boolean);
1075
+ }
1076
+
1077
+ /**
1078
+ * Represents options for configuring the page navigation controls in the PDF viewer.
1079
+ *
1080
+ * @remarks
1081
+ * This interface provides control over whether the page navigation controls are visible.
1082
+ * It provides a simple way to enable or disable the ability to navigate between pages in the viewer.
1083
+ */
1084
+ export declare interface PageNavigationUIOptions extends VisibilityOption {
1085
+ }
1086
+
1087
+ /**
1088
+ * Represents the page width zoom mode value.
1089
+ *
1090
+ * @remarks
1091
+ * This constant is used to indicate that the zoom level should fit the page width within the viewport.
1092
+ */
1093
+ export declare const pageWidth = "pageWidth";
1094
+
1095
+ /**
1096
+ * Represents a button in the PDF viewer toolbar that enables pan mode for document navigation.
1097
+ *
1098
+ * @remarks
1099
+ * This button allows users to switch to pan mode, which enables dragging and panning through the document,
1100
+ * providing specific behavior for cursor mode switching.
1101
+ */
1102
+ export declare class PanModeButtonUI extends BasicButtonUI {
1103
+ }
1104
+
1105
+ /**
1106
+ * Represents options for configuring the pan mode button in the PDF viewer.
1107
+ *
1108
+ * @remarks
1109
+ * This interface provides control over whether the pan mode button is visible.
1110
+ * It provides a simple way to enable or disable the ability to switch to pan mode in the viewer.
1111
+ */
1112
+ export declare interface PanModeButtonUIOptions extends VisibilityOption {
1113
+ }
1114
+
1115
+ /**
1116
+ * Represents a button in the PDF viewer toolbar that navigates to the previous page of the document.
1117
+ *
1118
+ * @remarks
1119
+ * This button allows users to move backward through the pages of the loaded PDF document, providing specific behavior for page navigation.
1120
+ */
1121
+ export declare class PreviousPageButtonUI extends BasicButtonUI {
1122
+ }
1123
+
1124
+ /**
1125
+ * Represents a button in the PDF viewer toolbar that navigates to the previous search match.
1126
+ *
1127
+ * @remarks
1128
+ * This button allows users to move to the previous occurrence of their search query within the document,
1129
+ * providing specific behavior for search navigation.
1130
+ */
1131
+ export declare class PreviousSearchButtonUI extends BasicButtonUI {
1132
+ }
1133
+
1134
+ /**
1135
+ * Represents a button in the PDF viewer toolbar that allows users to print the current document.
1136
+ *
1137
+ * @remarks
1138
+ * This button triggers the printing functionality for the currently loaded PDF document when clicked,
1139
+ * providing specific behavior for document printing.
1140
+ */
1141
+ export declare class PrintButtonUI extends BasicButtonUI {
1142
+ }
1143
+
1144
+ /**
1145
+ * Represents options for configuring the print button in the PDF viewer.
1146
+ *
1147
+ * @remarks
1148
+ * This interface provides control over whether the print button is visible.
1149
+ * It provides a simple way to enable or disable the ability to print the current PDF document from the viewer.
1150
+ */
1151
+ export declare interface PrintButtonUIOptions extends VisibilityOption {
1152
+ }
1153
+
1154
+ /**
1155
+ * Represents an event that is fired when the search query has changed and text searching occurs.
1156
+ *
1157
+ * @remarks
1158
+ * This event provides read-only access to the search query after validation.
1159
+ */
1160
+ export declare interface QueryChangedEvent extends ViewerEvent {
1161
+ /**
1162
+ * The search query that has been applied.
1163
+ */
1164
+ readonly value: string;
1165
+ }
1166
+
1167
+ /**
1168
+ * Represents an event that is fired when the search query is about to change.
1169
+ *
1170
+ * @remarks
1171
+ * This event can be prevented to stop the search from occurring.
1172
+ */
1173
+ export declare interface QueryChangingEvent extends ViewerEvent {
1174
+ /**
1175
+ * The search query that is about to be applied.
1176
+ */
1177
+ value: string;
1178
+ }
1179
+
1180
+ /**
1181
+ * Provides search functionality for finding text within PDF documents.
1182
+ *
1183
+ * @remarks
1184
+ * The Search class enables users to search for specific text within a PDF document,
1185
+ * navigate between search results, and receive notifications about search progress
1186
+ * through events. It integrates with the underlying PDF.js library to perform
1187
+ * the actual search operations.
1188
+ */
1189
+ export declare class Search implements EventElement<SearchEventMap> {
1190
+ /** @inheritdoc */
1191
+ addEventListener<K extends keyof SearchEventMap>(type: K, listener: (event: SearchEventMap[K]) => void): void;
1192
+ /**
1193
+ * Gets the current search query text.
1194
+ *
1195
+ * @remarks
1196
+ * This property returns the text that is currently being searched for in the document.
1197
+ */
1198
+ get query(): string;
1199
+ /**
1200
+ * Gets the current position in the search results.
1201
+ *
1202
+ * @remarks
1203
+ * This property returns the index of the currently selected search result (zero-based).
1204
+ */
1205
+ get currentMatch(): number;
1206
+ /**
1207
+ * Gets the total number of search matches found.
1208
+ *
1209
+ * @remarks
1210
+ * This property returns the total count of all matches for the current search query.
1211
+ */
1212
+ get matchCount(): number;
1213
+ /**
1214
+ * Starts a new search operation with the specified query.
1215
+ *
1216
+ * @param query - The text to search for in the document. If undefined or empty, any active search is cancelled and cleared.
1217
+ *
1218
+ * @remarks
1219
+ * This method initiates a search for the specified query text. It emits a {@link SearchStartingEvent}
1220
+ * before performing the search, allowing listeners to cancel the operation if needed.
1221
+ * If the query is undefined or empty, it cancels any active search and clears the search state.
1222
+ */
1223
+ search(query: string | undefined): void;
1224
+ /**
1225
+ * Navigates to the next search match in the document.
1226
+ *
1227
+ * @remarks
1228
+ * This method moves the selection to the next occurrence of the current search query.
1229
+ * If there are no more matches after the current position, this method has no effect.
1230
+ */
1231
+ nextMatch(): void;
1232
+ /**
1233
+ * Navigates to the previous search match in the document.
1234
+ *
1235
+ * @remarks
1236
+ * This method moves the selection to the previous occurrence of the current search query.
1237
+ * If there are no matches before the current position, this method has no effect.
1238
+ */
1239
+ previousMatch(): void;
1240
+ /**
1241
+ * Ends the current search operation and clears all search state.
1242
+ *
1243
+ * @remarks
1244
+ * This method stops any active search, clears the query text, resets the match counter,
1245
+ * and hides the search UI elements. It should be called when search is no longer needed.
1246
+ */
1247
+ clear(): void;
1248
+ }
1249
+
1250
+ /**
1251
+ * Event emitted when a search operation is cancelled.
1252
+ *
1253
+ * @remarks
1254
+ * This event is fired when an active search is cancelled, either by the user
1255
+ * or programmatically. It indicates that no search results are currently available.
1256
+ */
1257
+ export declare interface SearchCancelledEvent {
1258
+ }
1259
+
1260
+ /**
1261
+ * Event emitted when a search operation completes.
1262
+ *
1263
+ * @remarks
1264
+ * This event is fired after a search operation finishes, containing information about
1265
+ * the search results including the query text, current match position, and total matches found.
1266
+ */
1267
+ export declare interface SearchCompletedEvent {
1268
+ /**
1269
+ * The search query text that was used to find matches in the document.
1270
+ *
1271
+ * @remarks
1272
+ * This property contains the actual query string that was searched for,
1273
+ * allowing consumers of this event to know what text produced the results.
1274
+ */
1275
+ readonly query: string;
1276
+ /**
1277
+ * The current position/index of the selected search match (0-based).
1278
+ *
1279
+ * @remarks
1280
+ * This property indicates which specific match is currently highlighted or selected
1281
+ * in the document. It's useful for tracking navigation through search results.
1282
+ */
1283
+ readonly currentPosition: number;
1284
+ /**
1285
+ * The total number of matches found for the search query.
1286
+ *
1287
+ * @remarks
1288
+ * This property provides the complete count of all occurrences of the search term
1289
+ * throughout the entire document, allowing UI elements to display progress information.
1290
+ */
1291
+ readonly matchCount: number;
1292
+ }
1293
+
1294
+ /**
1295
+ * SearchEventMap is an interface used to provide type-safe event listeners and is not instantiated
1296
+ * or used directly. It maps event names to their corresponding event object types and
1297
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
1298
+ *
1299
+ * @remarks
1300
+ * This interface defines the types of events that can be emitted during search operations,
1301
+ * including when a search starts, is cancelled, or completes.
1302
+ */
1303
+ export declare interface SearchEventMap {
1304
+ /**
1305
+ * Event emitted when a search operation is starting.
1306
+ *
1307
+ * @remarks
1308
+ * This event is fired before the actual search begins, allowing listeners to cancel
1309
+ * or modify the search operation. The event contains the query text that will be searched for.
1310
+ */
1311
+ searchStarting: SearchStartingEvent;
1312
+ /**
1313
+ * Event emitted when a search operation is cancelled.
1314
+ *
1315
+ * @remarks
1316
+ * This event is fired when an active search is cancelled, either by the user
1317
+ * or programmatically. It indicates that no search results are currently available.
1318
+ */
1319
+ searchCancelled: SearchCancelledEvent;
1320
+ /**
1321
+ * Event emitted when a search operation completes.
1322
+ *
1323
+ * @remarks
1324
+ * This event is fired after a search operation finishes, containing information about
1325
+ * the search results including the query text, current match position, and total matches found.
1326
+ */
1327
+ searchCompleted: SearchCompletedEvent;
1328
+ }
1329
+
1330
+ /**
1331
+ * SearchFieldEventMap is an interface used to provide type-safe event listeners and is not instantiated
1332
+ * or used directly. It maps event names to their corresponding event object types and
1333
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
1334
+ */
1335
+ export declare interface SearchFieldEventMap {
1336
+ /**
1337
+ * Event fired when the search query is about to change.
1338
+ */
1339
+ queryChanging: QueryChangingEvent;
1340
+ /**
1341
+ * Event fired when the search query has changed and text searching occurs.
1342
+ */
1343
+ queryChanged: QueryChangedEvent;
1344
+ }
1345
+
1346
+ /**
1347
+ * Represents a field in the PDF viewer toolbar that allows users to search for text within documents.
1348
+ *
1349
+ * @remarks
1350
+ * This component provides functionality for text searching through user input, handling search queries and validation.
1351
+ */
1352
+ export declare class SearchFieldUI implements VisibilityElement, EventElement<SearchFieldEventMap> {
1353
+ /** @inheritdoc */
1354
+ get isVisible(): boolean;
1355
+ /** @inheritdoc */
1356
+ set isVisible(value: boolean);
1357
+ /** @inheritdoc */
1358
+ addEventListener<K extends keyof SearchFieldEventMap>(type: K, listener: (event: SearchFieldEventMap[K]) => void): void;
1359
+ /**
1360
+ * Sets the search query and handles text searching.
1361
+ *
1362
+ * @param value - The search query string to find in the document.
1363
+ */
1364
+ setQuery(value: string): void;
1365
+ }
1366
+
1367
+ /**
1368
+ * Event emitted when a search operation is starting.
1369
+ *
1370
+ * @remarks
1371
+ * This event is fired before the actual search begins, allowing listeners to cancel
1372
+ * or modify the search operation. The event contains the query text that will be searched for.
1373
+ */
1374
+ export declare interface SearchStartingEvent extends ViewerEvent {
1375
+ /**
1376
+ * The search query text that will be searched for in the document.
1377
+ *
1378
+ * @remarks
1379
+ * This property contains the text that users want to find within the PDF document.
1380
+ */
1381
+ query: string;
1382
+ }
1383
+
1384
+ /**
1385
+ * Represents search controls for the viewer toolbar.
1386
+ */
1387
+ export declare class SearchUI implements VisibilityElement {
1388
+ /** @inheritdoc */
1389
+ get isVisible(): boolean;
1390
+ /** @inheritdoc */
1391
+ set isVisible(value: boolean);
1392
+ }
1393
+
1394
+ /**
1395
+ * Represents options for configuring the search functionality in the PDF viewer.
1396
+ *
1397
+ * @remarks
1398
+ * This interface provides control over whether the search button is visible.
1399
+ * It provides a simple way to enable or disable the search feature in the viewer.
1400
+ */
1401
+ export declare interface SearchUIOptions extends VisibilityOption {
1402
+ }
1403
+
1404
+ /**
1405
+ * Represents a button that toggles the visibility of the side panel in the PDF viewer.
1406
+ *
1407
+ * @remarks
1408
+ * This button handles side panel visibility toggling.
1409
+ * When clicked, it emits an event to toggle the side panel's visibility state.
1410
+ */
1411
+ export declare class SidePanelButtonUI extends BasicButtonUI {
1412
+ }
1413
+
1414
+ /**
1415
+ * Represents options for configuring the side panel button in the PDF viewer.
1416
+ *
1417
+ * @remarks
1418
+ * This interface provides control over whether the side panel button is visible.
1419
+ * It provides a simple way to enable or disable the ability to access the side panel from the viewer.
1420
+ */
1421
+ export declare interface SidePanelButtonUIOptions extends VisibilityOption {
1422
+ }
1423
+
1424
+ /**
1425
+ * Represents the different types of panels that can be displayed in the side panel.
1426
+ *
1427
+ * @remarks
1428
+ * This enum defines the available panel types for the side panel component, including
1429
+ * thumbnails, bookmarks, and signature panels.
1430
+ */
1431
+ export declare enum SidePanelType {
1432
+ /**
1433
+ * The thumbnail panel type.
1434
+ *
1435
+ * @remarks
1436
+ * Displays thumbnail images of all pages in the PDF document.
1437
+ */
1438
+ THUMBNAIL = 1,
1439
+ /**
1440
+ * The bookmarks panel type.
1441
+ *
1442
+ * @remarks
1443
+ * Displays a hierarchical list of bookmarks/outline items from the PDF document.
1444
+ */
1445
+ BOOKMARKS = 2
1446
+ }
1447
+
1448
+ /**
1449
+ * Represents the side panel component of the PDF viewer.
1450
+ *
1451
+ * @remarks
1452
+ * This class manages the side panel UI element, including its visibility, pinned state,
1453
+ * and the currently active panel type (thumbnails, bookmarks, etc.).
1454
+ */
1455
+ export declare class SidePanelUI implements VisibilityElement {
1456
+ /**
1457
+ * Gets the digital signature component of the side panel.
1458
+ *
1459
+ * @remarks
1460
+ * This property provides access to the digital signature functionality and configuration.
1461
+ */
1462
+ readonly digitalSignature: DigitalSignatureUI;
1463
+ /**
1464
+ * Gets the electronic signature component of the side panel.
1465
+ *
1466
+ * @remarks
1467
+ * This property provides access to the electronic signature functionality and configuration.
1468
+ */
1469
+ readonly eSignature: ESignatureUI;
1470
+ /**
1471
+ * The value indicating whether the side panel is visible.
1472
+ *
1473
+ * @remarks
1474
+ * When setting this property to false, the panel will be unpinned and reset to show thumbnails.
1475
+ */
1476
+ get isVisible(): boolean;
1477
+ /**
1478
+ * The value indicating whether the side panel is visible.
1479
+ *
1480
+ * @remarks
1481
+ * When setting this property to false, the panel will be unpinned and reset to show thumbnails.
1482
+ *
1483
+ * @param value - The boolean value to set for visibility
1484
+ */
1485
+ set isVisible(value: boolean);
1486
+ /**
1487
+ * The value indicating whether the side panel is pinned open.
1488
+ *
1489
+ * @remarks
1490
+ * When pinned, the side panel remains visible even when not actively used. When unpinned,
1491
+ * the panel will close automatically after inactivity.
1492
+ */
1493
+ get isPinned(): boolean;
1494
+ /**
1495
+ * The value indicating whether the side panel is pinned open.
1496
+ *
1497
+ * @param value - The boolean value to set for pinned state
1498
+ */
1499
+ set isPinned(value: boolean);
1500
+ /**
1501
+ * The active {@link SidePanelType} for the side panel.
1502
+ *
1503
+ * @remarks
1504
+ * This property determines which sub-panel is currently being displayed within
1505
+ * the side panel, such as thumbnails or bookmarks.
1506
+ */
1507
+ get activeSidePanelType(): SidePanelType;
1508
+ /**
1509
+ * The active {@link SidePanelType} for the side panel.
1510
+ *
1511
+ * @param value - The {@link SidePanelType} to set as active
1512
+ *
1513
+ * @remarks
1514
+ * This property determines which sub-panel is currently being displayed within
1515
+ * the side panel, such as thumbnails or bookmarks.
1516
+ */
1517
+ set activeSidePanelType(value: SidePanelType);
1518
+ }
1519
+
1520
+ /**
1521
+ * Represents configuration options for the side panel in the PDF viewer.
1522
+ *
1523
+ * @remarks
1524
+ * The side panel provides access to additional features like electronic signatures and digital signatures.
1525
+ * This interface allows you to control the visibility of the side panel and configure the available features.
1526
+ */
1527
+ export declare interface SidePanelUIOptions {
1528
+ /**
1529
+ * Gets or sets a value indicating whether the side panel is visible.
1530
+ * Defaults to false if not specified.
1531
+ */
1532
+ isVisible?: boolean;
1533
+ /**
1534
+ * Gets or sets options for electronic signature functionality on the side panel.
1535
+ */
1536
+ eSignature?: ESignatureUIOptions;
1537
+ /**
1538
+ * Gets or sets options for digital signature functionality on the side panel.
1539
+ */
1540
+ digitalSignature?: DigitalSignatureUIOptions;
1541
+ }
1542
+
1543
+ /**
1544
+ * Represents a button in the PDF viewer toolbar that opens the signature panel for digital signing and e-signature.
1545
+ *
1546
+ * @remarks
1547
+ * This button allows users to access digital signature and e-signature functionality,
1548
+ * enabling them to add e-signatures and sign documents electronically.
1549
+ */
1550
+ export declare class SignatureButtonUI extends BasicButtonUI {
1551
+ }
1552
+
1553
+ /**
1554
+ * Represents options for configuring the signature button in the PDF viewer toolbar.
1555
+ *
1556
+ * @remarks
1557
+ * This interface provides control over whether the signature button is visible.
1558
+ * It provides a simple way to enable or disable the ability to add electronic signatures or signing the PDF document from the viewer.
1559
+ */
1560
+ export declare interface SignatureButtonUIOptions extends VisibilityOption {
1561
+ }
1562
+
1563
+ /**
1564
+ * Represents a button in the PDF viewer toolbar that enables text selection mode.
1565
+ *
1566
+ * @remarks
1567
+ * This button allows users to switch to text selection mode, which enables selecting and copying text from the document,
1568
+ * providing specific behavior for cursor mode switching.
1569
+ */
1570
+ export declare class TextSelectionButtonUI extends BasicButtonUI {
1571
+ }
1572
+
1573
+ /**
1574
+ * Represents options for configuring the text selection button in the PDF viewer toolbar.
1575
+ *
1576
+ * @remarks
1577
+ * This interface provides control over whether the text selection button is visible.
1578
+ * It provides a simple way to enable or disable the ability to switch to text selection in the viewer.
1579
+ */
1580
+ export declare interface TextSelectionButtonUIOptions extends VisibilityOption {
1581
+ }
1582
+
1583
+ /**
1584
+ * Represents the available theme options for the PDF viewer UI.
1585
+ *
1586
+ * @remarks
1587
+ * Themes control the color scheme and appearance of the viewer interface. Available themes include light, dark, and various colored variants.
1588
+ */
1589
+ export declare type Theme = "light" | "dark" | "red" | "dark-red" | "blue" | "dark-blue" | "green" | "dark-green";
1590
+
1591
+ /**
1592
+ * Represents the toolbar component in the PDF viewer that contains various buttons and controls for document interaction.
1593
+ */
1594
+ export declare class ToolbarUI {
1595
+ /**
1596
+ * Gets the side panel button that toggles the visibility of the side panel.
1597
+ */
1598
+ readonly sidePanelButton: SidePanelButtonUI;
1599
+ /**
1600
+ * Gets the open button that allows users to select and open PDF files from their local system.
1601
+ */
1602
+ readonly openButton: OpenButtonUI;
1603
+ /**
1604
+ * Gets the download button that triggers the download of the currently loaded PDF document.
1605
+ */
1606
+ readonly downloadButton: DownloadButtonUI;
1607
+ /**
1608
+ * Gets the print button that initiates the printing functionality for the current document.
1609
+ */
1610
+ readonly printButton: PrintButtonUI;
1611
+ /**
1612
+ * Gets the signature button that opens the digital signature panel for electronic signing.
1613
+ */
1614
+ readonly signatureButton: SignatureButtonUI;
1615
+ /**
1616
+ * Gets the free text annotation controls for adding and configuring free text annotations.
1617
+ *
1618
+ * @remarks
1619
+ * The free text controls allow users to add, edit, and customize free text annotations in PDF documents.
1620
+ */
1621
+ readonly freeText: FreeTextUI;
1622
+ /**
1623
+ * Gets the hand drawing annotation controls for adding and configuring freehand drawings.
1624
+ *
1625
+ * @remarks
1626
+ * The hand drawing controls allow users to create, edit, and customize freehand drawings in PDF documents.
1627
+ */
1628
+ readonly handDrawing: HandDrawingUI;
1629
+ /**
1630
+ * Gets the text selection button that enables text selection mode for copying text from the document.
1631
+ */
1632
+ readonly textSelectionButton: TextSelectionButtonUI;
1633
+ /**
1634
+ * Gets the pan mode button that enables dragging and panning through the document.
1635
+ */
1636
+ readonly panModeButton: PanModeButtonUI;
1637
+ /**
1638
+ * Gets the zoom controls that manage document magnification.
1639
+ *
1640
+ * @remarks
1641
+ * The zoom controls appear as buttons, field, and dropdown in the toolbar
1642
+ * and control the zoom level of the PDF document.
1643
+ */
1644
+ readonly zoom: ZoomUI;
1645
+ /**
1646
+ * Gets the page navigation controls for moving between pages in the document.
1647
+ *
1648
+ * @remarks
1649
+ * The navigation controls appear as buttons in the toolbar and control the visual
1650
+ * representation of which page is currently displayed in the HTML view.
1651
+ */
1652
+ readonly pageNavigation: PageNavigationUI;
1653
+ /**
1654
+ * Gets the search controls for finding text within the document.
1655
+ *
1656
+ * @remarks
1657
+ * The search controls appear as input fields and buttons in the toolbar and control
1658
+ * the visual highlighting of search results within the HTML-rendered PDF content.
1659
+ */
1660
+ readonly search: SearchUI;
1661
+ }
1662
+
1663
+ /**
1664
+ * Configuration options for the toolbar in the PDF viewer.
1665
+ *
1666
+ * @remarks
1667
+ * This interface defines all available toolbar buttons and their configuration options,
1668
+ * allowing customization of which buttons or elements appear and how they behave. Each property is optional,
1669
+ * enabling selective inclusion of toolbar functionality based on application requirements.
1670
+ */
1671
+ export declare interface ToolbarUIOptions {
1672
+ /**
1673
+ * Options for the side panel button in the toolbar.
1674
+ */
1675
+ sidePanelButton?: SidePanelButtonUIOptions;
1676
+ /**
1677
+ * Options for the open button in the toolbar.
1678
+ */
1679
+ openButton?: OpenButtonUIOptions;
1680
+ /**
1681
+ * Options for the download button in the toolbar.
1682
+ */
1683
+ downloadButton?: DownloadButtonUIOptions;
1684
+ /**
1685
+ * Options for the print button in the toolbar.
1686
+ */
1687
+ printButton?: PrintButtonUIOptions;
1688
+ /**
1689
+ * Options for the signature button in the toolbar.
1690
+ */
1691
+ signatureButton?: SignatureButtonUIOptions;
1692
+ /**
1693
+ * All page navigation options including first, previous, next, and last page buttons.
1694
+ */
1695
+ pageNavigation?: PageNavigationUIOptions;
1696
+ /**
1697
+ * All zooming options including zoom in, zoom out, and fit width/height buttons.
1698
+ */
1699
+ zoom?: ZoomUIOptions;
1700
+ /**
1701
+ * Options for the text selection button in the toolbar.
1702
+ */
1703
+ textSelectionButton?: TextSelectionButtonUIOptions;
1704
+ /**
1705
+ * Options for the pan mode button in the toolbar.
1706
+ */
1707
+ panModeButton?: PanModeButtonUIOptions;
1708
+ /**
1709
+ * Options for the search functionality in the toolbar.
1710
+ */
1711
+ search?: SearchUIOptions;
1712
+ /**
1713
+ * Options for the free text annotation feature in the toolbar.
1714
+ *
1715
+ * @remarks
1716
+ * This property configures the visibility and behavior of free text annotation controls,
1717
+ * allowing users to add and customize free text annotations in PDF documents.
1718
+ */
1719
+ freeText?: FreeTextUIOptions;
1720
+ /**
1721
+ * Options for the hand drawing annotation feature in the toolbar.
1722
+ *
1723
+ * @remarks
1724
+ * This property configures the visibility and behavior of hand drawing annotation controls,
1725
+ * allowing users to add and customize freehand drawings in PDF documents.
1726
+ */
1727
+ handDrawing?: HandDrawingUIOptions;
1728
+ }
1729
+
1730
+ /**
1731
+ * Provides access to user interface components and configuration options for the PDF viewer.
1732
+ *
1733
+ * @remarks
1734
+ * This class contains references to UI elements that can be customized, including theme settings,
1735
+ * toolbar configuration, and side panel options.
1736
+ */
1737
+ export declare class UI {
1738
+ /**
1739
+ * Gets or sets the theme for the PDF viewer.
1740
+ *
1741
+ * @remarks
1742
+ * Controls the color scheme of the viewer.
1743
+ * Predefined theme from {@link Theme} can be picked to match your application's color palette.
1744
+ * Defaults to "light".
1745
+ */
1746
+ readonly theme?: Theme;
1747
+ /**
1748
+ * Gets the toolbar component of the PDF viewer.
1749
+ *
1750
+ * @remarks
1751
+ * Provides access to toolbar configuration and functionality, including buttons for common actions
1752
+ * like opening files, printing, zooming, and navigating through pages.
1753
+ */
1754
+ readonly toolbar: ToolbarUI;
1755
+ /**
1756
+ * Gets the side panel component of the PDF viewer.
1757
+ *
1758
+ * @remarks
1759
+ * Controls the side panel that typically contains additional functionality such as layers,
1760
+ * outlines, thumbnails, and other navigation aids.
1761
+ */
1762
+ readonly sidePanel: SidePanelUI;
1763
+ }
1764
+
1765
+ /**
1766
+ * Options for configuring the user interface of the PDF viewer.
1767
+ *
1768
+ * @remarks
1769
+ * This interface provides configuration options for the PDF viewer's user interface, including
1770
+ * theme, toolbar, localization, and side panel settings. These options allow you to customize
1771
+ * the appearance and behavior of the viewer to match your application's design requirements.
1772
+ */
1773
+ export declare interface UIOptions {
1774
+ /**
1775
+ * Gets or sets the theme for the PDF viewer user interface.
1776
+ *
1777
+ * @remarks
1778
+ * This property allows you to configure the visual appearance of the viewer. The theme can be customized to match your application's design.
1779
+ */
1780
+ theme?: Theme;
1781
+ /**
1782
+ * Gets or sets the toolbar options for the PDF viewer.
1783
+ *
1784
+ * @remarks
1785
+ * This property provides configuration options for the toolbar, including which buttons to display and their layout.
1786
+ */
1787
+ toolbar?: ToolbarUIOptions;
1788
+ /**
1789
+ * Gets or sets the localization options for the PDF viewer.
1790
+ *
1791
+ * @remarks
1792
+ * This property allows you to specify the language for the user interface. You can use predefined languages ("en", "de", "es")
1793
+ * or provide custom localized messages through a {@link NestedMessages} object.
1794
+ */
1795
+ localization?: "en" | "de" | "es" | NestedMessages;
1796
+ /**
1797
+ * Gets or sets the side panel options for the PDF viewer.
1798
+ *
1799
+ * @remarks
1800
+ * This property provides configuration options for the side panel, including which panels to display and their initial state.
1801
+ * The side panel provides access to additional features like electronic signatures and digital signatures.
1802
+ */
1803
+ sidePanel?: SidePanelUIOptions;
1804
+ }
1805
+
1806
+ /**
1807
+ * Represents an event that is fired when the zoom level has changed and been applied.
1808
+ *
1809
+ * @remarks
1810
+ * This event provides read-only access to the selected zoom level after validation.
1811
+ */
1812
+ export declare interface ValueChangedEvent extends ViewerEvent {
1813
+ /**
1814
+ * The zoom level that has been applied.
1815
+ */
1816
+ readonly value: DropdownValues;
1817
+ }
1818
+
1819
+ /**
1820
+ * Represents an event that is fired when the zoom level is about to change.
1821
+ *
1822
+ * @remarks
1823
+ * This event can be prevented to stop the zoom level from being applied.
1824
+ */
1825
+ export declare interface ValueChangingEvent extends ViewerEvent {
1826
+ /**
1827
+ * The zoom level that is about to be applied.
1828
+ */
1829
+ value: DropdownValues;
1830
+ }
1831
+
1832
+ /**
1833
+ * Represents a base event interface for the PDF viewer that provides functionality
1834
+ * similar to the standard DOM Event interface, allowing events to be canceled.
1835
+ *
1836
+ * @remarks
1837
+ * This interface defines the core event handling capabilities including:
1838
+ * <ul>
1839
+ * <li>The ability to check if an event's default action has been prevented.</li>
1840
+ * <li>The ability to prevent the default action of an event.</li>
1841
+ * </ul>
1842
+ */
1843
+ export declare interface ViewerEvent {
1844
+ /**
1845
+ * Gets a value indicating whether the event's default action has been canceled.
1846
+ *
1847
+ * @remarks
1848
+ * The **`defaultPrevented`** read-only property returns `true` if the call to Event.preventDefault()
1849
+ * canceled the event, otherwise it returns `false`.
1850
+ */
1851
+ readonly defaultPrevented: boolean;
1852
+ /**
1853
+ * Cancels the event if it is cancelable, without stopping further propagation of the event.
1854
+ *
1855
+ * @remarks
1856
+ * This method call indicates that the event's default action should be prevented.
1857
+ * If the event is not cancelable, this method has no effect.
1858
+ * The event can be prevented to stop the default behavior from occurring.
1859
+ */
1860
+ preventDefault(): void;
1861
+ }
1862
+
1863
+ /**
1864
+ * Represents the configuration options for the PDF viewer.
1865
+ *
1866
+ * @remarks
1867
+ * This interface defines the various settings that can be used to customize the behavior and appearance of the PDF viewer when it's created.
1868
+ */
1869
+ export declare interface ViewerOptions {
1870
+ /**
1871
+ * The container element where the PDF viewer will be mounted.
1872
+ *
1873
+ * @remarks
1874
+ * Can be either an {@link HTMLElement} reference or id selector as {@link string} (e.g., "#myContainer").
1875
+ * If the container cannot be found using the provided selector, an error will be thrown.
1876
+ */
1877
+ container: HTMLElement | string;
1878
+ /**
1879
+ * The initial PDF document to load when the viewer is created.
1880
+ *
1881
+ * @remarks
1882
+ * This is an optional property. If not provided, the viewer will be created without a loaded document.
1883
+ * This can be:
1884
+ * <ul>
1885
+ * <li>A URL string pointing to a PDF file.</li>
1886
+ * <li>A base64 encoded string representing the PDF content.</li>
1887
+ * <li>A Uint8Array containing the raw PDF bytes.</li>
1888
+ * <li>An ArrayBuffer containing the raw PDF data.</li>
1889
+ * </ul>
1890
+ * If the document cannot be loaded, the promise will reject with an error.
1891
+ */
1892
+ initialDocument?: string | Uint8Array | ArrayBuffer;
1893
+ /**
1894
+ * Configuration options for the user interface components.
1895
+ *
1896
+ * @remarks
1897
+ * Allows customization of UI elements like theme, toolbar, and side panel configuration.
1898
+ */
1899
+ ui?: UIOptions;
1900
+ /**
1901
+ * Configuration options for various features such as annotations, digital signing, zoom, page navigation, and search functionality.
1902
+ *
1903
+ * @remarks
1904
+ * Controls which features are enabled and how they behave in the PDF viewer.
1905
+ */
1906
+ features?: FeaturesOptions;
1907
+ }
1908
+
1909
+ /**
1910
+ * Represents an element that supports visibility capabilities.
1911
+ *
1912
+ * @remarks
1913
+ * This interface provides functionality to get and update the visibility of the element.
1914
+ * It allows controlling whether the element is displayed or hidden in the UI.
1915
+ */
1916
+ export declare interface VisibilityElement {
1917
+ /**
1918
+ * The current visibility state of the element.
1919
+ *
1920
+ * @remarks
1921
+ * This property returns true if the element is currently visible, false otherwise.
1922
+ * The value is updated automatically when the visibility changes.
1923
+ */
1924
+ get isVisible(): boolean;
1925
+ /**
1926
+ * The current visibility state of the element.
1927
+ *
1928
+ * @param value - The new visibility state (true to show, false to hide).
1929
+ */
1930
+ set isVisible(value: boolean);
1931
+ }
1932
+
1933
+ /**
1934
+ * Represents options for controlling the visibility of PDF viewer elements.
1935
+ *
1936
+ * @remarks
1937
+ * This interface provides a simple way to control whether certain UI elements or features should be visible in the PDF viewer.
1938
+ */
1939
+ export declare interface VisibilityOption {
1940
+ /**
1941
+ * Gets or sets whether the element is visible.
1942
+ *
1943
+ * @remarks
1944
+ * When set to true, the element will be displayed. When false, the element will be hidden.
1945
+ * If not specified, defaults to true (visible).
1946
+ */
1947
+ isVisible?: boolean;
1948
+ }
1949
+
1950
+ /**
1951
+ * Provides zoom functionality for the PDF viewer.
1952
+ *
1953
+ * @remarks
1954
+ * The Zoom class manages zoom operations including setting zoom levels, handling zoom events,
1955
+ * and providing access to current zoom state.
1956
+ */
1957
+ export declare class Zoom implements EventElement<ZoomEventMap> {
1958
+ /** @inheritdoc */
1959
+ addEventListener<K extends keyof ZoomEventMap>(type: K, listener: (event: ZoomEventMap[K]) => void): void;
1960
+ /**
1961
+ * Gets the current zoom level.
1962
+ */
1963
+ get zoomLevel(): ZoomLevel;
1964
+ /**
1965
+ * Sets the zoom level for the PDF viewer.
1966
+ *
1967
+ * @param value - The zoom level to set (e.g., "automatic", "pageFit", or a percentage value).
1968
+ *
1969
+ * @remarks
1970
+ * This method changes the zoom level of the PDF viewer. It emits zoomChanging and zoomChanged events,
1971
+ * allowing listeners to respond to the zoom change. The zoomLevel parameter can be:
1972
+ * <ul>
1973
+ * <li>A predefined zoom level like "automatic", "pageFit", or "pageWidth".</li>
1974
+ * <li>A numeric value representing a percentage (e.g., 150 for 150%).</li>
1975
+ * </ul>
1976
+ */
1977
+ set zoomLevel(value: ZoomLevel);
1978
+ /**
1979
+ * Zooms the PDF viewer by a relative scale factor.
1980
+ *
1981
+ * @param scale - The relative scale factor to apply (e.g., 1.2 for 20% zoom in, 0.8 for 20% zoom out).
1982
+ *
1983
+ * @remarks
1984
+ * This method adjusts the current zoom level by multiplying it with the provided scale factor.
1985
+ * For example, a scale of 1.5 will increase the zoom by 50%, while a scale of 0.75 will decrease
1986
+ * the zoom by 25%.
1987
+ */
1988
+ zoomRelative(scale: number): void;
1989
+ }
1990
+
1991
+ /**
1992
+ * Represents an event that is emitted when the zoom level has changed.
1993
+ *
1994
+ * @remarks
1995
+ * This interface defines the properties available in a zoom changed event,
1996
+ * including the previous and current zoom levels. This event is emitted after
1997
+ * the zoom operation has been completed successfully.
1998
+ */
1999
+ export declare interface ZoomChangedEvent extends ViewerEvent {
2000
+ /**
2001
+ * The zoom level before the change.
2002
+ */
2003
+ readonly zoomLevelBefore: ZoomLevel;
2004
+ /**
2005
+ * The zoom level after the change.
2006
+ */
2007
+ readonly zoomLevelAfter: ZoomLevel;
2008
+ }
2009
+
2010
+ /**
2011
+ * Represents an event that is emitted when the zoom level is about to change.
2012
+ *
2013
+ * @remarks
2014
+ * This interface defines the properties available in a zoom changing event,
2015
+ * including the current and future zoom levels. The zoomLevelAfter property can be modified
2016
+ * by event listeners to change the target zoom level.
2017
+ */
2018
+ export declare interface ZoomChangingEvent extends ViewerEvent {
2019
+ /**
2020
+ * The zoom level before the change.
2021
+ */
2022
+ readonly zoomLevelBefore: ZoomLevel;
2023
+ /**
2024
+ * The target zoom level that can be modified by event listeners.
2025
+ */
2026
+ zoomLevelAfter: ZoomLevel;
2027
+ }
2028
+
2029
+ /**
2030
+ * ZoomDropdownEventMap is an interface used to provide type-safe event listeners and is not instantiated
2031
+ * or used directly. It maps event names to their corresponding event object types and
2032
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
2033
+ */
2034
+ export declare interface ZoomDropdownEventMap {
2035
+ /**
2036
+ * Event fired when the zoom level is about to change.
2037
+ */
2038
+ valueChanging: ValueChangingEvent;
2039
+ /**
2040
+ * Event fired when the zoom level has changed and been applied.
2041
+ */
2042
+ valueChanged: ValueChangedEvent;
2043
+ }
2044
+
2045
+ /**
2046
+ * Represents a dropdown in the PDF viewer toolbar that allows users to select different zoom levels.
2047
+ *
2048
+ * @remarks
2049
+ * This component provides functionality for zoom level selection through user input, handling zoom changes and validation.
2050
+ */
2051
+ export declare class ZoomDropdownUI implements VisibilityElement, EventElement<ZoomDropdownEventMap> {
2052
+ /** @inheritdoc */
2053
+ get isVisible(): boolean;
2054
+ /** @inheritdoc */
2055
+ set isVisible(value: boolean);
2056
+ /** @inheritdoc */
2057
+ addEventListener<K extends keyof ZoomDropdownEventMap>(type: K, listener: (event: ZoomDropdownEventMap[K]) => void): void;
2058
+ /**
2059
+ * Selects a zoom level from the dropdown.
2060
+ *
2061
+ * @param value - The zoom level to apply
2062
+ */
2063
+ select(value: DropdownValues): void;
2064
+ /**
2065
+ * Whether the dropdown is opened or closed.
2066
+ */
2067
+ get isOpened(): boolean;
2068
+ /**
2069
+ * Whether the dropdown is opened or closed.
2070
+ *
2071
+ * @param value - The visibility state to set.
2072
+ */
2073
+ set isOpened(value: boolean);
2074
+ /**
2075
+ * Toggles the open/closed state of the dropdown.
2076
+ */
2077
+ toggleOpen(): void;
2078
+ }
2079
+
2080
+ /**
2081
+ * ZoomEventMap is an interface used to provide type-safe event listeners and is not instantiated
2082
+ * or used directly. It maps event names to their corresponding event object types and
2083
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
2084
+ *
2085
+ * @remarks
2086
+ * This interface defines the types of events that can be emitted by the Zoom class,
2087
+ * including zoom changing and zoom changed events.
2088
+ */
2089
+ export declare interface ZoomEventMap {
2090
+ zoomChanging: ZoomChangingEvent;
2091
+ zoomChanged: ZoomChangedEvent;
2092
+ }
2093
+
2094
+ /**
2095
+ * ZoomInButtonEventMap is an interface used to provide type-safe event listeners and is not instantiated
2096
+ * or used directly. It maps event names to their corresponding event object types and
2097
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
2098
+ */
2099
+ export declare interface ZoomInButtonEventMap {
2100
+ /**
2101
+ * Event fired when the zoom in button is clicked.
2102
+ */
2103
+ click: ZoomInClickEvent;
2104
+ }
2105
+
2106
+ /**
2107
+ * Represents a button in the PDF viewer toolbar that increases the magnification level of the document view.
2108
+ *
2109
+ * @remarks
2110
+ * This component provides functionality for zooming in on the document, handling zoom changes with before/after information.
2111
+ */
2112
+ export declare class ZoomInButtonUI implements VisibilityElement, EventElement<ZoomInButtonEventMap> {
2113
+ /** @inheritdoc */
2114
+ get isVisible(): boolean;
2115
+ /** @inheritdoc */
2116
+ set isVisible(value: boolean);
2117
+ /** @inheritdoc */
2118
+ addEventListener<K extends keyof ZoomInButtonEventMap>(type: K, listener: (event: ZoomInButtonEventMap[K]) => void): void;
2119
+ /**
2120
+ * Increases the zoom level by one step.
2121
+ *
2122
+ * @remarks
2123
+ * This method calculates the next appropriate zoom level based on predefined steps and
2124
+ * emits {@link ZoomInClickEvent} before applying the change.
2125
+ */
2126
+ click(): Promise<void>;
2127
+ }
2128
+
2129
+ /**
2130
+ * Represents an event that is fired when the zoom in button is clicked.
2131
+ *
2132
+ * @remarks
2133
+ * This event provides read-only access to the current zoom level and allows modification of the target
2134
+ * zoom level before it's applied. The event can be prevented to stop the zoom operation entirely.
2135
+ */
2136
+ export declare interface ZoomInClickEvent extends ViewerEvent {
2137
+ /**
2138
+ * The current zoom level before the change.
2139
+ */
2140
+ readonly zoomLevelBefore: number;
2141
+ /**
2142
+ * The target zoom level after the change. This value can be modified to customize the zoom operation.
2143
+ */
2144
+ zoomLevelAfter: number;
2145
+ }
2146
+
2147
+ /**
2148
+ * Represents the zoom level that can be applied to the PDF viewer.
2149
+ *
2150
+ * @remarks
2151
+ * Zoom levels can be specified as a numeric value (percentage) or using predefined constants for automatic fitting, page fit, or page width.
2152
+ */
2153
+ export declare type ZoomLevel = number | typeof constants.automatic | typeof constants.pageFit | typeof constants.pageWidth;
2154
+
2155
+ /**
2156
+ * ZoomOutButtonEventMap is an interface used to provide type-safe event listeners and is not instantiated
2157
+ * or used directly. It maps event names to their corresponding event object types and
2158
+ * is consumed by addEventListener to ensure correct typing of listener callbacks.
2159
+ */
2160
+ export declare interface ZoomOutButtonEventMap {
2161
+ /**
2162
+ * Event fired when the zoom out button is clicked.
2163
+ */
2164
+ click: ZoomOutClickEvent;
2165
+ }
2166
+
2167
+ /**
2168
+ * Represents a button in the PDF viewer toolbar that decreases the magnification level of the document view.
2169
+ *
2170
+ * @remarks
2171
+ * This component provides functionality for zooming out on the document, handling zoom changes with before/after information.
2172
+ */
2173
+ export declare class ZoomOutButtonUI implements VisibilityElement, EventElement<ZoomOutButtonEventMap> {
2174
+ /** @inheritdoc */
2175
+ get isVisible(): boolean;
2176
+ /** @inheritdoc */
2177
+ set isVisible(value: boolean);
2178
+ /** @inheritdoc */
2179
+ addEventListener<K extends keyof ZoomOutButtonEventMap>(type: K, listener: (event: ZoomOutButtonEventMap[K]) => void): void;
2180
+ /**
2181
+ * Decreases the zoom level by one step.
2182
+ *
2183
+ * @remarks
2184
+ * This method calculates the previous appropriate zoom level based on predefined steps and
2185
+ * emits {@link ZoomOutClickEvent} before applying the change.
2186
+ */
2187
+ click(): Promise<void>;
2188
+ }
2189
+
2190
+ /**
2191
+ * Represents an event that is fired when the zoom out button is clicked.
2192
+ *
2193
+ * @remarks
2194
+ * This event provides read-only access to the current zoom level and allows modification of the target
2195
+ * zoom level before it's applied. The event can be prevented to stop the zoom operation entirely.
2196
+ */
2197
+ export declare interface ZoomOutClickEvent extends ViewerEvent {
2198
+ /**
2199
+ * The current zoom level before the change.
2200
+ */
2201
+ readonly zoomLevelBefore: number;
2202
+ /**
2203
+ * The target zoom level after the change. This value can be modified to customize the zoom operation.
2204
+ */
2205
+ zoomLevelAfter: number;
2206
+ }
2207
+
2208
+ /**
2209
+ * Represents the default zoom percentage values for the dropdown menu.
2210
+ *
2211
+ * @remarks
2212
+ * This array contains the standard zoom percentages available in the viewer's zoom dropdown.
2213
+ */
2214
+ export declare const zoomPercentageDropdownValues: readonly [25, 50, 75, 100, 150, 200, 300, 400, 500];
2215
+
2216
+ /**
2217
+ * Represents zoom controls for the viewer toolbar.
2218
+ */
2219
+ export declare class ZoomUI implements VisibilityElement {
2220
+ /** @inheritdoc */
2221
+ get isVisible(): boolean;
2222
+ /** @inheritdoc */
2223
+ set isVisible(value: boolean);
2224
+ }
2225
+
2226
+ /**
2227
+ * Represents options for configuring the zoom controls in the PDF viewer.
2228
+ *
2229
+ * @remarks
2230
+ * This interface provides control over whether the zoom controls are visible.
2231
+ * It provides a simple way to enable or disable the zoom functionality in the viewer.
2232
+ */
2233
+ export declare interface ZoomUIOptions extends VisibilityOption {
2234
+ }
2235
+