Inkdrop Database

Provides ways to access the local database for managing notes, notebooks, tags and images.

An instance of this class can be got via inkdrop.main.dataStore.getLocalDB().

Properties

notes

An instance of DBNote

books

An instance of DBBook

tags

An instance of DBTag

files

An instance of DBFile

utils

An instance of DBUtils

Event Subscription

onChange(callback)

Invoke the given callback when the database has been changed.

Argument Description
callback(change) A Function to be invoked.
change Object, indicating the changes feed.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

onNoteChange(callback)

Invoke the given callback when a note has been added, modified or deleted.

Argument Description
callback(change) A Function to be invoked.
change Object, indicating the changes feed.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

onBookChange(callback)

Invoke the given callback when a notebook has been added, modified or deleted.

Argument Description
callback(change) A Function to be invoked.
change Object, indicating the changes feed.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

onTagChange(callback)

Invoke the given callback when a tag has been added, modified or deleted.

Argument Description
callback(change) A Function to be invoked.
change Object, indicating the changes feed.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

onFullTextIndexBuildStart(callback)

Invoke the given callback when the app started building full-text search index.

Argument Description
callback() A Function to be invoked.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

onFullTextIndexBuildEnd(callback)

Invoke the given callback when the app finished building full-text search index.

Argument Description
callback() A Function to be invoked.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

onFullTextIndexBuildError(callback)

Invoke the given callback when the app failed to build full-text search index.

Argument Description
callback(error) A Function to be invoked.
error Error that was occurred.

Return values

Returns a Disposable on which .dispose() can be called to unsubscribe.

Can you help us improve these docs?

The source of these docs is here on GitHub. If you see a way these docs can be improved, please fork us!