@likecoin/epub-ts 0.3.97 → 0.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.
- package/README.md +6 -4
- package/dist/contents.d.ts +5 -1
- package/dist/epub.cjs +3 -9
- package/dist/epub.cjs.map +1 -1
- package/dist/epub.js +1029 -4187
- package/dist/epub.js.map +1 -1
- package/dist/epub.umd.js +3 -9
- package/dist/epub.umd.js.map +1 -1
- package/dist/section.d.ts +1 -1
- package/dist/store.d.ts +6 -3
- package/dist/themes.d.ts +1 -1
- package/dist/utils/core.d.ts +11 -9
- package/dist/utils/hook.d.ts +2 -2
- package/dist/utils/path-utils.d.ts +1 -1
- package/package.json +2 -5
package/dist/section.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare class Section {
|
|
|
54
54
|
*/
|
|
55
55
|
find(_query: string): SearchResult[];
|
|
56
56
|
/**
|
|
57
|
-
* Search a string in multiple sequential Element of the section.
|
|
57
|
+
* Search a string in multiple sequential Element of the section.
|
|
58
58
|
* @param {string} _query The query string to search
|
|
59
59
|
* @param {int} maxSeqEle The maximum number of Element that are combined for search, default value is 5.
|
|
60
60
|
* @return {object[]} A list of matches, with form {cfi, excerpt}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { IEventEmitter, RequestFunction } from './types';
|
|
2
|
+
interface SimpleStorage {
|
|
3
|
+
getItem(key: string): Promise<any>;
|
|
4
|
+
setItem(key: string, value: any): Promise<any>;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Handles saving and requesting files from local storage
|
|
4
8
|
* @class
|
|
@@ -11,7 +15,7 @@ declare class Store implements IEventEmitter {
|
|
|
11
15
|
off: (type: string, fn?: (...args: any[]) => void) => this;
|
|
12
16
|
emit: (type: string, ...args: any[]) => void;
|
|
13
17
|
urlCache: Record<string, string>;
|
|
14
|
-
storage:
|
|
18
|
+
storage: SimpleStorage;
|
|
15
19
|
name: string;
|
|
16
20
|
requester: RequestFunction;
|
|
17
21
|
resolver: (href: string) => string;
|
|
@@ -19,8 +23,7 @@ declare class Store implements IEventEmitter {
|
|
|
19
23
|
_status: ((event: Event) => void) | undefined;
|
|
20
24
|
constructor(name: string, requester?: RequestFunction, resolver?: (href: string) => string);
|
|
21
25
|
/**
|
|
22
|
-
* Checks
|
|
23
|
-
* Requires localForage if it isn't there
|
|
26
|
+
* Checks that IndexedDB is available and creates the storage instance
|
|
24
27
|
* @private
|
|
25
28
|
*/
|
|
26
29
|
checkRequirements(): void;
|
package/dist/themes.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare class Themes {
|
|
|
22
22
|
* @example themes.register("light", { "body": { "color": "purple"}})
|
|
23
23
|
* @example themes.register({ "light" : {...}, "dark" : {...}})
|
|
24
24
|
*/
|
|
25
|
-
register(...
|
|
25
|
+
register(...args: any[]): void;
|
|
26
26
|
/**
|
|
27
27
|
* Add a default theme to be used by a rendition
|
|
28
28
|
* @param {object | string} theme
|
package/dist/utils/core.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Core Utilities and Helpers
|
|
3
|
+
* @module Core
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
3
6
|
* @returns {function} requestAnimationFrame
|
|
4
7
|
* @memberof Core
|
|
5
8
|
*/
|
|
6
|
-
export declare const requestAnimationFrame:
|
|
9
|
+
export declare const requestAnimationFrame: boolean | (((callback: FrameRequestCallback) => number) & typeof globalThis.requestAnimationFrame);
|
|
7
10
|
/**
|
|
8
11
|
* Generates a UUID
|
|
9
12
|
* based on: http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
|
|
@@ -49,14 +52,14 @@ export declare function prefixed(unprefixed: string): string;
|
|
|
49
52
|
* @returns {object}
|
|
50
53
|
* @memberof Core
|
|
51
54
|
*/
|
|
52
|
-
export declare function defaults(obj: any, ...
|
|
55
|
+
export declare function defaults(obj: any, ...sources: any[]): any;
|
|
53
56
|
/**
|
|
54
57
|
* Extend properties of an object
|
|
55
58
|
* @param {object} target
|
|
56
59
|
* @returns {object}
|
|
57
60
|
* @memberof Core
|
|
58
61
|
*/
|
|
59
|
-
export declare function extend(target: any, ...
|
|
62
|
+
export declare function extend(target: any, ...sources: any[]): any;
|
|
60
63
|
/**
|
|
61
64
|
* Fast quicksort insert for sorted array -- based on:
|
|
62
65
|
* http://stackoverflow.com/questions/1344500/efficient-way-to-insert-a-number-into-a-sorted-array-of-numbers
|
|
@@ -203,13 +206,12 @@ export declare function type(obj: unknown): string;
|
|
|
203
206
|
* Parse xml (or html) markup
|
|
204
207
|
* @param {string} markup
|
|
205
208
|
* @param {string} mime
|
|
206
|
-
* @param {boolean} forceXMLDom force using xmlDom to parse instead of native parser
|
|
207
209
|
* @returns {document} document
|
|
208
210
|
* @memberof Core
|
|
209
211
|
*/
|
|
210
|
-
export declare function parse(markup: string, mime: string
|
|
212
|
+
export declare function parse(markup: string, mime: string): Document;
|
|
211
213
|
/**
|
|
212
|
-
* querySelector
|
|
214
|
+
* querySelector wrapper
|
|
213
215
|
* @param {element} el
|
|
214
216
|
* @param {string} sel selector string
|
|
215
217
|
* @returns {element} element
|
|
@@ -217,13 +219,13 @@ export declare function parse(markup: string, mime: string, forceXMLDom?: boolea
|
|
|
217
219
|
*/
|
|
218
220
|
export declare function qs(el: Document | Element, sel: string): Element | undefined;
|
|
219
221
|
/**
|
|
220
|
-
* querySelectorAll
|
|
222
|
+
* querySelectorAll wrapper
|
|
221
223
|
* @param {element} el
|
|
222
224
|
* @param {string} sel selector string
|
|
223
225
|
* @returns {element[]} elements
|
|
224
226
|
* @memberof Core
|
|
225
227
|
*/
|
|
226
|
-
export declare function qsa(el: Document | Element, sel: string): NodeListOf<Element
|
|
228
|
+
export declare function qsa(el: Document | Element, sel: string): NodeListOf<Element>;
|
|
227
229
|
/**
|
|
228
230
|
* querySelector by property
|
|
229
231
|
* @param {element} el
|
package/dist/utils/hook.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare class Hook {
|
|
|
13
13
|
* Adds a function to be run before a hook completes
|
|
14
14
|
* @example this.content.register(function(){...});
|
|
15
15
|
*/
|
|
16
|
-
register(...
|
|
16
|
+
register(...args: any[]): void;
|
|
17
17
|
/**
|
|
18
18
|
* Removes a function
|
|
19
19
|
* @example this.content.deregister(function(){...});
|
|
@@ -23,7 +23,7 @@ declare class Hook {
|
|
|
23
23
|
* Triggers a hook to run all functions
|
|
24
24
|
* @example this.content.trigger(args).then(function(){...});
|
|
25
25
|
*/
|
|
26
|
-
trigger(...
|
|
26
|
+
trigger(...args: any[]): Promise<any[]>;
|
|
27
27
|
list(): Function[];
|
|
28
28
|
clear(): Function[];
|
|
29
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ParsedPath } from '../types';
|
|
2
|
-
export declare function resolve(...
|
|
2
|
+
export declare function resolve(...args: string[]): string;
|
|
3
3
|
export declare function relative(from: string, to: string): string;
|
|
4
4
|
export declare function dirname(path: string): string;
|
|
5
5
|
export declare function isAbsolute(path: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likecoin/epub-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "TypeScript EPUB parser and renderer, forked from epubjs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"epub",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"license": "BSD-2-Clause",
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "^9.39.2",
|
|
51
|
-
"@types/localforage": "0.0.34",
|
|
52
51
|
"eslint": "^9.39.2",
|
|
53
52
|
"jsdom": "^28.0.0",
|
|
54
53
|
"typedoc": "^0.28.16",
|
|
@@ -60,8 +59,6 @@
|
|
|
60
59
|
"vitest": "^3.0.5"
|
|
61
60
|
},
|
|
62
61
|
"dependencies": {
|
|
63
|
-
"
|
|
64
|
-
"jszip": "^3.7.1",
|
|
65
|
-
"localforage": "^1.10.0"
|
|
62
|
+
"jszip": "^3.10.1"
|
|
66
63
|
}
|
|
67
64
|
}
|