@likecoin/epub-ts 0.3.95 → 0.3.96

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.
@@ -77,7 +77,7 @@ declare class Annotations {
77
77
  /**
78
78
  * iterate over annotations in the store
79
79
  */
80
- each(..._args: any[]): any;
80
+ each(fn: (annotation: Annotation, key: string) => void): void;
81
81
  /**
82
82
  * Hook for injecting annotation into a view
83
83
  * @param {View} view
package/dist/book.d.ts CHANGED
@@ -12,7 +12,8 @@ import { default as Rendition } from './rendition';
12
12
  import { default as Archive } from './archive';
13
13
  import { default as Store } from './store';
14
14
  import { default as DisplayOptions } from './displayoptions';
15
- import { IEventEmitter, BookOptions, RenditionOptions, RequestFunction } from './types';
15
+ import { default as JSZip } from 'jszip';
16
+ import { IEventEmitter, BookOptions, RenditionOptions, RequestFunction, PackagingManifestObject, PackagingMetadataObject } from './types';
16
17
  import { default as Section } from './section';
17
18
  interface BookLoadingState {
18
19
  manifest: defer;
@@ -25,14 +26,14 @@ interface BookLoadingState {
25
26
  displayOptions: defer;
26
27
  }
27
28
  interface BookLoadedState {
28
- manifest: Promise<any>;
29
- spine: Promise<any>;
30
- metadata: Promise<any>;
31
- cover: Promise<any>;
32
- navigation: Promise<any>;
33
- pageList: Promise<any>;
34
- resources: Promise<any>;
35
- displayOptions: Promise<any>;
29
+ manifest: Promise<PackagingManifestObject>;
30
+ spine: Promise<Spine>;
31
+ metadata: Promise<PackagingMetadataObject>;
32
+ cover: Promise<string>;
33
+ navigation: Promise<Navigation>;
34
+ pageList: Promise<PageList>;
35
+ resources: Promise<Resources>;
36
+ displayOptions: Promise<DisplayOptions>;
36
37
  }
37
38
  /**
38
39
  * An Epub representation with methods for the loading, parsing and manipulation
@@ -59,7 +60,7 @@ declare class Book implements IEventEmitter {
59
60
  isOpen: boolean;
60
61
  loading: BookLoadingState | undefined;
61
62
  loaded: BookLoadedState | undefined;
62
- ready: Promise<any[]> | undefined;
63
+ ready: Promise<[PackagingManifestObject, Spine, PackagingMetadataObject, string, Navigation, Resources, DisplayOptions]> | undefined;
63
64
  isRendered: boolean;
64
65
  request: RequestFunction;
65
66
  spine: Spine | undefined;
@@ -188,7 +189,7 @@ declare class Book implements IEventEmitter {
188
189
  * @param {string} [encoding]
189
190
  * @return {Archive}
190
191
  */
191
- unarchive(input: string | ArrayBuffer | Blob, encoding?: string): Promise<any>;
192
+ unarchive(input: string | ArrayBuffer | Blob, encoding?: string): Promise<JSZip>;
192
193
  /**
193
194
  * Store the epubs contents
194
195
  * @private
@@ -216,7 +216,7 @@ declare class Contents implements IEventEmitter {
216
216
  * @param {array | object} rules
217
217
  * @param {string} key If the key is the same, the CSS will be replaced instead of inserted
218
218
  */
219
- addStylesheetRules(rules: any, key?: string): void;
219
+ addStylesheetRules(rules: Record<string, Record<string, string> | Array<Record<string, string>>> | Array<Array<string | string[]>>, key?: string): void;
220
220
  /**
221
221
  * Append a script tag to the document head
222
222
  * @param {string} src url