feat: Reader working, some work still need to be done

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-17 12:02:56 +01:00
parent 33f5a5568a
commit 668702b1fb
20 changed files with 994 additions and 127 deletions

View File

@@ -0,0 +1,30 @@
// Port (interface) for reader data access
export class ReaderRepository {
/**
* Récupère le contexte d'un chapitre
* @param {string} chapterId - L'identifiant du chapitre
* @returns {Promise<ReaderContext>}
*/
async getChapterContext(chapterId) {
throw new Error('Not implemented');
}
/**
* Récupère une page spécifique d'un chapitre
* @param {string} chapterId - L'identifiant du chapitre
* @param {number} pageNumber - Le numéro de la page
* @returns {Promise<Page>}
*/
async getPage(chapterId, pageNumber) {
throw new Error('Not implemented');
}
/**
* Récupère toutes les pages d'un chapitre
* @param {string} chapterId - L'identifiant du chapitre
* @returns {Promise<{pages: Page[], totalItems: number, currentPage: number, itemsPerPage: number, totalPages: number}>}
*/
async getPages(chapterId) {
throw new Error('Not implemented');
}
}

View File

@@ -0,0 +1,19 @@
export class ReaderContext {
constructor(id, title, number, manga, navigation) {
this.id = id;
this.title = title;
this.number = number;
this.manga = manga;
this.navigation = navigation;
}
}
export class Page {
constructor(id, pageNumber, base64Content, mimeType, dimensions) {
this.id = id;
this.pageNumber = pageNumber;
this.base64Content = base64Content;
this.mimeType = mimeType;
this.dimensions = dimensions;
}
}