@papyrus-sdk/engine-epub 0.2.5 → 0.2.7

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/index.d.mts CHANGED
@@ -1,23 +1,46 @@
1
1
  import { BaseDocumentEngine } from '@papyrus-sdk/core';
2
- import { DocumentLoadInput, TextSelection, TextItem, OutlineItem, PageDestination } from '@papyrus-sdk/types';
2
+ import { DocumentLoadInput, PageDestination, TextSelection, TextItem, OutlineItem } from '@papyrus-sdk/types';
3
3
 
4
4
  declare class EPUBEngine extends BaseDocumentEngine {
5
5
  private book;
6
6
  private spineItems;
7
- private renditions;
8
- private renditionTargets;
7
+ private coverUrl;
8
+ private readerRendition;
9
+ private readerTarget;
9
10
  private pageSizes;
10
11
  private currentPage;
11
12
  private zoom;
12
13
  private rotation;
13
- getRenderTargetType(): 'element';
14
+ private heightSyncVersion;
15
+ private renderVersion;
16
+ private renderLock;
17
+ private pendingHrefDestination;
18
+ private destinationSequence;
19
+ private destinationCursor;
20
+ private lastDestinationNavTime;
21
+ private lastDestinationPageIndex;
22
+ private lastDestinationHref;
23
+ private static readonly A4_RATIO;
24
+ private static readonly USE_INTERNAL_IFRAME_SCROLL;
25
+ private static readonly MOBILE_VIEWPORT_MAX_WIDTH_PX;
26
+ private static readonly MOBILE_SHORT_VIEWPORT_MAX_HEIGHT_PX;
27
+ private static readonly INTERNAL_VIEWPORT_PADDING_PX;
28
+ private static readonly MAX_SECTION_HEIGHT;
29
+ private static readonly HEIGHT_PADDING;
30
+ getRenderTargetType(): "element";
14
31
  load(input: DocumentLoadInput): Promise<void>;
15
32
  getPageCount(): number;
16
33
  getCurrentPage(): number;
17
34
  goToPage(page: number): void;
35
+ goToDestination(dest: PageDestination): Promise<number | null>;
36
+ goToAdjacentDestination(delta: number): Promise<number | null>;
37
+ getDestinationNavigationState(): {
38
+ hasPrev: boolean;
39
+ hasNext: boolean;
40
+ };
18
41
  setZoom(zoom: number): void;
19
42
  getZoom(): number;
20
- rotate(direction: 'clockwise' | 'counterclockwise'): void;
43
+ rotate(direction: "clockwise" | "counterclockwise"): void;
21
44
  getRotation(): number;
22
45
  getPageDimensions(pageIndex: number): Promise<{
23
46
  width: number;
@@ -38,6 +61,30 @@ declare class EPUBEngine extends BaseDocumentEngine {
38
61
  private applyRenditionTheme;
39
62
  private getSpineIndexByHref;
40
63
  private normalizeHref;
64
+ private decodeHref;
65
+ private getSectionFromHref;
66
+ private getSpineItemForPage;
67
+ private getSpineIndexForSection;
68
+ private getPageIndexFromSection;
69
+ private isHrefMatchingSpineItem;
70
+ private uniqueDisplayTargets;
71
+ private getDisplayTargetsForSpineItem;
72
+ private normalizeDestinationKey;
73
+ private findDestinationIndexByHref;
74
+ private findNearestDestinationIndexByPage;
75
+ private ensureDestinationSequence;
76
+ private updateDestinationCursor;
77
+ private getSectionFromTarget;
78
+ private getPageIndexFromRenditionLocation;
79
+ private isNoSectionError;
80
+ private isTransientDisplayError;
81
+ private displayWithFallback;
82
+ private displayDestinationWithRetry;
83
+ private isDebugEnabled;
84
+ private debugLog;
85
+ private syncSectionHeight;
86
+ private resolvePageIndexFromHref;
87
+ private extractHrefDestination;
41
88
  private isUriSource;
42
89
  private isDataSource;
43
90
  private isFileLike;
@@ -48,6 +95,20 @@ declare class EPUBEngine extends BaseDocumentEngine {
48
95
  private decodeBase64;
49
96
  private looksLikeUri;
50
97
  private isLikelyBase64;
98
+ private createRendition;
99
+ private disposeReader;
100
+ private registerContentHook;
101
+ private scheduleHeightSync;
102
+ private getViewportHeightHint;
103
+ private getLinearSpineItems;
104
+ private hasCoverPage;
105
+ private isCoverPage;
106
+ private toSpineIndex;
107
+ private toPageIndexFromSpine;
108
+ private getA4MinHeight;
109
+ private renderCoverPage;
110
+ private isMobileViewport;
111
+ private getSingleImageForMobileLayout;
51
112
  }
52
113
 
53
114
  export { EPUBEngine };
package/dist/index.d.ts CHANGED
@@ -1,23 +1,46 @@
1
1
  import { BaseDocumentEngine } from '@papyrus-sdk/core';
2
- import { DocumentLoadInput, TextSelection, TextItem, OutlineItem, PageDestination } from '@papyrus-sdk/types';
2
+ import { DocumentLoadInput, PageDestination, TextSelection, TextItem, OutlineItem } from '@papyrus-sdk/types';
3
3
 
4
4
  declare class EPUBEngine extends BaseDocumentEngine {
5
5
  private book;
6
6
  private spineItems;
7
- private renditions;
8
- private renditionTargets;
7
+ private coverUrl;
8
+ private readerRendition;
9
+ private readerTarget;
9
10
  private pageSizes;
10
11
  private currentPage;
11
12
  private zoom;
12
13
  private rotation;
13
- getRenderTargetType(): 'element';
14
+ private heightSyncVersion;
15
+ private renderVersion;
16
+ private renderLock;
17
+ private pendingHrefDestination;
18
+ private destinationSequence;
19
+ private destinationCursor;
20
+ private lastDestinationNavTime;
21
+ private lastDestinationPageIndex;
22
+ private lastDestinationHref;
23
+ private static readonly A4_RATIO;
24
+ private static readonly USE_INTERNAL_IFRAME_SCROLL;
25
+ private static readonly MOBILE_VIEWPORT_MAX_WIDTH_PX;
26
+ private static readonly MOBILE_SHORT_VIEWPORT_MAX_HEIGHT_PX;
27
+ private static readonly INTERNAL_VIEWPORT_PADDING_PX;
28
+ private static readonly MAX_SECTION_HEIGHT;
29
+ private static readonly HEIGHT_PADDING;
30
+ getRenderTargetType(): "element";
14
31
  load(input: DocumentLoadInput): Promise<void>;
15
32
  getPageCount(): number;
16
33
  getCurrentPage(): number;
17
34
  goToPage(page: number): void;
35
+ goToDestination(dest: PageDestination): Promise<number | null>;
36
+ goToAdjacentDestination(delta: number): Promise<number | null>;
37
+ getDestinationNavigationState(): {
38
+ hasPrev: boolean;
39
+ hasNext: boolean;
40
+ };
18
41
  setZoom(zoom: number): void;
19
42
  getZoom(): number;
20
- rotate(direction: 'clockwise' | 'counterclockwise'): void;
43
+ rotate(direction: "clockwise" | "counterclockwise"): void;
21
44
  getRotation(): number;
22
45
  getPageDimensions(pageIndex: number): Promise<{
23
46
  width: number;
@@ -38,6 +61,30 @@ declare class EPUBEngine extends BaseDocumentEngine {
38
61
  private applyRenditionTheme;
39
62
  private getSpineIndexByHref;
40
63
  private normalizeHref;
64
+ private decodeHref;
65
+ private getSectionFromHref;
66
+ private getSpineItemForPage;
67
+ private getSpineIndexForSection;
68
+ private getPageIndexFromSection;
69
+ private isHrefMatchingSpineItem;
70
+ private uniqueDisplayTargets;
71
+ private getDisplayTargetsForSpineItem;
72
+ private normalizeDestinationKey;
73
+ private findDestinationIndexByHref;
74
+ private findNearestDestinationIndexByPage;
75
+ private ensureDestinationSequence;
76
+ private updateDestinationCursor;
77
+ private getSectionFromTarget;
78
+ private getPageIndexFromRenditionLocation;
79
+ private isNoSectionError;
80
+ private isTransientDisplayError;
81
+ private displayWithFallback;
82
+ private displayDestinationWithRetry;
83
+ private isDebugEnabled;
84
+ private debugLog;
85
+ private syncSectionHeight;
86
+ private resolvePageIndexFromHref;
87
+ private extractHrefDestination;
41
88
  private isUriSource;
42
89
  private isDataSource;
43
90
  private isFileLike;
@@ -48,6 +95,20 @@ declare class EPUBEngine extends BaseDocumentEngine {
48
95
  private decodeBase64;
49
96
  private looksLikeUri;
50
97
  private isLikelyBase64;
98
+ private createRendition;
99
+ private disposeReader;
100
+ private registerContentHook;
101
+ private scheduleHeightSync;
102
+ private getViewportHeightHint;
103
+ private getLinearSpineItems;
104
+ private hasCoverPage;
105
+ private isCoverPage;
106
+ private toSpineIndex;
107
+ private toPageIndexFromSpine;
108
+ private getA4MinHeight;
109
+ private renderCoverPage;
110
+ private isMobileViewport;
111
+ private getSingleImageForMobileLayout;
51
112
  }
52
113
 
53
114
  export { EPUBEngine };