generateWaterMarkV2.d.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import { IGetWaterMarkConfigV2Res } from "../../getWaterMarkConfigV2";
  2. /**
  3. * 水印页面规则是否生效,1 表示生效,0 表示不生效
  4. */
  5. export declare enum EnableEnum {
  6. DISABLE = 0,
  7. ENABLE = 1
  8. }
  9. export declare enum PageInfoEnum {
  10. IMSESSIONLIST = "imSessionList",
  11. DOCPREVIEW = "docPreview",
  12. H5PAGEOTHER = "h5PageOther",
  13. MEETINGDETAIL = "meetingDetail",
  14. H5PAGEBASIC = "h5PageBasic",
  15. SELECTIONCOMPONENT = "selectionComponent",
  16. CONTACTLIST = "contactList",
  17. CONTACTDETAIL = "contactDetail",
  18. CHAT = "chat",
  19. SECRETCHAT = "secretChat",
  20. CAMERA = "camera"
  21. }
  22. export interface IEffectPage {
  23. imSessionList: EnableEnum;
  24. docPreview: EnableEnum;
  25. h5PageOther: EnableEnum;
  26. meetingDetail: EnableEnum;
  27. h5PageBasic: EnableEnum;
  28. selectionComponent: EnableEnum;
  29. contactList: EnableEnum;
  30. contactDetail: EnableEnum;
  31. chat: EnableEnum;
  32. secretChat: EnableEnum;
  33. camera: EnableEnum;
  34. }
  35. export interface IWatermarkContent {
  36. customCopy: string;
  37. enablePhoneNumber: EnableEnum;
  38. enableUsername: EnableEnum;
  39. }
  40. /**
  41. * showDensity number 水印的密度
  42. * fontStyle number 水印的文本粗细
  43. * tiltAngle number 水印旋转角度
  44. * leftAndRightSpacing number 水印左右边距
  45. * transparency number 水印文本透明度
  46. * upAndDownSpacing number 水印上下边距
  47. * fontSize number 水印字体大小
  48. * fontColor number 水印字体颜色
  49. */
  50. export interface IWatermarkStyle {
  51. showDensity: number;
  52. fontStyle: number;
  53. tiltAngle: number;
  54. leftAndRightSpacing: number;
  55. transparency: number;
  56. upAndDownSpacing: number;
  57. fontSize: number;
  58. fontColor: string;
  59. }
  60. export interface IRuleContent {
  61. enable: EnableEnum;
  62. effectPage: IEffectPage;
  63. watermarkContent: IWatermarkContent;
  64. watermarkStyle: IWatermarkStyle;
  65. }
  66. export interface IWaterMark {
  67. ruleContent: IRuleContent;
  68. }
  69. export interface IUserInfo {
  70. userName: string;
  71. lastFourPhoneNo: string;
  72. }
  73. export interface IWaterMarkOptions {
  74. texts: string;
  75. width: number;
  76. height: number;
  77. tiltAngle: number;
  78. fontColor: string;
  79. textFont: string;
  80. transparency: number;
  81. canvas: HTMLCanvasElement[];
  82. fontSize: number;
  83. deg: number;
  84. tWidth: number;
  85. tHeight: number;
  86. fontStyle: fontStyleValuesType;
  87. }
  88. /**
  89. * normal 正常
  90. * bold 粗体
  91. * italic 斜体
  92. */
  93. declare const fontStyleMap: {
  94. 1: string;
  95. 2: string;
  96. 3: string;
  97. };
  98. /**
  99. * LOOSE 宽松
  100. * NORMAL 正常
  101. * DENSE 密集
  102. */
  103. declare enum ShowDensityEnum {
  104. LOOSE = 0,
  105. NORMAL = 1,
  106. DENSE = 2
  107. }
  108. export declare type fontStyleMapKeys = keyof typeof fontStyleMap;
  109. export declare type fontStyleValuesType = typeof fontStyleMap[fontStyleMapKeys];
  110. export declare type constructorOptions = Pick<IWaterMarkOptions, 'texts' | 'tiltAngle' | 'fontColor' | 'textFont' | 'fontStyle' | 'transparency' | 'fontSize'> & {
  111. showDensity: ShowDensityEnum;
  112. leftAndRightSpacing: number;
  113. upAndDownSpacing: number;
  114. };
  115. export declare enum HorizontalTypeEnum {
  116. RIGHT = 0,
  117. LEFT = 1
  118. }
  119. /**
  120. *
  121. * @param {*} conf 配置对象
  122. * @param {*} pageInfo 仅且在特定配置页面显示水印,默认值 h5PageOther
  123. */
  124. export default function generateWaterMarkV2(conf: IGetWaterMarkConfigV2Res, pageInfo?: PageInfoEnum): any;
  125. export {};