@vue-pdf-viewer/shared 1.4.0 → 1.5.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types.d.ts +60 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -308,3 +308,63 @@ export interface DeletedAnnotationData {
|
|
|
308
308
|
export interface AnnotationPluginApi {
|
|
309
309
|
exportToPdf: (annotations: Annotation[], deletedAnnotations?: DeletedAnnotationData[] | string[]) => Promise<Uint8Array | null>;
|
|
310
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* Programmatic API for text selection annotation tools (highlight, underline, strikethrough).
|
|
313
|
+
* Exposed on the VPdfViewer instance as `textSelectionControl`.
|
|
314
|
+
* Undefined when the annotation plugin is not loaded.
|
|
315
|
+
*/
|
|
316
|
+
export interface AnnotationTextSelectionControl {
|
|
317
|
+
/** Whether the highlight tool is currently active */
|
|
318
|
+
readonly isHighlightActive: boolean;
|
|
319
|
+
/** Whether the underline tool is currently active */
|
|
320
|
+
readonly isUnderlineActive: boolean;
|
|
321
|
+
/** Whether the strikethrough tool is currently active */
|
|
322
|
+
readonly isStrikethroughActive: boolean;
|
|
323
|
+
/** Current highlight color as CSS hex string, or null if not set */
|
|
324
|
+
readonly highlightColor: string | null;
|
|
325
|
+
/** Current underline color as CSS hex string, or null if not set */
|
|
326
|
+
readonly underlineColor: string | null;
|
|
327
|
+
/** Current strikethrough color as CSS hex string, or null if not set */
|
|
328
|
+
readonly strikethroughColor: string | null;
|
|
329
|
+
/** Toggle highlight tool. Activating deactivates other text selection tools. */
|
|
330
|
+
toggleHighlight(): void;
|
|
331
|
+
/** Toggle underline tool. Activating deactivates other text selection tools. */
|
|
332
|
+
toggleUnderline(): void;
|
|
333
|
+
/** Toggle strikethrough tool. Activating deactivates other text selection tools. */
|
|
334
|
+
toggleStrikethrough(): void;
|
|
335
|
+
/** Deactivate all text selection tools. */
|
|
336
|
+
deactivateAll(): void;
|
|
337
|
+
/** Set highlight color. Takes effect on the next annotation created. */
|
|
338
|
+
setHighlightColor(color: string): void;
|
|
339
|
+
/** Set underline color. Takes effect on the next annotation created. */
|
|
340
|
+
setUnderlineColor(color: string): void;
|
|
341
|
+
/** Set strikethrough color. Takes effect on the next annotation created. */
|
|
342
|
+
setStrikethroughColor(color: string): void;
|
|
343
|
+
/** Set the highlight color palette shown in the popover. Accepts LabelValuePair[] or string[] (1–12 colors). */
|
|
344
|
+
setHighlightColorPalette(colors: AnnotationHighlightColors): void;
|
|
345
|
+
/** Set the underline color palette shown in the popover. Accepts LabelValuePair[] or string[] (1–12 colors). */
|
|
346
|
+
setUnderlineColorPalette(colors: AnnotationUnderlineColors): void;
|
|
347
|
+
/** Set the strikethrough color palette shown in the popover. Accepts LabelValuePair[] or string[] (1–12 colors). */
|
|
348
|
+
setStrikethroughColorPalette(colors: AnnotationStrikethroughColors): void;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Programmatic API for the free text annotation tool.
|
|
352
|
+
* Exposed on the VPdfViewer instance as `freeTextControl`.
|
|
353
|
+
* Undefined when the annotation plugin is not loaded.
|
|
354
|
+
*/
|
|
355
|
+
export interface AnnotationFreeTextControl {
|
|
356
|
+
/** Whether the free text annotation tool is currently active */
|
|
357
|
+
readonly isActive: boolean;
|
|
358
|
+
/** Current default font color for new free text annotations (CSS hex string, e.g. '#000000'), or null if not set */
|
|
359
|
+
readonly fontColor: string | null;
|
|
360
|
+
/** Current default font size for new free text annotations (in points), or null if not set */
|
|
361
|
+
readonly fontSize: number | null;
|
|
362
|
+
/** Activate the free text tool. Deactivates all text-selection annotation tools. */
|
|
363
|
+
activate(): void;
|
|
364
|
+
/** Deactivate the free text tool. No-op if already inactive. */
|
|
365
|
+
deactivate(): void;
|
|
366
|
+
/** Set the default font color for new annotations (CSS hex string). Takes effect on the next annotation created. */
|
|
367
|
+
setFontColor(color: string): void;
|
|
368
|
+
/** Set the default font size for new annotations (in points). Takes effect on the next annotation created. */
|
|
369
|
+
setFontSize(size: number): void;
|
|
370
|
+
}
|