@likecoin/epub-ts 0.4.3 → 0.4.4

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/archive.d.ts CHANGED
@@ -33,7 +33,7 @@ declare class Archive {
33
33
  * @param {string} [type] specify the type of the returned result
34
34
  * @return {Promise<Blob | string | JSON | Document | XMLDocument>}
35
35
  */
36
- request(url: string, type?: string): Promise<any>;
36
+ request(url: string, type?: string): Promise<unknown>;
37
37
  /**
38
38
  * Handle the response from request
39
39
  * @private
@@ -41,7 +41,7 @@ declare class Archive {
41
41
  * @param {string} [type]
42
42
  * @return {any} the parsed result
43
43
  */
44
- handleResponse(response: any, type?: string): any;
44
+ handleResponse(response: string | Blob, type?: string): Document | object | Blob | string;
45
45
  /**
46
46
  * Get a Blob from Archive by Url
47
47
  * @param {string} url
package/dist/book.d.ts CHANGED
@@ -16,14 +16,14 @@ import { default as JSZip } from 'jszip';
16
16
  import { IEventEmitter, BookOptions, RenditionOptions, RequestFunction, PackagingManifestObject, PackagingMetadataObject } from './types';
17
17
  import { default as Section } from './section';
18
18
  interface BookLoadingState {
19
- manifest: defer;
20
- spine: defer;
21
- metadata: defer;
22
- cover: defer;
23
- navigation: defer;
24
- pageList: defer;
25
- resources: defer;
26
- displayOptions: defer;
19
+ manifest: defer<PackagingManifestObject>;
20
+ spine: defer<Spine>;
21
+ metadata: defer<PackagingMetadataObject>;
22
+ cover: defer<string>;
23
+ navigation: defer<Navigation>;
24
+ pageList: defer<PageList>;
25
+ resources: defer<Resources>;
26
+ displayOptions: defer<DisplayOptions>;
27
27
  }
28
28
  interface BookLoadedState {
29
29
  manifest: Promise<PackagingManifestObject>;
@@ -54,8 +54,8 @@ interface BookLoadedState {
54
54
  * @example new Book({ replacements: "blobUrl" })
55
55
  */
56
56
  declare class Book implements IEventEmitter {
57
- settings: BookOptions & Record<string, any>;
58
- opening: defer;
57
+ settings: BookOptions;
58
+ opening: defer<Book>;
59
59
  opened: Promise<Book> | undefined;
60
60
  isOpen: boolean;
61
61
  loading: BookLoadingState | undefined;
@@ -125,7 +125,7 @@ declare class Book implements IEventEmitter {
125
125
  * @param {string} path path to the resource to load
126
126
  * @return {Promise} returns a promise with the requested resource
127
127
  */
128
- load(path: string, _type?: string): Promise<any>;
128
+ load(path: string, _type?: string): Promise<unknown>;
129
129
  /**
130
130
  * Resolve a path to it's absolute position in the Book
131
131
  * @param {string} path
@@ -145,7 +145,7 @@ declare class Book implements IEventEmitter {
145
145
  * @param {string} input
146
146
  * @return {string} binary | directory | epub | opf
147
147
  */
148
- determineType(input: string | ArrayBuffer | Blob): string;
148
+ determineType(input: string | ArrayBuffer | Blob): string | undefined;
149
149
  /**
150
150
  * unpack the contents of the Books packaging
151
151
  * @private
@@ -13,7 +13,7 @@ import { default as Section } from './section';
13
13
  declare class Contents implements IEventEmitter {
14
14
  on: (type: string, fn: (...args: any[]) => void) => this;
15
15
  off: (type: string, fn?: (...args: any[]) => void) => this;
16
- emit: (type: string, ...args: any[]) => void;
16
+ emit: (type: string, ...args: unknown[]) => void;
17
17
  __listeners: IEventEmitter["__listeners"];
18
18
  epubcfi: EpubCFI;
19
19
  document: Document;