Skip to content

IPC channels ​

Every channel between the renderer and the main process, from the *_CHANNELS constants in src/main/ipc/ and the window.tankobon API in src/preload.ts (whose type is TankobonApi).

ChannelDirectionPreload APIHandlerDescription
achievements:listrenderer → main (invoke)window.tankobon.achievements.listACHIEVEMENT_CHANNELS.list in src/main/ipc/achievements.tsEvery achievement earned so far, with the moment it was earned.
achievements:unlockrenderer → main (invoke)window.tankobon.achievements.unlockACHIEVEMENT_CHANNELS.unlock in src/main/ipc/achievements.tsRecords achievements as earned (the renderer evaluates the rules); ones already earned are left as they are, an unknown id is refused. Resolves with those that are new, which data:changed announces too.
app:check-updaterenderer → main (invoke)window.tankobon.app.checkUpdateAPP_CHANNELS.checkUpdate in src/main/ipc/app.tsAsks GitHub whether a release newer than the running version is published; a network failure comes back as an error result, not a rejection.
app:get-inforenderer → main (invoke)window.tankobon.app.getInfoAPP_CHANNELS.getInfo in src/main/ipc/app.tsVersions of the app, Electron, Chromium, Node.js and V8, and the OS and CPU architecture.
app:get-system-languagesrenderer → main (invoke)window.tankobon.app.getSystemLanguagesAPP_CHANNELS.getSystemLanguages in src/main/ipc/app.tsThe OS's preferred languages (BCP 47 tags, most preferred first), to resolve the system language setting as the main process does.
app:launch-filemain → renderer (push)window.tankobon.app.onLaunchFileAPP_CHANNELS.launchFile in src/main/ipc/app.tsSubscribes to the main process's app:launch-file push, sent when such a comic is waiting (call takeLaunchFile then); returns the unsubscribe function.
app:open-linkrenderer → main (invoke)window.tankobon.app.openLinkAPP_CHANNELS.openLink in src/main/ipc/app.tsOpens one of the project's pages (repository, documentation…) in the default browser.
app:take-launch-filerenderer → main (invoke)window.tankobon.app.takeLaunchFileAPP_CHANNELS.takeLaunchFile in src/main/ipc/app.tsThe token of the comic the operating system asked to open (double click in the file explorer, "Open with…", a second launch with a file), or null; it is handed out once and opens like a comic.pickFile token.
comic:closerenderer → main (invoke)window.tankobon.comic.closeCOMIC_CHANNELS.close in src/main/ipc/comic.tsCloses a comic opened with open, releasing its archive in the main process.
comic:openrenderer → main (invoke)window.tankobon.comic.openCOMIC_CHANNELS.open in src/main/ipc/comic.tsOpens 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.
comic:pick-filerenderer → main (invoke)window.tankobon.comic.pickFileCOMIC_CHANNELS.pickFile in src/main/ipc/comic.tsOpens 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).
comic:read-pagerenderer → main (invoke)window.tankobon.comic.readPageCOMIC_CHANNELS.readPage in src/main/ipc/comic.tsReads one page (0-based) of a comic opened with open, as image bytes.
data:changedmain → renderer (push)window.tankobon.data.onChangedDATA_CHANGE_CHANNELS.changed in src/main/ipc/data-changes.tsSubscribes to the main process's data:changed push, sent after every database write (library, reading lists, settings); returns the unsubscribe function.
data:clear-libraryrenderer → main (invoke)window.tankobon.data.clearLibraryDATA_CHANNELS.clearLibrary in src/main/ipc/data.tsEmpties the library (entries, credits, people) and deletes every reading list and cover thumbnail; the comic files and the settings are left untouched. A failure comes back as an error result.
data:exportrenderer → main (invoke)window.tankobon.data.exportDATA_CHANNELS.export in src/main/ipc/data.tsOpens a native save dialog and writes a JSON export there; an error (full or read-only disk…) comes back as a result, not a rejection.
data:importrenderer → main (invoke)window.tankobon.data.importDATA_CHANNELS.import in src/main/ipc/data.tsOpens a native file picker and merges the chosen JSON export into the local database.
database:choose-locationrenderer → main (invoke)window.tankobon.database.chooseLocationDATABASE_CHANNELS.chooseLocation in src/main/ipc/database.tsOpens a native directory picker; the new location only takes effect on the next start.
database:get-locationrenderer → main (invoke)window.tankobon.database.getLocationDATABASE_CHANNELS.getLocation in src/main/ipc/database.tsWhere the database file currently lives.
database:relaunchrenderer → main (invoke)window.tankobon.database.relaunchDATABASE_CHANNELS.relaunch in src/main/ipc/database.tsRestarts the app, e.g. to open the database from its new location.
database:reset-locationrenderer → main (invoke)window.tankobon.database.resetLocationDATABASE_CHANNELS.resetLocation in src/main/ipc/database.tsPoints the app back at the default location; takes effect on the next start.
library:add-filerenderer → main (invoke)window.tankobon.library.addFileLIBRARY_CHANNELS.addFile in src/main/ipc/library.tsOpens a native file picker, then adds the chosen comic to the library without opening it; an unreadable file resolves to an error result rather than rejecting. The library organization then moves it, or offers to (organization).
library:add-folderrenderer → main (invoke)window.tankobon.library.addFolderLIBRARY_CHANNELS.addFolder in src/main/ipc/library.tsOpens a native directory picker, then adds every comic found under it, recursively. The library organization then moves them, or offers to (organization).
library:count-unorganizedrenderer → main (invoke)window.tankobon.library.countUnorganizedLIBRARY_CHANNELS.countUnorganized in src/main/ipc/library.tsHow many library comics aren't in their place in the organized folder yet; an error result when the organization is off or its folder unreachable.
library:image-scan-progressmain → renderer (push)window.tankobon.library.onImageScanProgressLIBRARY_CHANNELS.imageScanProgress in src/main/ipc/library.tsSubscribes to the progress of that background measure; returns the unsubscribe function.
library:image-scan-statusrenderer → main (invoke)window.tankobon.library.imageScanStatusLIBRARY_CHANNELS.imageScanStatus in src/main/ipc/library.tsWhere the background measure of the books' page sizes is now (it runs after an import, a resync or the first opening of a book); resolves with the state a window that loads late missed.
library:listrenderer → main (invoke)window.tankobon.library.listLIBRARY_CHANNELS.list in src/main/ipc/library.tsEvery library entry, most recently opened first.
library:list-foldersrenderer → main (invoke)window.tankobon.library.listFoldersLIBRARY_CHANNELS.listFolders in src/main/ipc/library.tsThe folders added with addFolder, which resync walks again, in the order they were added.
library:list-unlinked-foldersrenderer → main (invoke)window.tankobon.library.listUnlinkedFoldersLIBRARY_CHANNELS.listUnlinkedFolders in src/main/ipc/library.tsThe library folders that have no path on this machine yet (the library was made on another one): their comics are listed but their files can't be found until relinkFolder.
library:organizerenderer → main (invoke)window.tankobon.library.organizeLIBRARY_CHANNELS.organize in src/main/ipc/library.tsMoves into the organized folder the comics an addition offered to move (organization.pending.token of its result), each into its own subfolder; a token works once.
library:organize-allrenderer → main (invoke)window.tankobon.library.organizeAllLIBRARY_CHANNELS.organizeAll in src/main/ipc/library.tsMoves every library comic not in its place yet into the organized folder (its own subfolder each), whenever it was added. Reports through onScanProgress; an error result when the organization is off, its folder unreachable, or a resynchronization or another organization is running.
library:pick-organization-folderrenderer → main (invoke)window.tankobon.library.pickOrganizationFolderLIBRARY_CHANNELS.pickOrganizationFolder in src/main/ipc/library.tsOpens a native directory picker and makes the chosen folder the library organization's folder (the libraryOrganizationFolder setting, which settings.set refuses), also remembered among the folders resync walks.
library:relink-folderrenderer → main (invoke)window.tankobon.library.relinkFolderLIBRARY_CHANNELS.relinkFolder in src/main/ipc/library.tsOpens a native directory picker to say where an unlinked folder (an id returned by listUnlinkedFolders) is on this machine; the comics stored relative to it are found again.
library:removerenderer → main (invoke)window.tankobon.library.removeLIBRARY_CHANNELS.remove in src/main/ipc/library.tsRemoves an entry from the library; the file on disk is left untouched.
library:remove-folderrenderer → main (invoke)window.tankobon.library.removeFolderLIBRARY_CHANNELS.removeFolder in src/main/ipc/library.tsForgets one of those folders (a path returned by listFolders); its comics stay in the library.
library:resyncrenderer → main (invoke)window.tankobon.library.resyncLIBRARY_CHANNELS.resync in src/main/ipc/library.tsWalks the remembered folders (and the organized folder, when the organization is on) again: new comics are added (then moved or offered by the organization, a comic dropped in the organized folder being moved into place), and comics whose file no longer exists are removed from the library (with their progress, rating, tags and reading-list places; the files on disk are never touched). A folder that can't be read is skipped and counted as unreachable. Stores the date as the lastResyncAt setting. Reports through onScanProgress; an error result when one is already running.
library:scan-progressmain → renderer (push)window.tankobon.library.onScanProgressLIBRARY_CHANNELS.scanProgress in src/main/ipc/library.tsSubscribes to the progress of addFolder, resync and organizeAll; returns the unsubscribe function.
library:thumbnailrenderer → main (invoke)window.tankobon.library.thumbnailLIBRARY_CHANNELS.thumbnail in src/main/ipc/library.tsCover thumbnail (first page, shrunk) of a library entry as WebP bytes, generated and cached first when missing; null if the entry is unknown or unreadable.
library:update-metadatarenderer → main (invoke)window.tankobon.library.updateMetadataLIBRARY_CHANNELS.updateMetadata in src/main/ipc/library.tsWrites the given metadata fields (title, series, credits…) of a library entry; resolves with the updated entry, or null if it is gone.
library:update-progressrenderer → main (invoke)window.tankobon.library.updateProgressLIBRARY_CHANNELS.updateProgress in src/main/ipc/library.tsSaves the last page read (0-based) of a library entry.
library:update-ratingrenderer → main (invoke)window.tankobon.library.updateRatingLIBRARY_CHANNELS.updateRating in src/main/ipc/library.tsSets the rating of a library entry: 0 (unrated) to 5.
library:update-tagsrenderer → main (invoke)window.tankobon.library.updateTagsLIBRARY_CHANNELS.updateTags in src/main/ipc/library.tsReplaces the tags of a library entry.
metadata:from-pagerenderer → main (invoke)window.tankobon.metadata.fromPageMETADATA_CHANNELS.fromPage in src/main/ipc/metadata.tsReads a book from the Bédéthèque album page at url, a link the user pasted.
metadata:searchrenderer → main (invoke)window.tankobon.metadata.searchMETADATA_CHANNELS.search in src/main/ipc/metadata.tsLooks a book up in the public APIs enabled in the settings (Comic Vine, Google Books).
reading-lists:add-entriesrenderer → main (invoke)window.tankobon.readingLists.addEntriesREADING_LIST_CHANNELS.addEntries in src/main/ipc/reading-lists.tsAppends several library entries to a reading list, in the order given: books already in it are skipped, and once it holds 50 books the rest are left out (the result counts each case).
reading-lists:add-entryrenderer → main (invoke)window.tankobon.readingLists.addEntryREADING_LIST_CHANNELS.addEntry in src/main/ipc/reading-lists.tsAppends a library entry to a reading list; refused when the list already holds 50 books.
reading-lists:createrenderer → main (invoke)window.tankobon.readingLists.createREADING_LIST_CHANNELS.create in src/main/ipc/reading-lists.tsCreates an empty reading list; refused when the name is empty.
reading-lists:listrenderer → main (invoke)window.tankobon.readingLists.listREADING_LIST_CHANNELS.list in src/main/ipc/reading-lists.tsEvery reading list, in the user's order (new lists last), each with its library entry ids in reading order.
reading-lists:removerenderer → main (invoke)window.tankobon.readingLists.removeREADING_LIST_CHANNELS.remove in src/main/ipc/reading-lists.tsDeletes a reading list; its books stay in the library.
reading-lists:remove-entryrenderer → main (invoke)window.tankobon.readingLists.removeEntryREADING_LIST_CHANNELS.removeEntry in src/main/ipc/reading-lists.tsTakes a library entry out of a reading list.
reading-lists:renamerenderer → main (invoke)window.tankobon.readingLists.renameREADING_LIST_CHANNELS.rename in src/main/ipc/reading-lists.tsRenames a reading list; refused when the name is empty.
reading-lists:reorderrenderer → main (invoke)window.tankobon.readingLists.reorderREADING_LIST_CHANNELS.reorder in src/main/ipc/reading-lists.tsStores a new order for a reading list; entryIds must hold exactly the list's current entries.
reading-lists:reorder-listsrenderer → main (invoke)window.tankobon.readingLists.reorderListsREADING_LIST_CHANNELS.reorderLists in src/main/ipc/reading-lists.tsStores a new order for the reading lists themselves; listIds must hold exactly the current lists.
settings:get-allrenderer → main (invoke)window.tankobon.settings.getAllSETTINGS_CHANNELS.getAll in src/main/ipc/settings.tsEvery setting except the API keys, with defaults for the ones never stored.
settings:get-api-keysrenderer → main (invoke)window.tankobon.settings.getApiKeysSETTINGS_CHANNELS.getApiKeys in src/main/ipc/settings.tsThe metadata sources' API keys, kept out of getAll() so only the page that edits them loads them.
settings:setrenderer → main (invoke)window.tankobon.settings.setSETTINGS_CHANNELS.set in src/main/ipc/settings.tsStores one setting; the main process refuses an unknown key or a value its validator rejects.
stats:add-reading-timerenderer → main (invoke)window.tankobon.stats.addReadingTimeSTATS_CHANNELS.addReadingTime in src/main/ipc/stats.tsAdds seconds (1 to 3600) of reading time on a library entry to today; the reader reports it every few minutes while a book is open.
stats:clear-historyrenderer → main (invoke)window.tankobon.stats.clearHistorySTATS_CHANNELS.clearHistory in src/main/ipc/stats.tsDeletes the active user's reading history (the time spent per book and day, hence the statistics' reading time too); books, progress and completion dates are kept.
stats:getrenderer → main (invoke)window.tankobon.stats.getSTATS_CHANNELS.get in src/main/ipc/stats.tsThe reading history: the dates at which books were finished and the reading time per day, oldest first.
stats:historyrenderer → main (invoke)window.tankobon.stats.historySTATS_CHANNELS.history in src/main/ipc/stats.tsThe active user's reading history for the profile page: reading time per day and book, most recent first, at most 200 lines.
users:createrenderer → main (invoke)window.tankobon.users.createUSER_CHANNELS.create in src/main/ipc/users.tsAdds a user (nickname trimmed, not empty, unique ignoring case) with the default picture; it doesn't switch to them.
users:listrenderer → main (invoke)window.tankobon.users.listUSER_CHANNELS.list in src/main/ipc/users.tsEvery user and the active one's id.
users:pick-avatarrenderer → main (invoke)window.tankobon.users.pickAvatarUSER_CHANNELS.pickAvatar in src/main/ipc/users.tsOpens a native picker for the active user's picture and returns the picked file's bytes (a PNG, JPEG or WebP), for the renderer to shrink before setAvatar().
users:removerenderer → main (invoke)window.tankobon.users.removeUSER_CHANNELS.remove in src/main/ipc/users.tsDeletes the active user and all their personal data (progress, ratings, tags, lists, statistics, achievements, settings); the library is untouched. Refused for the last remaining user. On success the result is the user the app switched to.
users:remove-avatarrenderer → main (invoke)window.tankobon.users.removeAvatarUSER_CHANNELS.removeAvatar in src/main/ipc/users.tsPuts the active user's default picture back.
users:renamerenderer → main (invoke)window.tankobon.users.renameUSER_CHANNELS.rename in src/main/ipc/users.tsChanges the active user's nickname.
users:set-avatarrenderer → main (invoke)window.tankobon.users.setAvatarUSER_CHANNELS.setAvatar in src/main/ipc/users.tsStores the active user's picture (PNG, JPEG or WebP of at most 256 KiB).
users:switchrenderer → main (invoke)window.tankobon.users.switchUSER_CHANNELS.switch in src/main/ipc/users.tsMakes another user the active one: everything personal, and the interface language, follow. data:changed announces it to every window.