jit-viewer 1.0.9 → 1.1.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/index.d.ts CHANGED
@@ -15,10 +15,22 @@ visible: boolean;
15
15
  visible: boolean;
16
16
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
17
17
 
18
+ declare const __VLS_component_2: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_7<__VLS_TypePropsToRuntimeProps_12<Props_12>, {
19
+ watermark: null;
20
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_7<__VLS_TypePropsToRuntimeProps_12<Props_12>, {
21
+ watermark: null;
22
+ }>>> & Readonly<{}>, {
23
+ watermark: WatermarkConfig | null;
24
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
25
+
18
26
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
19
27
 
20
28
  declare type __VLS_NonUndefinedable_10<T> = T extends undefined ? never : T;
21
29
 
30
+ declare type __VLS_NonUndefinedable_11<T> = T extends undefined ? never : T;
31
+
32
+ declare type __VLS_NonUndefinedable_12<T> = T extends undefined ? never : T;
33
+
22
34
  declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
23
35
 
24
36
  declare type __VLS_NonUndefinedable_3<T> = T extends undefined ? never : T;
@@ -55,6 +67,14 @@ declare type __VLS_Prettify_5<T> = {
55
67
  [K in keyof T]: T[K];
56
68
  } & {};
57
69
 
70
+ declare type __VLS_Prettify_6<T> = {
71
+ [K in keyof T]: T[K];
72
+ } & {};
73
+
74
+ declare type __VLS_Prettify_7<T> = {
75
+ [K in keyof T]: T[K];
76
+ } & {};
77
+
58
78
  declare function __VLS_template(): {
59
79
  "top-left"?(_: {}): any;
60
80
  "top-center"?(_: {}): any;
@@ -64,6 +84,10 @@ declare function __VLS_template(): {
64
84
  "bottom-right"?(_: {}): any;
65
85
  };
66
86
 
87
+ declare function __VLS_template_2(): {
88
+ default?(_: {}): any;
89
+ };
90
+
67
91
  declare type __VLS_TypePropsToRuntimeProps<T> = {
68
92
  [K in keyof T]-?: {} extends Pick<T, K> ? {
69
93
  type: PropType<__VLS_NonUndefinedable<T[K]>>;
@@ -82,6 +106,24 @@ declare type __VLS_TypePropsToRuntimeProps_10<T> = {
82
106
  };
83
107
  };
84
108
 
109
+ declare type __VLS_TypePropsToRuntimeProps_11<T> = {
110
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
111
+ type: PropType<__VLS_NonUndefinedable_11<T[K]>>;
112
+ } : {
113
+ type: PropType<T[K]>;
114
+ required: true;
115
+ };
116
+ };
117
+
118
+ declare type __VLS_TypePropsToRuntimeProps_12<T> = {
119
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
120
+ type: PropType<__VLS_NonUndefinedable_12<T[K]>>;
121
+ } : {
122
+ type: PropType<T[K]>;
123
+ required: true;
124
+ };
125
+ };
126
+
85
127
  declare type __VLS_TypePropsToRuntimeProps_2<T> = {
86
128
  [K in keyof T]-?: {} extends Pick<T, K> ? {
87
129
  type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
@@ -184,12 +226,30 @@ declare type __VLS_WithDefaults_5<P, D> = {
184
226
  }> : P[K];
185
227
  };
186
228
 
229
+ declare type __VLS_WithDefaults_6<P, D> = {
230
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_6<P[K] & {
231
+ default: D[K];
232
+ }> : P[K];
233
+ };
234
+
235
+ declare type __VLS_WithDefaults_7<P, D> = {
236
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_7<P[K] & {
237
+ default: D[K];
238
+ }> : P[K];
239
+ };
240
+
187
241
  declare type __VLS_WithTemplateSlots<T, S> = T & {
188
242
  new (): {
189
243
  $slots: S;
190
244
  };
191
245
  };
192
246
 
247
+ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
248
+ new (): {
249
+ $slots: S;
250
+ };
251
+ };
252
+
193
253
  /**
194
254
  * 创建DOM元素
195
255
  */
@@ -511,7 +571,7 @@ export declare function fileToBlob(source: FileSource, options?: {
511
571
  */
512
572
  export declare function fileToUrl(source: FileSource): Promise<string>;
513
573
 
514
- export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'html' | 'unknown';
574
+ export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'html' | 'image' | 'unknown';
515
575
 
516
576
  /**
517
577
  * 全屏API封装
@@ -588,6 +648,20 @@ onLoad?: (() => any) | undefined;
588
648
  zoom: number;
589
649
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
590
650
 
651
+ export declare const ImageRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_6<__VLS_TypePropsToRuntimeProps_11<Props_11>, {
652
+ zoom: number;
653
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
654
+ error: (error: Error) => void;
655
+ load: () => void;
656
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_6<__VLS_TypePropsToRuntimeProps_11<Props_11>, {
657
+ zoom: number;
658
+ }>>> & Readonly<{
659
+ onError?: ((error: Error) => any) | undefined;
660
+ onLoad?: (() => any) | undefined;
661
+ }>, {
662
+ zoom: number;
663
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
664
+
591
665
  /**
592
666
  * 检查文件类型是否支持
593
667
  */
@@ -720,6 +794,15 @@ declare interface Props_10 {
720
794
  requestAdapter?: RequestAdapter;
721
795
  }
722
796
 
797
+ declare interface Props_11 {
798
+ source: FileSource;
799
+ zoom?: number;
800
+ }
801
+
802
+ declare interface Props_12 {
803
+ watermark?: WatermarkConfig | null;
804
+ }
805
+
723
806
  declare interface Props_2 {
724
807
  config?: ToolbarConfig;
725
808
  visible?: boolean;
@@ -1299,6 +1382,7 @@ export declare interface ViewerOptions {
1299
1382
  className?: string;
1300
1383
  style?: Record<string, string>;
1301
1384
  pdfRender?: 'native' | 'inset';
1385
+ watermark?: WatermarkConfig | null;
1302
1386
  proxyUrl?: string;
1303
1387
  requestAdapter?: RequestAdapter;
1304
1388
  onReady?: () => void;
@@ -1328,4 +1412,25 @@ export declare interface ViewerState {
1328
1412
  fullscreen: boolean;
1329
1413
  }
1330
1414
 
1415
+ export declare const Watermark: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, ReturnType<typeof __VLS_template_2>>;
1416
+
1417
+ export declare interface WatermarkConfig {
1418
+ type: 'text' | 'image';
1419
+ content?: string;
1420
+ image?: string;
1421
+ fontSize?: number;
1422
+ color?: string;
1423
+ fontFamily?: string;
1424
+ fontWeight?: string | number;
1425
+ imageWidth?: number;
1426
+ imageHeight?: number;
1427
+ opacity?: number;
1428
+ rotate?: number;
1429
+ gapX?: number;
1430
+ gapY?: number;
1431
+ position?: 'top' | 'bottom';
1432
+ width?: string | number;
1433
+ height?: string | number;
1434
+ }
1435
+
1331
1436
  export { }