jit-viewer 1.1.4 → 1.2.0
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/CHANGELOG.md +17 -0
- package/README.md +79 -787
- package/README.zh-CN.md +98 -336
- package/dist/iife/jit-viewer.min.css +1 -1
- package/dist/iife/jit-viewer.min.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +105 -21
- package/dist/index.js +745 -118
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ visible: boolean;
|
|
|
15
15
|
visible: boolean;
|
|
16
16
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
17
17
|
|
|
18
|
-
declare const __VLS_component_2: DefineComponent<ExtractPropTypes<
|
|
18
|
+
declare const __VLS_component_2: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_9<__VLS_TypePropsToRuntimeProps_14<Props_14>, {
|
|
19
19
|
watermark: null;
|
|
20
|
-
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
20
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_9<__VLS_TypePropsToRuntimeProps_14<Props_14>, {
|
|
21
21
|
watermark: null;
|
|
22
22
|
}>>> & Readonly<{}>, {
|
|
23
23
|
watermark: WatermarkConfig | null;
|
|
@@ -31,6 +31,10 @@ declare type __VLS_NonUndefinedable_11<T> = T extends undefined ? never : T;
|
|
|
31
31
|
|
|
32
32
|
declare type __VLS_NonUndefinedable_12<T> = T extends undefined ? never : T;
|
|
33
33
|
|
|
34
|
+
declare type __VLS_NonUndefinedable_13<T> = T extends undefined ? never : T;
|
|
35
|
+
|
|
36
|
+
declare type __VLS_NonUndefinedable_14<T> = T extends undefined ? never : T;
|
|
37
|
+
|
|
34
38
|
declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
|
|
35
39
|
|
|
36
40
|
declare type __VLS_NonUndefinedable_3<T> = T extends undefined ? never : T;
|
|
@@ -75,6 +79,14 @@ declare type __VLS_Prettify_7<T> = {
|
|
|
75
79
|
[K in keyof T]: T[K];
|
|
76
80
|
} & {};
|
|
77
81
|
|
|
82
|
+
declare type __VLS_Prettify_8<T> = {
|
|
83
|
+
[K in keyof T]: T[K];
|
|
84
|
+
} & {};
|
|
85
|
+
|
|
86
|
+
declare type __VLS_Prettify_9<T> = {
|
|
87
|
+
[K in keyof T]: T[K];
|
|
88
|
+
} & {};
|
|
89
|
+
|
|
78
90
|
declare function __VLS_template(): {
|
|
79
91
|
"top-left"?(_: {}): any;
|
|
80
92
|
"top-center"?(_: {}): any;
|
|
@@ -124,6 +136,24 @@ declare type __VLS_TypePropsToRuntimeProps_12<T> = {
|
|
|
124
136
|
};
|
|
125
137
|
};
|
|
126
138
|
|
|
139
|
+
declare type __VLS_TypePropsToRuntimeProps_13<T> = {
|
|
140
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
141
|
+
type: PropType<__VLS_NonUndefinedable_13<T[K]>>;
|
|
142
|
+
} : {
|
|
143
|
+
type: PropType<T[K]>;
|
|
144
|
+
required: true;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
declare type __VLS_TypePropsToRuntimeProps_14<T> = {
|
|
149
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
150
|
+
type: PropType<__VLS_NonUndefinedable_14<T[K]>>;
|
|
151
|
+
} : {
|
|
152
|
+
type: PropType<T[K]>;
|
|
153
|
+
required: true;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
127
157
|
declare type __VLS_TypePropsToRuntimeProps_2<T> = {
|
|
128
158
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
129
159
|
type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
|
|
@@ -238,6 +268,18 @@ declare type __VLS_WithDefaults_7<P, D> = {
|
|
|
238
268
|
}> : P[K];
|
|
239
269
|
};
|
|
240
270
|
|
|
271
|
+
declare type __VLS_WithDefaults_8<P, D> = {
|
|
272
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_8<P[K] & {
|
|
273
|
+
default: D[K];
|
|
274
|
+
}> : P[K];
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
declare type __VLS_WithDefaults_9<P, D> = {
|
|
278
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_9<P[K] & {
|
|
279
|
+
default: D[K];
|
|
280
|
+
}> : P[K];
|
|
281
|
+
};
|
|
282
|
+
|
|
241
283
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
242
284
|
new (): {
|
|
243
285
|
$slots: S;
|
|
@@ -494,6 +536,20 @@ export declare function createViewerState(options?: {
|
|
|
494
536
|
setPrintFn: (fn: () => void) => void;
|
|
495
537
|
};
|
|
496
538
|
|
|
539
|
+
export declare const CsvRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_5<Props_5>, {
|
|
540
|
+
zoom: number;
|
|
541
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
542
|
+
error: (error: Error) => void;
|
|
543
|
+
load: () => void;
|
|
544
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_5<Props_5>, {
|
|
545
|
+
zoom: number;
|
|
546
|
+
}>>> & Readonly<{
|
|
547
|
+
onError?: ((error: Error) => any) | undefined;
|
|
548
|
+
onLoad?: (() => any) | undefined;
|
|
549
|
+
}>, {
|
|
550
|
+
zoom: number;
|
|
551
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
552
|
+
|
|
497
553
|
/**
|
|
498
554
|
* 防抖函数
|
|
499
555
|
*/
|
|
@@ -571,7 +627,7 @@ export declare function fileToBlob(source: FileSource, options?: {
|
|
|
571
627
|
*/
|
|
572
628
|
export declare function fileToUrl(source: FileSource): Promise<string>;
|
|
573
629
|
|
|
574
|
-
export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'html' | 'image' | 'unknown';
|
|
630
|
+
export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'csv' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'html' | 'image' | 'video' | 'unknown';
|
|
575
631
|
|
|
576
632
|
/**
|
|
577
633
|
* 全屏API封装
|
|
@@ -634,12 +690,12 @@ declare function gotoPage(page: number): {
|
|
|
634
690
|
total: number;
|
|
635
691
|
};
|
|
636
692
|
|
|
637
|
-
export declare const HtmlRender: DefineComponent<ExtractPropTypes<
|
|
693
|
+
export declare const HtmlRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_6<__VLS_TypePropsToRuntimeProps_11<Props_11>, {
|
|
638
694
|
zoom: number;
|
|
639
695
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
640
696
|
error: (error: Error) => void;
|
|
641
697
|
load: () => void;
|
|
642
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
698
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_6<__VLS_TypePropsToRuntimeProps_11<Props_11>, {
|
|
643
699
|
zoom: number;
|
|
644
700
|
}>>> & Readonly<{
|
|
645
701
|
onError?: ((error: Error) => any) | undefined;
|
|
@@ -648,12 +704,12 @@ onLoad?: (() => any) | undefined;
|
|
|
648
704
|
zoom: number;
|
|
649
705
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
650
706
|
|
|
651
|
-
export declare const ImageRender: DefineComponent<ExtractPropTypes<
|
|
707
|
+
export declare const ImageRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_7<__VLS_TypePropsToRuntimeProps_12<Props_12>, {
|
|
652
708
|
zoom: number;
|
|
653
709
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
654
710
|
error: (error: Error) => void;
|
|
655
711
|
load: () => void;
|
|
656
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
712
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_7<__VLS_TypePropsToRuntimeProps_12<Props_12>, {
|
|
657
713
|
zoom: number;
|
|
658
714
|
}>>> & Readonly<{
|
|
659
715
|
onError?: ((error: Error) => any) | undefined;
|
|
@@ -682,10 +738,10 @@ export declare interface LocaleConfig {
|
|
|
682
738
|
messages: Record<string, string>;
|
|
683
739
|
}
|
|
684
740
|
|
|
685
|
-
export declare const MarkdownRender: DefineComponent<ExtractPropTypes<
|
|
741
|
+
export declare const MarkdownRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_9<Props_9>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
686
742
|
error: (error: Error) => void;
|
|
687
743
|
load: () => void;
|
|
688
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
744
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_9<Props_9>>> & Readonly<{
|
|
689
745
|
onError?: ((error: Error) => any) | undefined;
|
|
690
746
|
onLoad?: (() => any) | undefined;
|
|
691
747
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -702,7 +758,7 @@ declare interface OfdPageInfo {
|
|
|
702
758
|
total: number;
|
|
703
759
|
}
|
|
704
760
|
|
|
705
|
-
export declare const OfdRender: DefineComponent<ExtractPropTypes<
|
|
761
|
+
export declare const OfdRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_5<__VLS_TypePropsToRuntimeProps_10<Props_10>, {
|
|
706
762
|
zoom: number;
|
|
707
763
|
}>>, {
|
|
708
764
|
getPageInfo: typeof getPageInfo;
|
|
@@ -714,7 +770,7 @@ reload: typeof loadFile;
|
|
|
714
770
|
error: (error: Error) => void;
|
|
715
771
|
load: () => void;
|
|
716
772
|
pageChange: (pageInfo: OfdPageInfo) => void;
|
|
717
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
773
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_5<__VLS_TypePropsToRuntimeProps_10<Props_10>, {
|
|
718
774
|
zoom: number;
|
|
719
775
|
}>>> & Readonly<{
|
|
720
776
|
onError?: ((error: Error) => any) | undefined;
|
|
@@ -736,13 +792,13 @@ declare type PageInfo = {
|
|
|
736
792
|
total: number;
|
|
737
793
|
};
|
|
738
794
|
|
|
739
|
-
export declare const PdfRender: DefineComponent<ExtractPropTypes<
|
|
795
|
+
export declare const PdfRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_6<Props_6>, {
|
|
740
796
|
zoom: number;
|
|
741
797
|
pdfRender: string;
|
|
742
798
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
743
799
|
error: (error: Error) => void;
|
|
744
800
|
load: () => void;
|
|
745
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
801
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_6<Props_6>, {
|
|
746
802
|
zoom: number;
|
|
747
803
|
pdfRender: string;
|
|
748
804
|
}>>> & Readonly<{
|
|
@@ -766,10 +822,10 @@ export declare interface PluginContext {
|
|
|
766
822
|
toolbar: ToolbarAPI;
|
|
767
823
|
}
|
|
768
824
|
|
|
769
|
-
export declare const PptxRender: DefineComponent<ExtractPropTypes<
|
|
825
|
+
export declare const PptxRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<Props_7>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
770
826
|
error: (error: Error) => void;
|
|
771
827
|
load: () => void;
|
|
772
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
828
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<Props_7>>> & Readonly<{
|
|
773
829
|
onError?: ((error: Error) => any) | undefined;
|
|
774
830
|
onLoad?: (() => any) | undefined;
|
|
775
831
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -797,9 +853,23 @@ declare interface Props_10 {
|
|
|
797
853
|
declare interface Props_11 {
|
|
798
854
|
source: FileSource;
|
|
799
855
|
zoom?: number;
|
|
856
|
+
proxyUrl?: string;
|
|
857
|
+
requestAdapter?: RequestAdapter;
|
|
800
858
|
}
|
|
801
859
|
|
|
802
860
|
declare interface Props_12 {
|
|
861
|
+
source: FileSource;
|
|
862
|
+
zoom?: number;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
declare interface Props_13 {
|
|
866
|
+
source: FileSource;
|
|
867
|
+
zoom?: number;
|
|
868
|
+
proxyUrl?: string;
|
|
869
|
+
requestAdapter?: RequestAdapter;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
declare interface Props_14 {
|
|
803
873
|
watermark?: WatermarkConfig | null;
|
|
804
874
|
}
|
|
805
875
|
|
|
@@ -827,7 +897,6 @@ declare interface Props_5 {
|
|
|
827
897
|
zoom?: number;
|
|
828
898
|
proxyUrl?: string;
|
|
829
899
|
requestAdapter?: RequestAdapter;
|
|
830
|
-
pdfRender?: 'native' | 'inset';
|
|
831
900
|
}
|
|
832
901
|
|
|
833
902
|
declare interface Props_6 {
|
|
@@ -835,10 +904,14 @@ declare interface Props_6 {
|
|
|
835
904
|
zoom?: number;
|
|
836
905
|
proxyUrl?: string;
|
|
837
906
|
requestAdapter?: RequestAdapter;
|
|
907
|
+
pdfRender?: 'native' | 'inset';
|
|
838
908
|
}
|
|
839
909
|
|
|
840
910
|
declare interface Props_7 {
|
|
841
911
|
source: FileSource;
|
|
912
|
+
zoom?: number;
|
|
913
|
+
proxyUrl?: string;
|
|
914
|
+
requestAdapter?: RequestAdapter;
|
|
842
915
|
}
|
|
843
916
|
|
|
844
917
|
declare interface Props_8 {
|
|
@@ -847,9 +920,6 @@ declare interface Props_8 {
|
|
|
847
920
|
|
|
848
921
|
declare interface Props_9 {
|
|
849
922
|
source: FileSource;
|
|
850
|
-
zoom?: number;
|
|
851
|
-
proxyUrl?: string;
|
|
852
|
-
requestAdapter?: RequestAdapter;
|
|
853
923
|
}
|
|
854
924
|
|
|
855
925
|
export declare type RequestAdapter = (url: string, options?: {
|
|
@@ -860,10 +930,10 @@ export declare type RequestAdapter = (url: string, options?: {
|
|
|
860
930
|
|
|
861
931
|
declare function setFileInternal(file: FileSource, filename?: string, type?: Props['type']): Promise<void>;
|
|
862
932
|
|
|
863
|
-
export declare const TextRender: DefineComponent<ExtractPropTypes<
|
|
933
|
+
export declare const TextRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_8<Props_8>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
864
934
|
error: (error: Error) => void;
|
|
865
935
|
load: () => void;
|
|
866
|
-
}, string, PublicProps, Readonly<ExtractPropTypes<
|
|
936
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_8<Props_8>>> & Readonly<{
|
|
867
937
|
onError?: ((error: Error) => any) | undefined;
|
|
868
938
|
onLoad?: (() => any) | undefined;
|
|
869
939
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -1184,6 +1254,20 @@ export declare function useViewerState(): {
|
|
|
1184
1254
|
setPrintFn: (fn: () => void) => void;
|
|
1185
1255
|
};
|
|
1186
1256
|
|
|
1257
|
+
export declare const VideoRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_8<__VLS_TypePropsToRuntimeProps_13<Props_13>, {
|
|
1258
|
+
zoom: number;
|
|
1259
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1260
|
+
error: (error: Error) => void;
|
|
1261
|
+
load: () => void;
|
|
1262
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_8<__VLS_TypePropsToRuntimeProps_13<Props_13>, {
|
|
1263
|
+
zoom: number;
|
|
1264
|
+
}>>> & Readonly<{
|
|
1265
|
+
onError?: ((error: Error) => any) | undefined;
|
|
1266
|
+
onLoad?: (() => any) | undefined;
|
|
1267
|
+
}>, {
|
|
1268
|
+
zoom: number;
|
|
1269
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
1270
|
+
|
|
1187
1271
|
export declare const Viewer: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
1188
1272
|
toolbar: boolean;
|
|
1189
1273
|
theme: string;
|