@prose-reader/streamer 1.2.0 → 1.4.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.
Files changed (54) hide show
  1. package/dist/archives/createArchiveFromText.d.ts +3 -2
  2. package/dist/archives/getArchiveOpfInfo.d.ts +1 -1
  3. package/dist/archives/types.d.ts +1 -1
  4. package/dist/configure.d.ts +3 -0
  5. package/dist/epub/getSpineItemFilesFromArchive.d.ts +1 -1
  6. package/dist/generators/manifest/{comicInfo.d.ts → hooks/comicInfo.d.ts} +2 -2
  7. package/dist/{src/generators/manifest → generators/manifest/hooks}/default.d.ts +2 -2
  8. package/dist/generators/manifest/{epub.d.ts → hooks/epub.d.ts} +2 -2
  9. package/dist/{dist/generators/manifest/default.d.ts → generators/manifest/hooks/epubOptimizer.d.ts} +2 -2
  10. package/dist/generators/manifest/index.d.ts +3 -2
  11. package/dist/generators/resources.d.ts +8 -1
  12. package/dist/index.d.ts +5 -7
  13. package/dist/prose-streamer.js +207 -182
  14. package/dist/prose-streamer.js.map +1 -1
  15. package/dist/prose-streamer.umd.cjs +8 -8
  16. package/dist/prose-streamer.umd.cjs.map +1 -1
  17. package/package.json +3 -3
  18. package/dist/dist/archives/createArchiveFromArrayBufferList.d.ts +0 -10
  19. package/dist/dist/archives/createArchiveFromJszip.d.ts +0 -34
  20. package/dist/dist/archives/createArchiveFromText.d.ts +0 -7
  21. package/dist/dist/archives/createArchiveFromUrls.d.ts +0 -9
  22. package/dist/dist/archives/getArchiveOpfInfo.d.ts +0 -15
  23. package/dist/dist/archives/types.d.ts +0 -20
  24. package/dist/dist/epub/getSpineItemFilesFromArchive.d.ts +0 -14
  25. package/dist/dist/generators/manifest/comicInfo.d.ts +0 -10
  26. package/dist/dist/generators/manifest/epub.d.ts +0 -12
  27. package/dist/dist/generators/manifest/index.d.ts +0 -4
  28. package/dist/dist/generators/resources.d.ts +0 -2
  29. package/dist/dist/index.d.ts +0 -12
  30. package/dist/dist/parsers/kobo.d.ts +0 -6
  31. package/dist/dist/parsers/nav.d.ts +0 -5
  32. package/dist/dist/report.d.ts +0 -13
  33. package/dist/dist/utils/blobToBAse64.d.ts +0 -1
  34. package/dist/dist/utils/sortByTitleComparator.d.ts +0 -1
  35. package/dist/dist/utils/uri.d.ts +0 -1
  36. package/dist/generators/manifest/default.d.ts +0 -6
  37. package/dist/src/archives/createArchiveFromArrayBufferList.d.ts +0 -10
  38. package/dist/src/archives/createArchiveFromJszip.d.ts +0 -34
  39. package/dist/src/archives/createArchiveFromText.d.ts +0 -7
  40. package/dist/src/archives/createArchiveFromUrls.d.ts +0 -9
  41. package/dist/src/archives/getArchiveOpfInfo.d.ts +0 -15
  42. package/dist/src/archives/types.d.ts +0 -20
  43. package/dist/src/epub/getSpineItemFilesFromArchive.d.ts +0 -14
  44. package/dist/src/generators/manifest/comicInfo.d.ts +0 -10
  45. package/dist/src/generators/manifest/epub.d.ts +0 -12
  46. package/dist/src/generators/manifest/index.d.ts +0 -4
  47. package/dist/src/generators/resources.d.ts +0 -2
  48. package/dist/src/index.d.ts +0 -12
  49. package/dist/src/parsers/kobo.d.ts +0 -6
  50. package/dist/src/parsers/nav.d.ts +0 -5
  51. package/dist/src/report.d.ts +0 -13
  52. package/dist/src/utils/blobToBAse64.d.ts +0 -1
  53. package/dist/src/utils/sortByTitleComparator.d.ts +0 -1
  54. package/dist/src/utils/uri.d.ts +0 -1
@@ -2,6 +2,7 @@ import { Archive } from "./types";
2
2
  /**
3
3
  * Useful to create archive from txt content
4
4
  */
5
- export declare const createArchiveFromText: (content: string | Blob, options?: {
6
- direction: `ltr` | `rtl`;
5
+ export declare const createArchiveFromText: (content: string | Blob, { mimeType, direction }?: {
6
+ direction?: "ltr" | "rtl" | undefined;
7
+ mimeType?: string | undefined;
7
8
  }) => Promise<Archive>;
@@ -9,7 +9,7 @@ export declare const getArchiveOpfInfo: (archive: Archive) => {
9
9
  base64: () => Promise<string>;
10
10
  stream?: (() => import("./types").StreamResult) | undefined;
11
11
  size: number;
12
- encodingFormat?: "image/png" | "image/jpg" | "image/jpeg" | "text/plain" | "image/webp" | undefined;
12
+ encodingFormat?: string | undefined;
13
13
  } | undefined;
14
14
  basePath: string;
15
15
  };
@@ -15,6 +15,6 @@ export declare type Archive = {
15
15
  base64: () => Promise<string>;
16
16
  stream?: () => StreamResult;
17
17
  size: number;
18
- encodingFormat?: undefined | `text/plain` | `image/png` | `image/jpg` | `image/jpeg` | `image/webp`;
18
+ encodingFormat?: string;
19
19
  }[];
20
20
  };
@@ -0,0 +1,3 @@
1
+ export declare const configure: ({ enableReport }?: {
2
+ enableReport?: boolean | undefined;
3
+ }) => void;
@@ -10,5 +10,5 @@ export declare const getSpineItemFilesFromArchive: ({ archive }: {
10
10
  base64: () => Promise<string>;
11
11
  stream?: (() => import("../archives/types").StreamResult) | undefined;
12
12
  size: number;
13
- encodingFormat?: "image/png" | "image/jpg" | "image/jpeg" | "text/plain" | "image/webp" | undefined;
13
+ encodingFormat?: string | undefined;
14
14
  }[]>;
@@ -1,10 +1,10 @@
1
1
  import { Manifest } from "@prose-reader/shared";
2
- import { Archive } from "../../archives/types";
2
+ import { Archive } from "../../../archives/types";
3
3
  /**
4
4
  * Handle archive which contains ComicInfo.xml. This is a meta file
5
5
  * used to define cbz, etc. I believe it comes from some sites or apps.
6
6
  */
7
- export declare const comicInfoGenerator: ({ archive, baseUrl }: {
7
+ export declare const comicInfoHook: ({ archive, baseUrl }: {
8
8
  archive: Archive;
9
9
  baseUrl: string;
10
10
  }) => (manifest: Manifest) => Promise<Manifest>;
@@ -1,6 +1,6 @@
1
1
  import { Manifest } from "@prose-reader/shared";
2
- import { Archive } from "../../archives/types";
3
- export declare const defaultGenerator: ({ archive, baseUrl }: {
2
+ import { Archive } from "../../../archives/types";
3
+ export declare const defaultHook: ({ archive, baseUrl }: {
4
4
  archive: Archive;
5
5
  baseUrl: string;
6
6
  }) => (manifest: Manifest) => Promise<Manifest>;
@@ -1,12 +1,12 @@
1
1
  import xmldoc from "xmldoc";
2
2
  import type { Manifest } from "@prose-reader/shared";
3
- import { Archive } from "../../archives/types";
3
+ import { Archive } from "../../../archives/types";
4
4
  export declare const getItemsFromDoc: (doc: xmldoc.XmlDocument) => {
5
5
  href: string;
6
6
  id: string;
7
7
  mediaType: string | undefined;
8
8
  }[];
9
- export declare const epubGenerator: ({ archive, baseUrl }: {
9
+ export declare const epubHook: ({ archive, baseUrl }: {
10
10
  archive: Archive;
11
11
  baseUrl: string;
12
12
  }) => (manifest: Manifest) => Promise<Manifest>;
@@ -1,6 +1,6 @@
1
1
  import { Manifest } from "@prose-reader/shared";
2
- import { Archive } from "../../archives/types";
3
- export declare const defaultGenerator: ({ archive, baseUrl }: {
2
+ import { Archive } from "../../../archives/types";
3
+ export declare const epubOptimizerHook: ({ archive, baseUrl }: {
4
4
  archive: Archive;
5
5
  baseUrl: string;
6
6
  }) => (manifest: Manifest) => Promise<Manifest>;
@@ -1,4 +1,5 @@
1
+ import type { Manifest } from "@prose-reader/shared";
1
2
  import { Archive } from "../../archives/types";
2
- export declare const getManifestFromArchive: (archive: Archive, { baseUrl }?: {
3
+ export declare const generateManifestFromArchive: (archive: Archive, { baseUrl }?: {
3
4
  baseUrl?: string | undefined;
4
- }) => Promise<Response>;
5
+ }) => Promise<Manifest>;
@@ -1,2 +1,9 @@
1
1
  import { Archive } from "..";
2
- export declare const getResourceFromArchive: (archive: Archive, resourcePath: string) => Promise<Response>;
2
+ export declare const generateResourceFromArchive: (archive: Archive, resourcePath: string) => Promise<{
3
+ body: Blob;
4
+ params: {
5
+ headers: {
6
+ "Content-Type"?: string | undefined;
7
+ };
8
+ };
9
+ }>;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- import xmldoc from "xmldoc";
2
- export { getResourceFromArchive } from "./generators/resources";
3
- export { getManifestFromArchive } from "./generators/manifest";
4
- export { Report } from "./report";
5
- export type { Manifest } from "@prose-reader/shared";
6
- export type { Archive } from "./archives/types";
1
+ export { generateResourceFromArchive } from "./generators/resources";
2
+ export { generateManifestFromArchive } from "./generators/manifest";
7
3
  export { getArchiveOpfInfo } from "./archives/getArchiveOpfInfo";
8
4
  export { createArchiveFromUrls } from "./archives/createArchiveFromUrls";
9
5
  export { createArchiveFromText } from "./archives/createArchiveFromText";
10
6
  export { createArchiveFromJszip } from "./archives/createArchiveFromJszip";
11
7
  export { createArchiveFromArrayBufferList } from "./archives/createArchiveFromArrayBufferList";
12
- export { xmldoc };
8
+ export type { Manifest } from "@prose-reader/shared";
9
+ export type { Archive } from "./archives/types";
10
+ export { configure } from "./configure";