jit-viewer 1.0.1 → 1.0.4
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/iife/jit-viewer.min.css +1 -1
- package/dist/iife/jit-viewer.min.js +1 -125
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +69 -3
- package/dist/index.js +392 -95
- package/dist/style.css +1 -1
- package/package.json +12 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ visible: boolean;
|
|
|
17
17
|
|
|
18
18
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
19
|
|
|
20
|
+
declare type __VLS_NonUndefinedable_10<T> = T extends undefined ? never : T;
|
|
21
|
+
|
|
20
22
|
declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
|
|
21
23
|
|
|
22
24
|
declare type __VLS_NonUndefinedable_3<T> = T extends undefined ? never : T;
|
|
@@ -45,6 +47,10 @@ declare type __VLS_Prettify_3<T> = {
|
|
|
45
47
|
[K in keyof T]: T[K];
|
|
46
48
|
} & {};
|
|
47
49
|
|
|
50
|
+
declare type __VLS_Prettify_4<T> = {
|
|
51
|
+
[K in keyof T]: T[K];
|
|
52
|
+
} & {};
|
|
53
|
+
|
|
48
54
|
declare function __VLS_template(): {
|
|
49
55
|
"top-left"?(_: {}): any;
|
|
50
56
|
"top-center"?(_: {}): any;
|
|
@@ -63,6 +69,15 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
63
69
|
};
|
|
64
70
|
};
|
|
65
71
|
|
|
72
|
+
declare type __VLS_TypePropsToRuntimeProps_10<T> = {
|
|
73
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
74
|
+
type: PropType<__VLS_NonUndefinedable_10<T[K]>>;
|
|
75
|
+
} : {
|
|
76
|
+
type: PropType<T[K]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
66
81
|
declare type __VLS_TypePropsToRuntimeProps_2<T> = {
|
|
67
82
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
68
83
|
type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
|
|
@@ -153,6 +168,12 @@ declare type __VLS_WithDefaults_3<P, D> = {
|
|
|
153
168
|
}> : P[K];
|
|
154
169
|
};
|
|
155
170
|
|
|
171
|
+
declare type __VLS_WithDefaults_4<P, D> = {
|
|
172
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_4<P[K] & {
|
|
173
|
+
default: D[K];
|
|
174
|
+
}> : P[K];
|
|
175
|
+
};
|
|
176
|
+
|
|
156
177
|
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
157
178
|
new (): {
|
|
158
179
|
$slots: S;
|
|
@@ -462,19 +483,25 @@ export declare type FileSource = string | File | Blob | ArrayBuffer | {
|
|
|
462
483
|
/**
|
|
463
484
|
* 将文件源转换为ArrayBuffer
|
|
464
485
|
*/
|
|
465
|
-
export declare function fileToArrayBuffer(source: FileSource
|
|
486
|
+
export declare function fileToArrayBuffer(source: FileSource, options?: {
|
|
487
|
+
proxyUrl?: string;
|
|
488
|
+
requestAdapter?: RequestAdapter;
|
|
489
|
+
}): Promise<ArrayBuffer>;
|
|
466
490
|
|
|
467
491
|
/**
|
|
468
492
|
* 将文件源转换为Blob
|
|
469
493
|
*/
|
|
470
|
-
export declare function fileToBlob(source: FileSource
|
|
494
|
+
export declare function fileToBlob(source: FileSource, options?: {
|
|
495
|
+
proxyUrl?: string;
|
|
496
|
+
requestAdapter?: RequestAdapter;
|
|
497
|
+
}): Promise<Blob>;
|
|
471
498
|
|
|
472
499
|
/**
|
|
473
500
|
* 将文件源转换为URL
|
|
474
501
|
*/
|
|
475
502
|
export declare function fileToUrl(source: FileSource): Promise<string>;
|
|
476
503
|
|
|
477
|
-
export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'unknown';
|
|
504
|
+
export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'html' | 'unknown';
|
|
478
505
|
|
|
479
506
|
/**
|
|
480
507
|
* 全屏API封装
|
|
@@ -537,6 +564,20 @@ declare function gotoPage(page: number): {
|
|
|
537
564
|
total: number;
|
|
538
565
|
};
|
|
539
566
|
|
|
567
|
+
export declare const HtmlRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_10<Props_10>, {
|
|
568
|
+
zoom: number;
|
|
569
|
+
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
570
|
+
error: (error: Error) => void;
|
|
571
|
+
load: () => void;
|
|
572
|
+
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_4<__VLS_TypePropsToRuntimeProps_10<Props_10>, {
|
|
573
|
+
zoom: number;
|
|
574
|
+
}>>> & Readonly<{
|
|
575
|
+
onError?: ((error: Error) => any) | undefined;
|
|
576
|
+
onLoad?: (() => any) | undefined;
|
|
577
|
+
}>, {
|
|
578
|
+
zoom: number;
|
|
579
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
580
|
+
|
|
540
581
|
/**
|
|
541
582
|
* 检查文件类型是否支持
|
|
542
583
|
*/
|
|
@@ -653,6 +694,13 @@ export declare function printElement(element: HTMLElement, title?: string): void
|
|
|
653
694
|
declare interface Props extends ViewerOptions {
|
|
654
695
|
}
|
|
655
696
|
|
|
697
|
+
declare interface Props_10 {
|
|
698
|
+
source: FileSource;
|
|
699
|
+
zoom?: number;
|
|
700
|
+
proxyUrl?: string;
|
|
701
|
+
requestAdapter?: RequestAdapter;
|
|
702
|
+
}
|
|
703
|
+
|
|
656
704
|
declare interface Props_2 {
|
|
657
705
|
config?: ToolbarConfig;
|
|
658
706
|
visible?: boolean;
|
|
@@ -661,21 +709,29 @@ declare interface Props_2 {
|
|
|
661
709
|
declare interface Props_3 {
|
|
662
710
|
source: FileSource;
|
|
663
711
|
zoom?: number;
|
|
712
|
+
proxyUrl?: string;
|
|
713
|
+
requestAdapter?: RequestAdapter;
|
|
664
714
|
}
|
|
665
715
|
|
|
666
716
|
declare interface Props_4 {
|
|
667
717
|
source: FileSource;
|
|
668
718
|
zoom?: number;
|
|
719
|
+
proxyUrl?: string;
|
|
720
|
+
requestAdapter?: RequestAdapter;
|
|
669
721
|
}
|
|
670
722
|
|
|
671
723
|
declare interface Props_5 {
|
|
672
724
|
source: FileSource;
|
|
673
725
|
zoom?: number;
|
|
726
|
+
proxyUrl?: string;
|
|
727
|
+
requestAdapter?: RequestAdapter;
|
|
674
728
|
}
|
|
675
729
|
|
|
676
730
|
declare interface Props_6 {
|
|
677
731
|
source: FileSource;
|
|
678
732
|
zoom?: number;
|
|
733
|
+
proxyUrl?: string;
|
|
734
|
+
requestAdapter?: RequestAdapter;
|
|
679
735
|
}
|
|
680
736
|
|
|
681
737
|
declare interface Props_7 {
|
|
@@ -689,8 +745,16 @@ declare interface Props_8 {
|
|
|
689
745
|
declare interface Props_9 {
|
|
690
746
|
source: FileSource;
|
|
691
747
|
zoom?: number;
|
|
748
|
+
proxyUrl?: string;
|
|
749
|
+
requestAdapter?: RequestAdapter;
|
|
692
750
|
}
|
|
693
751
|
|
|
752
|
+
export declare type RequestAdapter = (url: string, options?: {
|
|
753
|
+
headers?: Record<string, string>;
|
|
754
|
+
method?: 'GET' | 'POST';
|
|
755
|
+
body?: BodyInit;
|
|
756
|
+
}) => Promise<ArrayBuffer>;
|
|
757
|
+
|
|
694
758
|
declare function setFileInternal(file: FileSource, filename?: string): Promise<void>;
|
|
695
759
|
|
|
696
760
|
export declare const TextRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<Props_7>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -1214,6 +1278,8 @@ export declare interface ViewerOptions {
|
|
|
1214
1278
|
height?: string | number;
|
|
1215
1279
|
className?: string;
|
|
1216
1280
|
style?: Record<string, string>;
|
|
1281
|
+
proxyUrl?: string;
|
|
1282
|
+
requestAdapter?: RequestAdapter;
|
|
1217
1283
|
onReady?: () => void;
|
|
1218
1284
|
onError?: (error: Error) => void;
|
|
1219
1285
|
onLoad?: () => void;
|