Environment

Inkdrop global for dealing with packages, themes, menus, and the window.

An instance of this class is always available as the inkdrop global.

Properties

commands

A CommandRegistry instance

components

A ComponentManager instance

config

A Config instance

contextMenu

A ContextMenuManager instance

devMode

Boolean, true if Development Mode is enabled, false if disabled

element

A React root component

keymaps

A KeymapManager instance

layouts

A LayoutManager instance

main

A reference to an InkdropApplication instance in the main process

A MenuManager instance

notifications

A NotificationManager instance

packages

A PackageManager instance

resourcePath

A path to the app's bundled resource directory. For example, it is usually "/Applications/Inkdrop.app/Contents/Resources/app.asar" on macOS.

themes

A ThemeManager instance

styles

A StyleManager instance

store

A Redux store

window

A BrowserWindow instance of the current window

Event Subscription

onEditorLoad(callback)

Invoke the given callback when the editor has been loaded.

Argument Description
callback(editor) A Function to be invoked.
editor The MDE that was loaded.

Return values

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

onEditorUnload(callback)

Invoke the given callback when the editor has been unloaded.

Argument Description
callback() A Function to be invoked.

Return values

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

onAppReady(callback)

Invoke the given callback when the app is ready.

Argument Description
callback() A Function to be invoked.

Return values

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

onAppQuit(callback)

Invoke the given callback when the app is about to quit.

Argument Description
callback() A Function to be invoked.

Return values

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

Methods

isEditorActive()

Returns a Boolean indicating whether the editor is active.

getActiveEditor()

Returns an instance of MDE if the editor is active, otherwise undefined.

getActiveEditorOrThrowError()

Returns an instance of MDE if the editor is active, otherwise an error is thrown.

setActiveEditor(editor)

Set an instance of MDE which is currently active.

Argument Description
editor An instance of MDE

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!