annotation_layer.d.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. export type AnnotationElementParameters = {
  2. data: Object;
  3. layer: HTMLDivElement;
  4. page: any;
  5. viewport: any;
  6. linkService: any;
  7. downloadManager: any;
  8. annotationStorage?: AnnotationStorage | undefined;
  9. /**
  10. * - Path for image resources, mainly
  11. * for annotation icons. Include trailing slash.
  12. */
  13. imageResourcesPath?: string | undefined;
  14. renderInteractiveForms: boolean;
  15. svgFactory: Object;
  16. enableScripting?: boolean | undefined;
  17. hasJSActions?: boolean | undefined;
  18. mouseState?: Object | undefined;
  19. };
  20. export type AnnotationLayerParameters = {
  21. viewport: any;
  22. div: HTMLDivElement;
  23. annotations: any[];
  24. page: any;
  25. linkService: any;
  26. downloadManager: any;
  27. /**
  28. * - Path for image resources, mainly
  29. * for annotation icons. Include trailing slash.
  30. */
  31. imageResourcesPath?: string | undefined;
  32. renderInteractiveForms: boolean;
  33. /**
  34. * - Enable embedded script execution.
  35. */
  36. enableScripting?: boolean | undefined;
  37. /**
  38. * - Some fields have JS actions.
  39. * The default value is `false`.
  40. */
  41. hasJSActions?: boolean | undefined;
  42. };
  43. /**
  44. * @typedef {Object} AnnotationLayerParameters
  45. * @property {PageViewport} viewport
  46. * @property {HTMLDivElement} div
  47. * @property {Array} annotations
  48. * @property {PDFPage} page
  49. * @property {IPDFLinkService} linkService
  50. * @property {DownloadManager} downloadManager
  51. * @property {string} [imageResourcesPath] - Path for image resources, mainly
  52. * for annotation icons. Include trailing slash.
  53. * @property {boolean} renderInteractiveForms
  54. * @property {boolean} [enableScripting] - Enable embedded script execution.
  55. * @property {boolean} [hasJSActions] - Some fields have JS actions.
  56. * The default value is `false`.
  57. */
  58. export class AnnotationLayer {
  59. /**
  60. * Render a new annotation layer with all annotation elements.
  61. *
  62. * @public
  63. * @param {AnnotationLayerParameters} parameters
  64. * @memberof AnnotationLayer
  65. */
  66. public static render(parameters: AnnotationLayerParameters): void;
  67. /**
  68. * Update the annotation elements on existing annotation layer.
  69. *
  70. * @public
  71. * @param {AnnotationLayerParameters} parameters
  72. * @memberof AnnotationLayer
  73. */
  74. public static update(parameters: AnnotationLayerParameters): void;
  75. }
  76. import { AnnotationStorage } from "./annotation_storage.js";