@prose-reader/streamer 1.43.0 → 1.45.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/createArchiveFromArrayBufferList.d.ts +4 -3
- package/dist/archives/createArchiveFromJszip.d.ts +4 -4
- package/dist/archives/createArchiveFromText.d.ts +4 -3
- package/dist/archives/createArchiveFromUrls.d.ts +2 -1
- package/dist/archives/getArchiveOpfInfo.d.ts +3 -2
- package/dist/configure.d.ts +1 -1
- package/dist/epub/getSpineItemFilesFromArchive.d.ts +3 -2
- package/dist/generators/manifest/hooks/comicInfo.d.ts +3 -2
- package/dist/generators/manifest/hooks/default.d.ts +3 -2
- package/dist/generators/manifest/hooks/epub.d.ts +4 -3
- package/dist/generators/manifest/hooks/epubOptimizer.d.ts +3 -2
- package/dist/generators/manifest/hooks/navigationFallback.d.ts +3 -2
- package/dist/generators/manifest/index.d.ts +4 -3
- package/dist/generators/resources/hooks/calibreFixHook.d.ts +3 -2
- package/dist/generators/resources/hooks/cssFixHook.d.ts +3 -2
- package/dist/generators/resources/hooks/defaultHook.d.ts +3 -2
- package/dist/generators/resources/index.d.ts +2 -1
- package/dist/index.d.ts +10 -10
- package/dist/parsers/kobo.d.ts +2 -1
- package/dist/parsers/nav.d.ts +4 -3
- package/dist/tests/setupTests.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Archive } from
|
|
1
|
+
import { Archive } from './types';
|
|
2
|
+
|
|
2
3
|
export declare const createArchiveFromArrayBufferList: (list: {
|
|
3
4
|
isDir: boolean;
|
|
4
5
|
name: string;
|
|
5
6
|
size: number;
|
|
6
7
|
data: () => Promise<ArrayBuffer>;
|
|
7
8
|
}[], { orderByAlpha, name }?: {
|
|
8
|
-
orderByAlpha?: boolean
|
|
9
|
-
name?: string
|
|
9
|
+
orderByAlpha?: boolean;
|
|
10
|
+
name?: string;
|
|
10
11
|
}) => Promise<Archive>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Archive, StreamResult } from './types';
|
|
2
|
+
|
|
3
3
|
interface OutputByType {
|
|
4
4
|
base64: string;
|
|
5
5
|
string: string;
|
|
@@ -28,7 +28,7 @@ interface JSZip {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export declare const createArchiveFromJszip: (jszip: JSZip, { orderByAlpha, name }?: {
|
|
31
|
-
orderByAlpha?: boolean
|
|
32
|
-
name?: string
|
|
31
|
+
orderByAlpha?: boolean;
|
|
32
|
+
name?: string;
|
|
33
33
|
}) => Promise<Archive>;
|
|
34
34
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Archive } from
|
|
1
|
+
import { Archive } from './types';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Useful to create archive from txt content
|
|
4
5
|
*/
|
|
5
6
|
export declare const createArchiveFromText: (content: string | Blob, { mimeType, direction, }?: {
|
|
6
|
-
direction?:
|
|
7
|
-
mimeType?: string
|
|
7
|
+
direction?: `ltr` | `rtl`;
|
|
8
|
+
mimeType?: string;
|
|
8
9
|
}) => Promise<Archive>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Archive } from
|
|
1
|
+
import { Archive } from './types';
|
|
2
|
+
|
|
2
3
|
export declare const getArchiveOpfInfo: (archive: Archive) => {
|
|
3
4
|
data: {
|
|
4
5
|
dir: boolean;
|
|
@@ -7,7 +8,7 @@ export declare const getArchiveOpfInfo: (archive: Archive) => {
|
|
|
7
8
|
blob: () => Promise<Blob>;
|
|
8
9
|
string: () => Promise<string>;
|
|
9
10
|
base64: () => Promise<string>;
|
|
10
|
-
stream?: (() => import(
|
|
11
|
+
stream?: (() => import('./types').StreamResult) | undefined;
|
|
11
12
|
size: number;
|
|
12
13
|
encodingFormat?: string | undefined;
|
|
13
14
|
} | undefined;
|
package/dist/configure.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Archive } from
|
|
1
|
+
import { Archive } from '../archives/types';
|
|
2
|
+
|
|
2
3
|
export declare const getSpineItemFilesFromArchive: ({ archive }: {
|
|
3
4
|
archive: Archive;
|
|
4
5
|
}) => Promise<{
|
|
@@ -8,7 +9,7 @@ export declare const getSpineItemFilesFromArchive: ({ archive }: {
|
|
|
8
9
|
blob: () => Promise<Blob>;
|
|
9
10
|
string: () => Promise<string>;
|
|
10
11
|
base64: () => Promise<string>;
|
|
11
|
-
stream?: (() => import(
|
|
12
|
+
stream?: (() => import('../archives/types').StreamResult) | undefined;
|
|
12
13
|
size: number;
|
|
13
14
|
encodingFormat?: string | undefined;
|
|
14
15
|
}[]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Manifest } from
|
|
2
|
-
import { Archive } from
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { Archive } from '../../../archives/types';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Handle archive which contains ComicInfo.xml. This is a meta file
|
|
5
6
|
* used to define cbz, etc. I believe it comes from some sites or apps.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Manifest } from
|
|
2
|
-
import { Archive } from
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { Archive } from '../../../archives/types';
|
|
3
|
+
|
|
3
4
|
export declare const defaultHook: ({ archive, baseUrl }: {
|
|
4
5
|
archive: Archive;
|
|
5
6
|
baseUrl: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import xmldoc from
|
|
2
|
-
import
|
|
3
|
-
import { Archive } from
|
|
1
|
+
import { default as xmldoc } from 'xmldoc';
|
|
2
|
+
import { Manifest } from '@prose-reader/shared';
|
|
3
|
+
import { Archive } from '../../../archives/types';
|
|
4
|
+
|
|
4
5
|
export declare const getItemsFromDoc: (doc: xmldoc.XmlDocument) => {
|
|
5
6
|
href: string;
|
|
6
7
|
id: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Manifest } from
|
|
2
|
-
import { Archive } from
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { Archive } from '../../../archives/types';
|
|
3
|
+
|
|
3
4
|
export declare const epubOptimizerHook: ({ archive }: {
|
|
4
5
|
archive: Archive;
|
|
5
6
|
baseUrl: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Manifest } from
|
|
2
|
-
import { Archive } from
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { Archive } from '../../../archives/types';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* In case no navigation was generated prior to this hook, we will try
|
|
5
6
|
* to generate something based on the structure of the archive.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Archive } from
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { Archive } from '../../archives/types';
|
|
3
|
+
|
|
3
4
|
export declare const generateManifestFromArchive: (archive: Archive, { baseUrl }?: {
|
|
4
|
-
baseUrl?: string
|
|
5
|
+
baseUrl?: string;
|
|
5
6
|
}) => Promise<Manifest>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Archive } from
|
|
2
|
-
import { HookResource } from
|
|
1
|
+
import { Archive } from '../../../archives/types';
|
|
2
|
+
import { HookResource } from './types';
|
|
3
|
+
|
|
3
4
|
export declare const calibreFixHook: ({ archive, resourcePath }: {
|
|
4
5
|
archive: Archive;
|
|
5
6
|
resourcePath: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Archive } from
|
|
2
|
-
import { HookResource } from
|
|
1
|
+
import { Archive } from '../../../archives/types';
|
|
2
|
+
import { HookResource } from './types';
|
|
3
|
+
|
|
3
4
|
export declare const cssFixHook: ({ archive, resourcePath }: {
|
|
4
5
|
archive: Archive;
|
|
5
6
|
resourcePath: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Archive } from
|
|
2
|
-
import { HookResource } from
|
|
1
|
+
import { Archive } from '../../../archives/types';
|
|
2
|
+
import { HookResource } from './types';
|
|
3
|
+
|
|
3
4
|
export declare const defaultHook: ({ archive, resourcePath }: {
|
|
4
5
|
archive: Archive;
|
|
5
6
|
resourcePath: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { generateResourceFromArchive, generateResourceFromError } from
|
|
2
|
-
export { generateManifestFromArchive } from
|
|
3
|
-
export { getArchiveOpfInfo } from
|
|
4
|
-
export { createArchiveFromUrls } from
|
|
5
|
-
export { createArchiveFromText } from
|
|
6
|
-
export { createArchiveFromJszip } from
|
|
7
|
-
export { createArchiveFromArrayBufferList } from
|
|
8
|
-
export type { Manifest } from
|
|
9
|
-
export type { Archive } from
|
|
10
|
-
export { configure } from
|
|
1
|
+
export { generateResourceFromArchive, generateResourceFromError } from './generators/resources';
|
|
2
|
+
export { generateManifestFromArchive } from './generators/manifest';
|
|
3
|
+
export { getArchiveOpfInfo } from './archives/getArchiveOpfInfo';
|
|
4
|
+
export { createArchiveFromUrls } from './archives/createArchiveFromUrls';
|
|
5
|
+
export { createArchiveFromText } from './archives/createArchiveFromText';
|
|
6
|
+
export { createArchiveFromJszip } from './archives/createArchiveFromJszip';
|
|
7
|
+
export { createArchiveFromArrayBufferList } from './archives/createArchiveFromArrayBufferList';
|
|
8
|
+
export type { Manifest } from '@prose-reader/shared';
|
|
9
|
+
export type { Archive } from './archives/types';
|
|
10
|
+
export { configure } from './configure';
|
package/dist/parsers/kobo.d.ts
CHANGED
package/dist/parsers/nav.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import xmldoc from
|
|
2
|
-
import { Archive } from
|
|
1
|
+
import { default as xmldoc } from 'xmldoc';
|
|
2
|
+
import { Archive } from '..';
|
|
3
|
+
|
|
3
4
|
export declare const parseToc: (opfXmlDoc: xmldoc.XmlDocument, archive: Archive, { baseUrl }: {
|
|
4
5
|
baseUrl: string;
|
|
5
|
-
}) => Promise<import(
|
|
6
|
+
}) => Promise<import('@prose-reader/shared').TocItem[] | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prose-reader/streamer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"test:watch": "vitest watch"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@prose-reader/shared": "^1.
|
|
27
|
+
"@prose-reader/shared": "^1.45.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"buffer": "^6.0.3",
|
|
31
31
|
"xmldoc": "^1.1.2"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "373237b5687d4af5f19ba0626d8aa11b7b330e9b",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"buffer": "^6.0.3",
|
|
36
36
|
"xmldoc": "^1.2.0"
|