@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.
@@ -1,10 +1,11 @@
1
- import { Archive } from "./types";
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 | undefined;
9
- name?: string | undefined;
9
+ orderByAlpha?: boolean;
10
+ name?: string;
10
11
  }) => Promise<Archive>;
@@ -1,5 +1,5 @@
1
- /// <reference types="node" />
2
- import { Archive, StreamResult } from "./types";
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 | undefined;
32
- name?: string | undefined;
31
+ orderByAlpha?: boolean;
32
+ name?: string;
33
33
  }) => Promise<Archive>;
34
34
  export {};
@@ -1,8 +1,9 @@
1
- import { Archive } from "./types";
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?: "ltr" | "rtl" | undefined;
7
- mimeType?: string | undefined;
7
+ direction?: `ltr` | `rtl`;
8
+ mimeType?: string;
8
9
  }) => Promise<Archive>;
@@ -1,4 +1,5 @@
1
- import { Archive } from "./types";
1
+ import { Archive } from './types';
2
+
2
3
  /**
3
4
  * @important
4
5
  * Make sure the urls are on the same origin or the cors header is set otherwise
@@ -1,4 +1,5 @@
1
- import { Archive } from "./types";
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("./types").StreamResult) | undefined;
11
+ stream?: (() => import('./types').StreamResult) | undefined;
11
12
  size: number;
12
13
  encodingFormat?: string | undefined;
13
14
  } | undefined;
@@ -1,3 +1,3 @@
1
1
  export declare const configure: ({ enableReport }?: {
2
- enableReport?: boolean | undefined;
2
+ enableReport?: boolean;
3
3
  }) => void;
@@ -1,4 +1,5 @@
1
- import { Archive } from "../archives/types";
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("../archives/types").StreamResult) | undefined;
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 "@prose-reader/shared";
2
- import { Archive } from "../../../archives/types";
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 "@prose-reader/shared";
2
- import { Archive } from "../../../archives/types";
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 "xmldoc";
2
- import type { Manifest } from "@prose-reader/shared";
3
- import { Archive } from "../../../archives/types";
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 "@prose-reader/shared";
2
- import { Archive } from "../../../archives/types";
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 "@prose-reader/shared";
2
- import { Archive } from "../../../archives/types";
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 type { Manifest } from "@prose-reader/shared";
2
- import { Archive } from "../../archives/types";
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 | undefined;
5
+ baseUrl?: string;
5
6
  }) => Promise<Manifest>;
@@ -1,5 +1,6 @@
1
- import { Archive } from "../../../archives/types";
2
- import { HookResource } from "./types";
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 "../../../archives/types";
2
- import { HookResource } from "./types";
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 "../../../archives/types";
2
- import { HookResource } from "./types";
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;
@@ -1,4 +1,5 @@
1
- import { Archive } from "../..";
1
+ import { Archive } from '../..';
2
+
2
3
  export declare const generateResourceFromArchive: (archive: Archive, resourcePath: string) => Promise<{
3
4
  body: string | Blob;
4
5
  params: {
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
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";
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';
@@ -1,4 +1,5 @@
1
- import { Archive } from "..";
1
+ import { Archive } from '..';
2
+
2
3
  type KoboInformation = {
3
4
  renditionLayout?: `reflowable` | `pre-paginated` | undefined;
4
5
  };
@@ -1,5 +1,6 @@
1
- import xmldoc from "xmldoc";
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("@prose-reader/shared").TocItem[] | undefined>;
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.43.0",
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.43.0"
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": "459b3d52ebfe644db8af3a95d50f620da8e4c3a3",
33
+ "gitHead": "373237b5687d4af5f19ba0626d8aa11b7b330e9b",
34
34
  "devDependencies": {
35
35
  "buffer": "^6.0.3",
36
36
  "xmldoc": "^1.2.0"