Skip to content

Tankōbon / preload / DataApi

Interface: DataApi ​

Defined in: preload.ts:180

JSON export and import of the library and settings, and clearing the library, as window.tankobon.data.

Methods ​

clearLibrary() ​

clearLibrary(): Promise<ClearLibraryResult>

Defined in: preload.ts:186

Empties 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.

Returns ​

Promise<ClearLibraryResult>


export() ​

export(): Promise<ExportResult>

Defined in: preload.ts:182

Opens 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.

Returns ​

Promise<ExportResult>


import() ​

import(): Promise<ImportResult>

Defined in: preload.ts:184

Opens a native file picker and merges the chosen JSON export into the local database.

Returns ​

Promise<ImportResult>


onChanged() ​

onChanged(listener): () => void

Defined in: preload.ts:188

Subscribes to the main process's data:changed push, sent after every database write (library, reading lists, settings); returns the unsubscribe function.

Parameters ​

listener ​

(change) => void

Returns ​

() => void