@prose-reader/streamer 1.62.0 → 1.63.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/dist/archives/createArchiveFromLibArchive.d.ts +74 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +187 -171
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +5 -5
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Archive } from './types';
|
|
2
|
+
|
|
3
|
+
export declare class ArchiveReader {
|
|
4
|
+
private file;
|
|
5
|
+
private client;
|
|
6
|
+
private worker;
|
|
7
|
+
private _content;
|
|
8
|
+
private _processed;
|
|
9
|
+
constructor(file: File, client: any, worker: any);
|
|
10
|
+
/**
|
|
11
|
+
* Prepares file for reading
|
|
12
|
+
* @returns {Promise<Archive>} archive instance
|
|
13
|
+
*/
|
|
14
|
+
open(): Promise<ArchiveReader>;
|
|
15
|
+
/**
|
|
16
|
+
* Terminate worker to free up memory
|
|
17
|
+
*/
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* detect if archive has encrypted data
|
|
21
|
+
* @returns {boolean|null} null if could not be determined
|
|
22
|
+
*/
|
|
23
|
+
hasEncryptedData(): Promise<boolean | null>;
|
|
24
|
+
/**
|
|
25
|
+
* set password to be used when reading archive
|
|
26
|
+
*/
|
|
27
|
+
usePassword(archivePassword: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Set locale, defaults to en_US.UTF-8
|
|
30
|
+
*/
|
|
31
|
+
setLocale(locale: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns object containing directory structure and file information
|
|
34
|
+
* @returns {Promise<object>}
|
|
35
|
+
*/
|
|
36
|
+
getFilesObject(): Promise<any>;
|
|
37
|
+
getFilesArray(): Promise<any[]>;
|
|
38
|
+
extractSingleFile(target: string): Promise<File>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns object containing directory structure and extracted File objects
|
|
41
|
+
* @param {Function} extractCallback
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
extractFiles(extractCallback?: Function | undefined): Promise<any>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Represents compressed file before extraction
|
|
48
|
+
*/
|
|
49
|
+
export declare class CompressedFile {
|
|
50
|
+
constructor(name: string, size: number, path: string, lastModified: number, archiveRef: ArchiveReader);
|
|
51
|
+
private _name;
|
|
52
|
+
private _size;
|
|
53
|
+
private _path;
|
|
54
|
+
private _lastModified;
|
|
55
|
+
private _archiveRef;
|
|
56
|
+
/**
|
|
57
|
+
* File name
|
|
58
|
+
*/
|
|
59
|
+
get name(): string;
|
|
60
|
+
/**
|
|
61
|
+
* File size
|
|
62
|
+
*/
|
|
63
|
+
get size(): number;
|
|
64
|
+
get lastModified(): number;
|
|
65
|
+
/**
|
|
66
|
+
* Extract file from archive
|
|
67
|
+
* @returns {Promise<File>} extracted file
|
|
68
|
+
*/
|
|
69
|
+
extract(): any;
|
|
70
|
+
}
|
|
71
|
+
export declare const createArchiveFromLibArchive: (libArchive: ArchiveReader, { name }?: {
|
|
72
|
+
orderByAlpha?: boolean;
|
|
73
|
+
name?: string;
|
|
74
|
+
}) => Promise<Archive>;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { getArchiveOpfInfo } from './archives/getArchiveOpfInfo';
|
|
|
4
4
|
export { createArchiveFromUrls } from './archives/createArchiveFromUrls';
|
|
5
5
|
export { createArchiveFromText } from './archives/createArchiveFromText';
|
|
6
6
|
export { createArchiveFromJszip } from './archives/createArchiveFromJszip';
|
|
7
|
+
export { createArchiveFromLibArchive } from './archives/createArchiveFromLibArchive';
|
|
7
8
|
export { createArchiveFromArrayBufferList } from './archives/createArchiveFromArrayBufferList';
|
|
8
9
|
export type { Manifest } from '@prose-reader/shared';
|
|
9
10
|
export type { Archive } from './archives/types';
|