jit-viewer 1.0.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.
@@ -0,0 +1,1244 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { ComputedRef } from 'vue';
4
+ import { DefineComponent } from 'vue';
5
+ import { ExtractPropTypes } from 'vue';
6
+ import { PropType } from 'vue';
7
+ import { PublicProps } from 'vue';
8
+ import { Ref } from 'vue';
9
+
10
+ declare const __VLS_component: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<Props_2>, {
11
+ visible: boolean;
12
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<Props_2>, {
13
+ visible: boolean;
14
+ }>>> & Readonly<{}>, {
15
+ visible: boolean;
16
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
17
+
18
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
19
+
20
+ declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
21
+
22
+ declare type __VLS_NonUndefinedable_3<T> = T extends undefined ? never : T;
23
+
24
+ declare type __VLS_NonUndefinedable_4<T> = T extends undefined ? never : T;
25
+
26
+ declare type __VLS_NonUndefinedable_5<T> = T extends undefined ? never : T;
27
+
28
+ declare type __VLS_NonUndefinedable_6<T> = T extends undefined ? never : T;
29
+
30
+ declare type __VLS_NonUndefinedable_7<T> = T extends undefined ? never : T;
31
+
32
+ declare type __VLS_NonUndefinedable_8<T> = T extends undefined ? never : T;
33
+
34
+ declare type __VLS_NonUndefinedable_9<T> = T extends undefined ? never : T;
35
+
36
+ declare type __VLS_Prettify<T> = {
37
+ [K in keyof T]: T[K];
38
+ } & {};
39
+
40
+ declare type __VLS_Prettify_2<T> = {
41
+ [K in keyof T]: T[K];
42
+ } & {};
43
+
44
+ declare type __VLS_Prettify_3<T> = {
45
+ [K in keyof T]: T[K];
46
+ } & {};
47
+
48
+ declare function __VLS_template(): {
49
+ "top-left"?(_: {}): any;
50
+ "top-center"?(_: {}): any;
51
+ "top-right"?(_: {}): any;
52
+ "bottom-left"?(_: {}): any;
53
+ "bottom-center"?(_: {}): any;
54
+ "bottom-right"?(_: {}): any;
55
+ };
56
+
57
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
58
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
59
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
60
+ } : {
61
+ type: PropType<T[K]>;
62
+ required: true;
63
+ };
64
+ };
65
+
66
+ declare type __VLS_TypePropsToRuntimeProps_2<T> = {
67
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
68
+ type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
69
+ } : {
70
+ type: PropType<T[K]>;
71
+ required: true;
72
+ };
73
+ };
74
+
75
+ declare type __VLS_TypePropsToRuntimeProps_3<T> = {
76
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
77
+ type: PropType<__VLS_NonUndefinedable_3<T[K]>>;
78
+ } : {
79
+ type: PropType<T[K]>;
80
+ required: true;
81
+ };
82
+ };
83
+
84
+ declare type __VLS_TypePropsToRuntimeProps_4<T> = {
85
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
86
+ type: PropType<__VLS_NonUndefinedable_4<T[K]>>;
87
+ } : {
88
+ type: PropType<T[K]>;
89
+ required: true;
90
+ };
91
+ };
92
+
93
+ declare type __VLS_TypePropsToRuntimeProps_5<T> = {
94
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
95
+ type: PropType<__VLS_NonUndefinedable_5<T[K]>>;
96
+ } : {
97
+ type: PropType<T[K]>;
98
+ required: true;
99
+ };
100
+ };
101
+
102
+ declare type __VLS_TypePropsToRuntimeProps_6<T> = {
103
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
104
+ type: PropType<__VLS_NonUndefinedable_6<T[K]>>;
105
+ } : {
106
+ type: PropType<T[K]>;
107
+ required: true;
108
+ };
109
+ };
110
+
111
+ declare type __VLS_TypePropsToRuntimeProps_7<T> = {
112
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
113
+ type: PropType<__VLS_NonUndefinedable_7<T[K]>>;
114
+ } : {
115
+ type: PropType<T[K]>;
116
+ required: true;
117
+ };
118
+ };
119
+
120
+ declare type __VLS_TypePropsToRuntimeProps_8<T> = {
121
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
122
+ type: PropType<__VLS_NonUndefinedable_8<T[K]>>;
123
+ } : {
124
+ type: PropType<T[K]>;
125
+ required: true;
126
+ };
127
+ };
128
+
129
+ declare type __VLS_TypePropsToRuntimeProps_9<T> = {
130
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
131
+ type: PropType<__VLS_NonUndefinedable_9<T[K]>>;
132
+ } : {
133
+ type: PropType<T[K]>;
134
+ required: true;
135
+ };
136
+ };
137
+
138
+ declare type __VLS_WithDefaults<P, D> = {
139
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
140
+ default: D[K];
141
+ }> : P[K];
142
+ };
143
+
144
+ declare type __VLS_WithDefaults_2<P, D> = {
145
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_2<P[K] & {
146
+ default: D[K];
147
+ }> : P[K];
148
+ };
149
+
150
+ declare type __VLS_WithDefaults_3<P, D> = {
151
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify_3<P[K] & {
152
+ default: D[K];
153
+ }> : P[K];
154
+ };
155
+
156
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
157
+ new (): {
158
+ $slots: S;
159
+ };
160
+ };
161
+
162
+ /**
163
+ * 创建DOM元素
164
+ */
165
+ export declare function createElement(tag: string, className?: string, attrs?: Record<string, string>): HTMLElement;
166
+
167
+ /**
168
+ * 创建事件总线
169
+ */
170
+ export declare function createEventBus(): EventBus;
171
+
172
+ /**
173
+ * 创建预览器实例
174
+ */
175
+ export declare function createViewer(options: ViewerOptions): ViewerInstance;
176
+
177
+ /**
178
+ * 创建预览器状态
179
+ */
180
+ export declare function createViewerState(options?: {
181
+ initialZoom?: number;
182
+ initialRotate?: number;
183
+ }): {
184
+ mounted: Ref<boolean, boolean>;
185
+ loading: Ref<boolean, boolean>;
186
+ error: Ref<Error | null, Error | null>;
187
+ fileType: Ref<FileType, FileType>;
188
+ filename: Ref<string, string>;
189
+ fileSource: Ref<string | {
190
+ readonly lastModified: number;
191
+ readonly name: string;
192
+ readonly webkitRelativePath: string;
193
+ readonly size: number;
194
+ readonly type: string;
195
+ arrayBuffer: () => Promise<ArrayBuffer>;
196
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
197
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
198
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
199
+ text: () => Promise<string>;
200
+ } | {
201
+ readonly size: number;
202
+ readonly type: string;
203
+ arrayBuffer: () => Promise<ArrayBuffer>;
204
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
205
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
206
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
207
+ text: () => Promise<string>;
208
+ } | {
209
+ readonly byteLength: number;
210
+ slice: (begin?: number, end?: number) => ArrayBuffer;
211
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
212
+ } | {
213
+ url: string;
214
+ headers?: Record<string, string> | undefined;
215
+ method?: "GET" | "POST" | undefined;
216
+ body?: string | {
217
+ readonly size: number;
218
+ readonly type: string;
219
+ arrayBuffer: () => Promise<ArrayBuffer>;
220
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
221
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
222
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
223
+ text: () => Promise<string>;
224
+ } | {
225
+ readonly byteLength: number;
226
+ slice: (begin?: number, end?: number) => ArrayBuffer;
227
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
228
+ } | {
229
+ readonly locked: boolean;
230
+ cancel: (reason?: any) => Promise<void>;
231
+ getReader: {
232
+ (options: {
233
+ mode: "byob";
234
+ }): ReadableStreamBYOBReader;
235
+ (): ReadableStreamDefaultReader<any>;
236
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<any>;
237
+ };
238
+ pipeThrough: <T>(transform: ReadableWritablePair<T, any>, options?: StreamPipeOptions) => ReadableStream<T>;
239
+ pipeTo: (destination: WritableStream<any>, options?: StreamPipeOptions) => Promise<void>;
240
+ tee: () => [ReadableStream<any>, ReadableStream<any>];
241
+ } | {
242
+ readonly buffer: {
243
+ readonly byteLength: number;
244
+ slice: (begin?: number, end?: number) => ArrayBuffer;
245
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
246
+ };
247
+ readonly byteLength: number;
248
+ readonly byteOffset: number;
249
+ } | {
250
+ append: {
251
+ (name: string, value: string | Blob): void;
252
+ (name: string, value: string): void;
253
+ (name: string, blobValue: Blob, filename?: string): void;
254
+ };
255
+ delete: (name: string) => void;
256
+ get: (name: string) => FormDataEntryValue | null;
257
+ getAll: (name: string) => FormDataEntryValue[];
258
+ has: (name: string) => boolean;
259
+ set: {
260
+ (name: string, value: string | Blob): void;
261
+ (name: string, value: string): void;
262
+ (name: string, blobValue: Blob, filename?: string): void;
263
+ };
264
+ forEach: (callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any) => void;
265
+ entries: () => FormDataIterator<[string, FormDataEntryValue]>;
266
+ keys: () => FormDataIterator<string>;
267
+ values: () => FormDataIterator<FormDataEntryValue>;
268
+ [Symbol.iterator]: () => FormDataIterator<[string, FormDataEntryValue]>;
269
+ } | {
270
+ readonly size: number;
271
+ append: (name: string, value: string) => void;
272
+ delete: (name: string, value?: string) => void;
273
+ get: (name: string) => string | null;
274
+ getAll: (name: string) => string[];
275
+ has: (name: string, value?: string) => boolean;
276
+ set: (name: string, value: string) => void;
277
+ sort: () => void;
278
+ toString: () => string;
279
+ forEach: (callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
280
+ entries: () => URLSearchParamsIterator<[string, string]>;
281
+ keys: () => URLSearchParamsIterator<string>;
282
+ values: () => URLSearchParamsIterator<string>;
283
+ [Symbol.iterator]: () => URLSearchParamsIterator<[string, string]>;
284
+ } | undefined;
285
+ } | null, FileSource | {
286
+ readonly lastModified: number;
287
+ readonly name: string;
288
+ readonly webkitRelativePath: string;
289
+ readonly size: number;
290
+ readonly type: string;
291
+ arrayBuffer: () => Promise<ArrayBuffer>;
292
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
293
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
294
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
295
+ text: () => Promise<string>;
296
+ } | {
297
+ readonly size: number;
298
+ readonly type: string;
299
+ arrayBuffer: () => Promise<ArrayBuffer>;
300
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
301
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
302
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
303
+ text: () => Promise<string>;
304
+ } | {
305
+ readonly byteLength: number;
306
+ slice: (begin?: number, end?: number) => ArrayBuffer;
307
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
308
+ } | {
309
+ url: string;
310
+ headers?: Record<string, string> | undefined;
311
+ method?: "GET" | "POST" | undefined;
312
+ body?: string | {
313
+ readonly size: number;
314
+ readonly type: string;
315
+ arrayBuffer: () => Promise<ArrayBuffer>;
316
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
317
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
318
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
319
+ text: () => Promise<string>;
320
+ } | {
321
+ readonly byteLength: number;
322
+ slice: (begin?: number, end?: number) => ArrayBuffer;
323
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
324
+ } | {
325
+ readonly locked: boolean;
326
+ cancel: (reason?: any) => Promise<void>;
327
+ getReader: {
328
+ (options: {
329
+ mode: "byob";
330
+ }): ReadableStreamBYOBReader;
331
+ (): ReadableStreamDefaultReader<any>;
332
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<any>;
333
+ };
334
+ pipeThrough: <T>(transform: ReadableWritablePair<T, any>, options?: StreamPipeOptions) => ReadableStream<T>;
335
+ pipeTo: (destination: WritableStream<any>, options?: StreamPipeOptions) => Promise<void>;
336
+ tee: () => [ReadableStream<any>, ReadableStream<any>];
337
+ } | {
338
+ readonly buffer: {
339
+ readonly byteLength: number;
340
+ slice: (begin?: number, end?: number) => ArrayBuffer;
341
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
342
+ };
343
+ readonly byteLength: number;
344
+ readonly byteOffset: number;
345
+ } | {
346
+ append: {
347
+ (name: string, value: string | Blob): void;
348
+ (name: string, value: string): void;
349
+ (name: string, blobValue: Blob, filename?: string): void;
350
+ };
351
+ delete: (name: string) => void;
352
+ get: (name: string) => FormDataEntryValue | null;
353
+ getAll: (name: string) => FormDataEntryValue[];
354
+ has: (name: string) => boolean;
355
+ set: {
356
+ (name: string, value: string | Blob): void;
357
+ (name: string, value: string): void;
358
+ (name: string, blobValue: Blob, filename?: string): void;
359
+ };
360
+ forEach: (callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any) => void;
361
+ entries: () => FormDataIterator<[string, FormDataEntryValue]>;
362
+ keys: () => FormDataIterator<string>;
363
+ values: () => FormDataIterator<FormDataEntryValue>;
364
+ [Symbol.iterator]: () => FormDataIterator<[string, FormDataEntryValue]>;
365
+ } | {
366
+ readonly size: number;
367
+ append: (name: string, value: string) => void;
368
+ delete: (name: string, value?: string) => void;
369
+ get: (name: string) => string | null;
370
+ getAll: (name: string) => string[];
371
+ has: (name: string, value?: string) => boolean;
372
+ set: (name: string, value: string) => void;
373
+ sort: () => void;
374
+ toString: () => string;
375
+ forEach: (callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
376
+ entries: () => URLSearchParamsIterator<[string, string]>;
377
+ keys: () => URLSearchParamsIterator<string>;
378
+ values: () => URLSearchParamsIterator<string>;
379
+ [Symbol.iterator]: () => URLSearchParamsIterator<[string, string]>;
380
+ } | undefined;
381
+ } | null>;
382
+ zoom: Ref<number, number>;
383
+ rotate: Ref<number, number>;
384
+ currentPage: Ref<number, number>;
385
+ totalPages: Ref<number, number>;
386
+ fullscreen: Ref<boolean, boolean>;
387
+ state: ComputedRef<ViewerState>;
388
+ setMounted: (value: boolean) => void;
389
+ setLoading: (value: boolean) => void;
390
+ setError: (err: Error | null) => void;
391
+ setFile: (source: FileSource, name?: string) => void;
392
+ clearFile: () => void;
393
+ setZoom: (value: number) => void;
394
+ setRotate: (value: number) => void;
395
+ resetTransform: () => void;
396
+ setPage: (current: number, total?: number) => void;
397
+ gotoPage: (page: number) => void;
398
+ prevPage: () => void;
399
+ nextPage: () => void;
400
+ setPageController: (controller: PageController | null) => void;
401
+ setFullscreen: (value: boolean) => void;
402
+ print: () => void;
403
+ setPrintFn: (fn: () => void) => void;
404
+ };
405
+
406
+ /**
407
+ * 防抖函数
408
+ */
409
+ export declare function debounce<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
410
+
411
+ declare function destroy(): void;
412
+
413
+ /**
414
+ * 检测文件类型
415
+ */
416
+ export declare function detectFileType(source: FileSource, filename?: string): FileType;
417
+
418
+ export declare const DocxRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_3<Props_3>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
419
+ error: (error: Error) => void;
420
+ load: () => void;
421
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_3<Props_3>>> & Readonly<{
422
+ onError?: ((error: Error) => any) | undefined;
423
+ onLoad?: (() => any) | undefined;
424
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
425
+
426
+ /**
427
+ * 下载文件
428
+ */
429
+ export declare function downloadFile(source: FileSource, filename?: string): Promise<void>;
430
+
431
+ export declare interface EventBus {
432
+ on: (event: string, handler: EventHandler) => void;
433
+ off: (event: string, handler: EventHandler) => void;
434
+ emit: (event: string, ...args: any[]) => void;
435
+ once: (event: string, handler: EventHandler) => void;
436
+ }
437
+
438
+ export declare type EventHandler = (...args: any[]) => void;
439
+
440
+ export declare const ExcelRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_4<Props_4>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
441
+ error: (error: Error) => void;
442
+ load: () => void;
443
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_4<Props_4>>> & Readonly<{
444
+ onError?: ((error: Error) => any) | undefined;
445
+ onLoad?: (() => any) | undefined;
446
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
447
+
448
+ export declare interface FileRenderer {
449
+ type: FileType;
450
+ canRender: (file: FileSource) => boolean;
451
+ render: (container: HTMLElement, file: FileSource, options?: any) => Promise<void>;
452
+ destroy?: () => void;
453
+ }
454
+
455
+ export declare type FileSource = string | File | Blob | ArrayBuffer | {
456
+ url: string;
457
+ headers?: Record<string, string>;
458
+ method?: 'GET' | 'POST';
459
+ body?: BodyInit;
460
+ };
461
+
462
+ /**
463
+ * 将文件源转换为ArrayBuffer
464
+ */
465
+ export declare function fileToArrayBuffer(source: FileSource): Promise<ArrayBuffer>;
466
+
467
+ /**
468
+ * 将文件源转换为Blob
469
+ */
470
+ export declare function fileToBlob(source: FileSource): Promise<Blob>;
471
+
472
+ /**
473
+ * 将文件源转换为URL
474
+ */
475
+ export declare function fileToUrl(source: FileSource): Promise<string>;
476
+
477
+ export declare type FileType = 'docx' | 'xlsx' | 'xls' | 'pdf' | 'pptx' | 'ppt' | 'txt' | 'md' | 'markdown' | 'ofd' | 'unknown';
478
+
479
+ /**
480
+ * 全屏API封装
481
+ */
482
+ export declare const fullscreen: {
483
+ /**
484
+ * 进入全屏
485
+ */
486
+ enter(element: HTMLElement): Promise<void>;
487
+ /**
488
+ * 退出全屏
489
+ */
490
+ exit(): Promise<void>;
491
+ /**
492
+ * 切换全屏
493
+ */
494
+ toggle(element: HTMLElement): Promise<void>;
495
+ /**
496
+ * 是否处于全屏状态
497
+ */
498
+ isActive(): boolean;
499
+ /**
500
+ * 监听全屏变化
501
+ */
502
+ onChange(callback: (isFullscreen: boolean) => void): () => void;
503
+ };
504
+
505
+ /**
506
+ * 生成CSS变量字符串
507
+ */
508
+ export declare function generateCSSVariables(variables: Record<string, string>): string;
509
+
510
+ /**
511
+ * 获取DOM元素
512
+ */
513
+ export declare function getElement(target: HTMLElement | string): HTMLElement | null;
514
+
515
+ /**
516
+ * 从文件名中提取扩展名
517
+ */
518
+ export declare function getFileExtension(filename: string): string;
519
+
520
+ /**
521
+ * 获取文件名
522
+ */
523
+ export declare function getFilename(source: FileSource, fallback?: string): string;
524
+
525
+ /**
526
+ * 从URL中提取文件名
527
+ */
528
+ export declare function getFilenameFromUrl(url: string): string;
529
+
530
+ declare function getPageInfo(): {
531
+ current: number;
532
+ total: number;
533
+ };
534
+
535
+ declare function gotoPage(page: number): {
536
+ current: number;
537
+ total: number;
538
+ };
539
+
540
+ /**
541
+ * 检查文件类型是否支持
542
+ */
543
+ export declare function isSupportedType(type: FileType): boolean;
544
+
545
+ declare const JitViewer: {
546
+ createViewer: typeof createViewer;
547
+ Viewer: typeof Viewer;
548
+ };
549
+ export default JitViewer;
550
+
551
+ declare function loadFile(): Promise<void>;
552
+
553
+ export declare type Locale = 'zh-CN' | 'en' | LocaleConfig;
554
+
555
+ export declare interface LocaleConfig {
556
+ name: string;
557
+ messages: Record<string, string>;
558
+ }
559
+
560
+ export declare const MarkdownRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_8<Props_8>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
561
+ error: (error: Error) => void;
562
+ load: () => void;
563
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_8<Props_8>>> & Readonly<{
564
+ onError?: ((error: Error) => any) | undefined;
565
+ onLoad?: (() => any) | undefined;
566
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
567
+
568
+ declare function mount(target?: HTMLElement | string): Promise<void>;
569
+
570
+ declare function nextPage(): {
571
+ current: number;
572
+ total: number;
573
+ };
574
+
575
+ declare interface OfdPageInfo {
576
+ current: number;
577
+ total: number;
578
+ }
579
+
580
+ export declare const OfdRender: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_9<Props_9>, {
581
+ zoom: number;
582
+ }>>, {
583
+ getPageInfo: typeof getPageInfo;
584
+ gotoPage: typeof gotoPage;
585
+ nextPage: typeof nextPage;
586
+ prevPage: typeof prevPage;
587
+ reload: typeof loadFile;
588
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
589
+ error: (error: Error) => void;
590
+ load: () => void;
591
+ pageChange: (pageInfo: OfdPageInfo) => void;
592
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_9<Props_9>, {
593
+ zoom: number;
594
+ }>>> & Readonly<{
595
+ onError?: ((error: Error) => any) | undefined;
596
+ onLoad?: (() => any) | undefined;
597
+ onPageChange?: ((pageInfo: OfdPageInfo) => any) | undefined;
598
+ }>, {
599
+ zoom: number;
600
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
601
+
602
+ declare type PageController = {
603
+ getPageInfo?: () => PageInfo | null | undefined;
604
+ gotoPage?: (page: number) => void | number | PageInfo;
605
+ nextPage?: () => void | number | PageInfo;
606
+ prevPage?: () => void | number | PageInfo;
607
+ };
608
+
609
+ declare type PageInfo = {
610
+ current: number;
611
+ total: number;
612
+ };
613
+
614
+ export declare const PdfRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_5<Props_5>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
615
+ error: (error: Error) => void;
616
+ load: () => void;
617
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_5<Props_5>>> & Readonly<{
618
+ onError?: ((error: Error) => any) | undefined;
619
+ onLoad?: (() => any) | undefined;
620
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
621
+
622
+ declare interface Plugin_2 {
623
+ name: string;
624
+ install: (ctx: PluginContext) => void;
625
+ }
626
+ export { Plugin_2 as Plugin }
627
+
628
+ export declare interface PluginContext {
629
+ viewer: ViewerInstance;
630
+ options: ViewerOptions;
631
+ events: EventBus;
632
+ toolbar: ToolbarAPI;
633
+ }
634
+
635
+ export declare const PptxRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_6<Props_6>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
636
+ error: (error: Error) => void;
637
+ load: () => void;
638
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_6<Props_6>>> & Readonly<{
639
+ onError?: ((error: Error) => any) | undefined;
640
+ onLoad?: (() => any) | undefined;
641
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
642
+
643
+ declare function prevPage(): {
644
+ current: number;
645
+ total: number;
646
+ };
647
+
648
+ /**
649
+ * 打印指定元素
650
+ */
651
+ export declare function printElement(element: HTMLElement, title?: string): void;
652
+
653
+ declare interface Props extends ViewerOptions {
654
+ }
655
+
656
+ declare interface Props_2 {
657
+ config?: ToolbarConfig;
658
+ visible?: boolean;
659
+ }
660
+
661
+ declare interface Props_3 {
662
+ source: FileSource;
663
+ zoom?: number;
664
+ }
665
+
666
+ declare interface Props_4 {
667
+ source: FileSource;
668
+ zoom?: number;
669
+ }
670
+
671
+ declare interface Props_5 {
672
+ source: FileSource;
673
+ zoom?: number;
674
+ }
675
+
676
+ declare interface Props_6 {
677
+ source: FileSource;
678
+ zoom?: number;
679
+ }
680
+
681
+ declare interface Props_7 {
682
+ source: FileSource;
683
+ }
684
+
685
+ declare interface Props_8 {
686
+ source: FileSource;
687
+ }
688
+
689
+ declare interface Props_9 {
690
+ source: FileSource;
691
+ zoom?: number;
692
+ }
693
+
694
+ declare function setFileInternal(file: FileSource, filename?: string): Promise<void>;
695
+
696
+ export declare const TextRender: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<Props_7>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
697
+ error: (error: Error) => void;
698
+ load: () => void;
699
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_7<Props_7>>> & Readonly<{
700
+ onError?: ((error: Error) => any) | undefined;
701
+ onLoad?: (() => any) | undefined;
702
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
703
+
704
+ export declare type Theme = 'light' | 'dark' | ThemeConfig;
705
+
706
+ export declare interface ThemeConfig {
707
+ name: string;
708
+ variables: Record<string, string>;
709
+ }
710
+
711
+ /**
712
+ * 节流函数
713
+ */
714
+ export declare function throttle<T extends (...args: any[]) => void>(fn: T, limit: number): (...args: Parameters<T>) => void;
715
+
716
+ export declare const Toolbar: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
717
+
718
+ export declare interface ToolbarAPI {
719
+ register: (item: ToolbarItem) => void;
720
+ unregister: (type: string) => void;
721
+ update: (type: string, config: Partial<ToolbarItem>) => void;
722
+ getItems: () => ToolbarItem[];
723
+ setVisible: (visible: boolean) => void;
724
+ }
725
+
726
+ export declare interface ToolbarConfig {
727
+ visible?: boolean;
728
+ items?: ToolbarItem[];
729
+ className?: string;
730
+ position?: 'top' | 'bottom' | 'both';
731
+ }
732
+
733
+ export declare interface ToolbarItem {
734
+ type: string;
735
+ position?: 'top' | 'bottom' | 'left' | 'right';
736
+ visible?: boolean;
737
+ disabled?: boolean;
738
+ icon?: string;
739
+ title?: string;
740
+ className?: string;
741
+ render?: () => any;
742
+ }
743
+
744
+ /**
745
+ * 使用国际化
746
+ */
747
+ export declare function useLocale(): {
748
+ locale: Ref<Locale>;
749
+ messages: Ref<Record<string, string>>;
750
+ t: (key: string, params?: Record<string, string>) => string;
751
+ setLocale: (locale: Locale) => void;
752
+ };
753
+
754
+ /**
755
+ * 创建国际化实例
756
+ */
757
+ export declare function useLocaleProvider(initialLocale?: Locale): {
758
+ locale: Ref<"zh-CN" | "en" | {
759
+ name: string;
760
+ messages: Record<string, string>;
761
+ }, Locale | {
762
+ name: string;
763
+ messages: Record<string, string>;
764
+ }>;
765
+ messages: Ref<Record<string, string>, Record<string, string>>;
766
+ t: (key: string, params?: Record<string, string>) => string;
767
+ setLocale: (newLocale: Locale) => void;
768
+ };
769
+
770
+ /**
771
+ * 使用主题
772
+ */
773
+ export declare function useTheme(): {
774
+ theme: Ref<Theme>;
775
+ setTheme: (theme: Theme) => void;
776
+ getVariables: () => Record<string, string>;
777
+ };
778
+
779
+ /**
780
+ * 创建主题提供者
781
+ */
782
+ export declare function useThemeProvider(initialTheme?: Theme, container?: Ref<HTMLElement | null>): {
783
+ theme: Ref<"light" | "dark" | {
784
+ name: string;
785
+ variables: Record<string, string>;
786
+ }, Theme | {
787
+ name: string;
788
+ variables: Record<string, string>;
789
+ }>;
790
+ setTheme: (newTheme: Theme) => void;
791
+ getVariables: () => Record<string, string>;
792
+ };
793
+
794
+ /**
795
+ * 使用预览器状态
796
+ */
797
+ export declare function useViewerState(): {
798
+ mounted: Ref<boolean, boolean>;
799
+ loading: Ref<boolean, boolean>;
800
+ error: Ref<Error | null, Error | null>;
801
+ fileType: Ref<FileType, FileType>;
802
+ filename: Ref<string, string>;
803
+ fileSource: Ref<string | {
804
+ readonly lastModified: number;
805
+ readonly name: string;
806
+ readonly webkitRelativePath: string;
807
+ readonly size: number;
808
+ readonly type: string;
809
+ arrayBuffer: () => Promise<ArrayBuffer>;
810
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
811
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
812
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
813
+ text: () => Promise<string>;
814
+ } | {
815
+ readonly size: number;
816
+ readonly type: string;
817
+ arrayBuffer: () => Promise<ArrayBuffer>;
818
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
819
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
820
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
821
+ text: () => Promise<string>;
822
+ } | {
823
+ readonly byteLength: number;
824
+ slice: (begin?: number, end?: number) => ArrayBuffer;
825
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
826
+ } | {
827
+ url: string;
828
+ headers?: Record<string, string> | undefined;
829
+ method?: "GET" | "POST" | undefined;
830
+ body?: string | {
831
+ readonly size: number;
832
+ readonly type: string;
833
+ arrayBuffer: () => Promise<ArrayBuffer>;
834
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
835
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
836
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
837
+ text: () => Promise<string>;
838
+ } | {
839
+ readonly byteLength: number;
840
+ slice: (begin?: number, end?: number) => ArrayBuffer;
841
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
842
+ } | {
843
+ readonly locked: boolean;
844
+ cancel: (reason?: any) => Promise<void>;
845
+ getReader: {
846
+ (options: {
847
+ mode: "byob";
848
+ }): ReadableStreamBYOBReader;
849
+ (): ReadableStreamDefaultReader<any>;
850
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<any>;
851
+ };
852
+ pipeThrough: <T>(transform: ReadableWritablePair<T, any>, options?: StreamPipeOptions) => ReadableStream<T>;
853
+ pipeTo: (destination: WritableStream<any>, options?: StreamPipeOptions) => Promise<void>;
854
+ tee: () => [ReadableStream<any>, ReadableStream<any>];
855
+ } | {
856
+ readonly buffer: {
857
+ readonly byteLength: number;
858
+ slice: (begin?: number, end?: number) => ArrayBuffer;
859
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
860
+ };
861
+ readonly byteLength: number;
862
+ readonly byteOffset: number;
863
+ } | {
864
+ append: {
865
+ (name: string, value: string | Blob): void;
866
+ (name: string, value: string): void;
867
+ (name: string, blobValue: Blob, filename?: string): void;
868
+ };
869
+ delete: (name: string) => void;
870
+ get: (name: string) => FormDataEntryValue | null;
871
+ getAll: (name: string) => FormDataEntryValue[];
872
+ has: (name: string) => boolean;
873
+ set: {
874
+ (name: string, value: string | Blob): void;
875
+ (name: string, value: string): void;
876
+ (name: string, blobValue: Blob, filename?: string): void;
877
+ };
878
+ forEach: (callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any) => void;
879
+ entries: () => FormDataIterator<[string, FormDataEntryValue]>;
880
+ keys: () => FormDataIterator<string>;
881
+ values: () => FormDataIterator<FormDataEntryValue>;
882
+ [Symbol.iterator]: () => FormDataIterator<[string, FormDataEntryValue]>;
883
+ } | {
884
+ readonly size: number;
885
+ append: (name: string, value: string) => void;
886
+ delete: (name: string, value?: string) => void;
887
+ get: (name: string) => string | null;
888
+ getAll: (name: string) => string[];
889
+ has: (name: string, value?: string) => boolean;
890
+ set: (name: string, value: string) => void;
891
+ sort: () => void;
892
+ toString: () => string;
893
+ forEach: (callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
894
+ entries: () => URLSearchParamsIterator<[string, string]>;
895
+ keys: () => URLSearchParamsIterator<string>;
896
+ values: () => URLSearchParamsIterator<string>;
897
+ [Symbol.iterator]: () => URLSearchParamsIterator<[string, string]>;
898
+ } | undefined;
899
+ } | null, FileSource | {
900
+ readonly lastModified: number;
901
+ readonly name: string;
902
+ readonly webkitRelativePath: string;
903
+ readonly size: number;
904
+ readonly type: string;
905
+ arrayBuffer: () => Promise<ArrayBuffer>;
906
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
907
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
908
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
909
+ text: () => Promise<string>;
910
+ } | {
911
+ readonly size: number;
912
+ readonly type: string;
913
+ arrayBuffer: () => Promise<ArrayBuffer>;
914
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
915
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
916
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
917
+ text: () => Promise<string>;
918
+ } | {
919
+ readonly byteLength: number;
920
+ slice: (begin?: number, end?: number) => ArrayBuffer;
921
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
922
+ } | {
923
+ url: string;
924
+ headers?: Record<string, string> | undefined;
925
+ method?: "GET" | "POST" | undefined;
926
+ body?: string | {
927
+ readonly size: number;
928
+ readonly type: string;
929
+ arrayBuffer: () => Promise<ArrayBuffer>;
930
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
931
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
932
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
933
+ text: () => Promise<string>;
934
+ } | {
935
+ readonly byteLength: number;
936
+ slice: (begin?: number, end?: number) => ArrayBuffer;
937
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
938
+ } | {
939
+ readonly locked: boolean;
940
+ cancel: (reason?: any) => Promise<void>;
941
+ getReader: {
942
+ (options: {
943
+ mode: "byob";
944
+ }): ReadableStreamBYOBReader;
945
+ (): ReadableStreamDefaultReader<any>;
946
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<any>;
947
+ };
948
+ pipeThrough: <T>(transform: ReadableWritablePair<T, any>, options?: StreamPipeOptions) => ReadableStream<T>;
949
+ pipeTo: (destination: WritableStream<any>, options?: StreamPipeOptions) => Promise<void>;
950
+ tee: () => [ReadableStream<any>, ReadableStream<any>];
951
+ } | {
952
+ readonly buffer: {
953
+ readonly byteLength: number;
954
+ slice: (begin?: number, end?: number) => ArrayBuffer;
955
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
956
+ };
957
+ readonly byteLength: number;
958
+ readonly byteOffset: number;
959
+ } | {
960
+ append: {
961
+ (name: string, value: string | Blob): void;
962
+ (name: string, value: string): void;
963
+ (name: string, blobValue: Blob, filename?: string): void;
964
+ };
965
+ delete: (name: string) => void;
966
+ get: (name: string) => FormDataEntryValue | null;
967
+ getAll: (name: string) => FormDataEntryValue[];
968
+ has: (name: string) => boolean;
969
+ set: {
970
+ (name: string, value: string | Blob): void;
971
+ (name: string, value: string): void;
972
+ (name: string, blobValue: Blob, filename?: string): void;
973
+ };
974
+ forEach: (callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any) => void;
975
+ entries: () => FormDataIterator<[string, FormDataEntryValue]>;
976
+ keys: () => FormDataIterator<string>;
977
+ values: () => FormDataIterator<FormDataEntryValue>;
978
+ [Symbol.iterator]: () => FormDataIterator<[string, FormDataEntryValue]>;
979
+ } | {
980
+ readonly size: number;
981
+ append: (name: string, value: string) => void;
982
+ delete: (name: string, value?: string) => void;
983
+ get: (name: string) => string | null;
984
+ getAll: (name: string) => string[];
985
+ has: (name: string, value?: string) => boolean;
986
+ set: (name: string, value: string) => void;
987
+ sort: () => void;
988
+ toString: () => string;
989
+ forEach: (callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
990
+ entries: () => URLSearchParamsIterator<[string, string]>;
991
+ keys: () => URLSearchParamsIterator<string>;
992
+ values: () => URLSearchParamsIterator<string>;
993
+ [Symbol.iterator]: () => URLSearchParamsIterator<[string, string]>;
994
+ } | undefined;
995
+ } | null>;
996
+ zoom: Ref<number, number>;
997
+ rotate: Ref<number, number>;
998
+ currentPage: Ref<number, number>;
999
+ totalPages: Ref<number, number>;
1000
+ fullscreen: Ref<boolean, boolean>;
1001
+ state: ComputedRef<ViewerState>;
1002
+ setMounted: (value: boolean) => void;
1003
+ setLoading: (value: boolean) => void;
1004
+ setError: (err: Error | null) => void;
1005
+ setFile: (source: FileSource, name?: string) => void;
1006
+ clearFile: () => void;
1007
+ setZoom: (value: number) => void;
1008
+ setRotate: (value: number) => void;
1009
+ resetTransform: () => void;
1010
+ setPage: (current: number, total?: number) => void;
1011
+ gotoPage: (page: number) => void;
1012
+ prevPage: () => void;
1013
+ nextPage: () => void;
1014
+ setPageController: (controller: PageController | null) => void;
1015
+ setFullscreen: (value: boolean) => void;
1016
+ print: () => void;
1017
+ setPrintFn: (fn: () => void) => void;
1018
+ };
1019
+
1020
+ export declare const Viewer: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
1021
+ toolbar: boolean;
1022
+ theme: string;
1023
+ locale: string;
1024
+ width: string;
1025
+ height: string;
1026
+ }>>, {
1027
+ mount: typeof mount;
1028
+ destroy: typeof destroy;
1029
+ setFile: typeof setFileInternal;
1030
+ getFile: () => {
1031
+ source: string | {
1032
+ readonly lastModified: number;
1033
+ readonly name: string;
1034
+ readonly webkitRelativePath: string;
1035
+ readonly size: number;
1036
+ readonly type: string;
1037
+ arrayBuffer: () => Promise<ArrayBuffer>;
1038
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
1039
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
1040
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
1041
+ text: () => Promise<string>;
1042
+ } | {
1043
+ readonly size: number;
1044
+ readonly type: string;
1045
+ arrayBuffer: () => Promise<ArrayBuffer>;
1046
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
1047
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
1048
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
1049
+ text: () => Promise<string>;
1050
+ } | {
1051
+ readonly byteLength: number;
1052
+ slice: (begin?: number, end?: number) => ArrayBuffer;
1053
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
1054
+ } | {
1055
+ url: string;
1056
+ headers?: Record<string, string> | undefined;
1057
+ method?: "GET" | "POST" | undefined;
1058
+ body?: string | {
1059
+ readonly size: number;
1060
+ readonly type: string;
1061
+ arrayBuffer: () => Promise<ArrayBuffer>;
1062
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
1063
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
1064
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
1065
+ text: () => Promise<string>;
1066
+ } | {
1067
+ readonly byteLength: number;
1068
+ slice: (begin?: number, end?: number) => ArrayBuffer;
1069
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
1070
+ } | {
1071
+ readonly locked: boolean;
1072
+ cancel: (reason?: any) => Promise<void>;
1073
+ getReader: {
1074
+ (options: {
1075
+ mode: "byob";
1076
+ }): ReadableStreamBYOBReader;
1077
+ (): ReadableStreamDefaultReader<any>;
1078
+ (options?: ReadableStreamGetReaderOptions): ReadableStreamReader<any>;
1079
+ };
1080
+ pipeThrough: <T>(transform: ReadableWritablePair<T, any>, options?: StreamPipeOptions) => ReadableStream<T>;
1081
+ pipeTo: (destination: WritableStream<any>, options?: StreamPipeOptions) => Promise<void>;
1082
+ tee: () => [ReadableStream<any>, ReadableStream<any>];
1083
+ } | {
1084
+ readonly buffer: {
1085
+ readonly byteLength: number;
1086
+ slice: (begin?: number, end?: number) => ArrayBuffer;
1087
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
1088
+ };
1089
+ readonly byteLength: number;
1090
+ readonly byteOffset: number;
1091
+ } | {
1092
+ append: {
1093
+ (name: string, value: string | Blob): void;
1094
+ (name: string, value: string): void;
1095
+ (name: string, blobValue: Blob, filename?: string): void;
1096
+ };
1097
+ delete: (name: string) => void;
1098
+ get: (name: string) => FormDataEntryValue | null;
1099
+ getAll: (name: string) => FormDataEntryValue[];
1100
+ has: (name: string) => boolean;
1101
+ set: {
1102
+ (name: string, value: string | Blob): void;
1103
+ (name: string, value: string): void;
1104
+ (name: string, blobValue: Blob, filename?: string): void;
1105
+ };
1106
+ forEach: (callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any) => void;
1107
+ entries: () => FormDataIterator<[string, FormDataEntryValue]>;
1108
+ keys: () => FormDataIterator<string>;
1109
+ values: () => FormDataIterator<FormDataEntryValue>;
1110
+ [Symbol.iterator]: () => FormDataIterator<[string, FormDataEntryValue]>;
1111
+ } | {
1112
+ readonly size: number;
1113
+ append: (name: string, value: string) => void;
1114
+ delete: (name: string, value?: string) => void;
1115
+ get: (name: string) => string | null;
1116
+ getAll: (name: string) => string[];
1117
+ has: (name: string, value?: string) => boolean;
1118
+ set: (name: string, value: string) => void;
1119
+ sort: () => void;
1120
+ toString: () => string;
1121
+ forEach: (callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
1122
+ entries: () => URLSearchParamsIterator<[string, string]>;
1123
+ keys: () => URLSearchParamsIterator<string>;
1124
+ values: () => URLSearchParamsIterator<string>;
1125
+ [Symbol.iterator]: () => URLSearchParamsIterator<[string, string]>;
1126
+ } | undefined;
1127
+ } | null;
1128
+ type: FileType;
1129
+ filename: string;
1130
+ };
1131
+ zoom: (value: number) => void;
1132
+ rotate: (value: number) => void;
1133
+ reset: () => void;
1134
+ fullscreen: (value: boolean) => void;
1135
+ prevPage: () => void;
1136
+ nextPage: () => void;
1137
+ gotoPage: (page: number) => void;
1138
+ getPageInfo: () => {
1139
+ current: number;
1140
+ total: number;
1141
+ };
1142
+ print: () => void;
1143
+ download: () => Promise<void>;
1144
+ setTheme: (newTheme: Theme) => void;
1145
+ setLocale: (locale: Locale) => void;
1146
+ setToolbar: (config: ToolbarConfig | boolean) => void;
1147
+ on: (event: string, handler: EventHandler) => void;
1148
+ off: (event: string, handler: EventHandler) => void;
1149
+ getState: () => ViewerState;
1150
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1151
+ error: (error: Error) => void;
1152
+ load: () => void;
1153
+ destroy: () => void;
1154
+ ready: () => void;
1155
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
1156
+ toolbar: boolean;
1157
+ theme: string;
1158
+ locale: string;
1159
+ width: string;
1160
+ height: string;
1161
+ }>>> & Readonly<{
1162
+ onError?: ((error: Error) => any) | undefined;
1163
+ onLoad?: (() => any) | undefined;
1164
+ onDestroy?: (() => any) | undefined;
1165
+ onReady?: (() => any) | undefined;
1166
+ }>, {
1167
+ width: string | number;
1168
+ height: string | number;
1169
+ locale: Locale;
1170
+ theme: Theme;
1171
+ toolbar: ToolbarConfig | boolean;
1172
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
1173
+
1174
+ export declare interface ViewerInstance {
1175
+ mount: (target?: HTMLElement | string) => Promise<void>;
1176
+ destroy: () => void;
1177
+ setFile: (file: FileSource, filename?: string) => Promise<void>;
1178
+ getFile: () => {
1179
+ source: FileSource;
1180
+ type: FileType;
1181
+ filename: string;
1182
+ } | null;
1183
+ zoom: (scale: number) => void;
1184
+ rotate: (degree: number) => void;
1185
+ reset: () => void;
1186
+ fullscreen: (enable?: boolean) => void;
1187
+ prevPage: () => void;
1188
+ nextPage: () => void;
1189
+ gotoPage: (page: number) => void;
1190
+ getPageInfo: () => {
1191
+ current: number;
1192
+ total: number;
1193
+ };
1194
+ print: () => void;
1195
+ download: () => void;
1196
+ setTheme: (theme: Theme) => void;
1197
+ setLocale: (locale: Locale) => void;
1198
+ setToolbar: (config: ToolbarConfig | boolean) => void;
1199
+ on: (event: string, handler: EventHandler) => void;
1200
+ off: (event: string, handler: EventHandler) => void;
1201
+ getState: () => ViewerState;
1202
+ }
1203
+
1204
+ export declare interface ViewerOptions {
1205
+ target?: HTMLElement | string;
1206
+ file?: FileSource;
1207
+ type?: FileType;
1208
+ filename?: string;
1209
+ toolbar?: ToolbarConfig | boolean;
1210
+ theme?: Theme;
1211
+ locale?: Locale;
1212
+ plugins?: Plugin_2[];
1213
+ width?: string | number;
1214
+ height?: string | number;
1215
+ className?: string;
1216
+ style?: Record<string, string>;
1217
+ onReady?: () => void;
1218
+ onError?: (error: Error) => void;
1219
+ onLoad?: () => void;
1220
+ onDestroy?: () => void;
1221
+ renderOptions?: {
1222
+ zoom?: number;
1223
+ rotate?: number;
1224
+ page?: number;
1225
+ [key: string]: any;
1226
+ };
1227
+ }
1228
+
1229
+ export declare interface ViewerState {
1230
+ mounted: boolean;
1231
+ loading: boolean;
1232
+ error: Error | null;
1233
+ fileType: FileType;
1234
+ filename: string;
1235
+ zoom: number;
1236
+ rotate: number;
1237
+ page: {
1238
+ current: number;
1239
+ total: number;
1240
+ };
1241
+ fullscreen: boolean;
1242
+ }
1243
+
1244
+ export { }