Interface: ComicApi ​
Defined in: src/preload.ts:71
Opening and reading comics, as window.tankobon.comic.
Methods ​
close() ​
close(
id):Promise<void>
Defined in: src/preload.ts:84
Closes a comic opened with open, releasing its archive in the main process.
Parameters ​
id ​
string
Returns ​
Promise<void>
open() ​
open(
ref):Promise<OpenComicResult>
Defined in: src/preload.ts:80
Opens a comic and registers it in the library (or refreshes its entry); resolves with its saved page. ref is a library entry id or a token from pickFile, never a path. A file that can't be opened (moved, deleted, corrupted, unsupported) resolves to an error result with a message in the interface language, rather than rejecting.
Parameters ​
ref ​
string
Returns ​
Promise<OpenComicResult>
pickFile() ​
pickFile(
addToLibrary):Promise<string|null>
Defined in: src/preload.ts:75
Opens a native file picker; resolves to an opaque token for the chosen file (to pass to open), or null if cancelled. The renderer never learns the path. addToLibrary is true for the library's "add a file" (opening the token then always adds the book) and false for the reader's "open a file" (the book is added only if the addOpenedBooksToLibrary setting is on).
Parameters ​
addToLibrary ​
boolean
Returns ​
Promise<string | null>
readPage() ​
readPage(
id,index):Promise<ComicPage>
Defined in: src/preload.ts:82
Reads one page (0-based) of a comic opened with open, as image bytes.
Parameters ​
id ​
string
index ​
number
Returns ​
Promise<ComicPage>