refactor(reader): add supporting changes for pagination system
Supporting updates for the new page-based pagination architecture: settings-manager.ts: - Export loadSettings function for use in reader initialization - Allow external modules to access user reading preferences gestures.ts: - Update import paths for panel detection modules - Reflect new format-specific directory structure types/reader.d.ts: - Add saved_progress field to ReaderMetadata interface - Include current_page, cfi, and progress fields - Enable type-safe access to restored reading position These changes enable the pagination system to access user settings and properly type restored progress data.
This commit is contained in:
@@ -52,7 +52,7 @@ export function init(context: ReaderContext): void {
|
||||
});
|
||||
}
|
||||
|
||||
async function loadSettings(): Promise<ReaderSettings> {
|
||||
export async function loadSettings(): Promise<ReaderSettings> {
|
||||
const token = getToken();
|
||||
if (!token) {
|
||||
const local = localStorage.getItem(LOCALSTORAGE_KEY);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Panel } from "../comic/panel-detector";
|
||||
import { detectPanels } from "../comic/panel-detection.service";
|
||||
import type { Panel } from "../formats/comic/panel-detector";
|
||||
import { detectPanels } from "../formats/comic/panel-detection.service";
|
||||
import type { ReaderContext } from "../core/reader-context";
|
||||
|
||||
let currentPanelIndex = 0;
|
||||
|
||||
Vendored
+5
@@ -84,6 +84,11 @@ interface ReaderMetadata {
|
||||
file_path: string;
|
||||
chapter_metadata?: ChapterMetadata;
|
||||
total_pages?: number;
|
||||
saved_progress?: {
|
||||
current_page?: number;
|
||||
cfi?: string;
|
||||
progress?: number;
|
||||
};
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user