Skeudenn / main/services/cbr-archive / CbrArchive
Class: CbrArchive ​
Defined in: src/main/services/cbr-archive.ts:54
A .cbr (RAR) comic, read with node-unrar-js (unrar compiled to WebAssembly). The whole file is loaded in memory when opened.
Implements ​
Properties ​
fileCount ​
readonlyfileCount:number
Defined in: src/main/services/cbr-archive.ts:58
Total entries in the archive (not just image pages).
Implementation of ​
pages ​
readonlypages: readonlystring[]
Defined in: src/main/services/cbr-archive.ts:57
Image entry names, sorted in reading order.
Implementation of ​
path ​
readonlypath:string
Defined in: src/main/services/cbr-archive.ts:56
Implementation of ​
Methods ​
close() ​
close():
Promise<void>
Defined in: src/main/services/cbr-archive.ts:98
Nothing to release: the archive lives in memory.
Returns ​
Promise<void>
Implementation of ​
readPage() ​
readPage(
index):Promise<ComicPage>
Defined in: src/main/services/cbr-archive.ts:79
Extracts page index (0-based); throws a RangeError when out of range.
Parameters ​
index ​
number
Returns ​
Promise<ComicPage>
Implementation of ​
open() ​
staticopen(filePath):Promise<CbrArchive>
Defined in: src/main/services/cbr-archive.ts:64
Reads and indexes the archive; throws when it holds no image.
Parameters ​
filePath ​
string
Returns ​
Promise<CbrArchive>