Tankōbon / main/services/cbr-archive / CbrArchive
Class: CbrArchive
Defined in: main/services/cbr-archive.ts:42
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: main/services/cbr-archive.ts:46
Total entries in the archive (not just image pages).
Implementation of
pages
readonlypages: readonlystring[]
Defined in: main/services/cbr-archive.ts:45
Image entry names, sorted in reading order.
Implementation of
path
readonlypath:string
Defined in: main/services/cbr-archive.ts:44
Implementation of
Methods
close()
close():
Promise<void>
Defined in: main/services/cbr-archive.ts:86
Nothing to release: the archive lives in memory.
Returns
Promise<void>
Implementation of
readPage()
readPage(
index):Promise<ComicPage>
Defined in: main/services/cbr-archive.ts:67
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: main/services/cbr-archive.ts:52
Reads and indexes the archive; throws when it holds no image.
Parameters
filePath
string
Returns
Promise<CbrArchive>