Options
All
  • Public
  • Public/Protected
  • All
Menu

The main pluginContext parameter your plugin is passed when loaded

Example

'use strict';

module.exports = (pluginContext) => {
    const app = pluginContext.app;
    const toast = pluginContext.toast;
    const logger = pluginContext.logger;

    function startup() { ... }

    function search(query, res) { ... }

    function execute(id, payload, extra) {
        if (id === '1') {
            toast.enqueue('This is message', 1500);
        } else if (id == '2') {
            app.close();
        } else if (id == '3') {
            logger.log('this is log');
        }
    }

    return { startup, search, execute };
};

Properties

COMPATIBLE_API_VERSIONS: string[]

Array of API versions that are still compatible with current version

CURRENT_API_VERSION: string

Current version of the API that is available

DEV_PLUGIN_REPO: string

Directory of development plugins (local / manually installed)

INTERNAL_PLUGIN_REPO: string
MAIN_PLUGIN_REPO: string

Directory of hain managed plugins

___PLUGIN_PREINSTALL_DIR: string
___PLUGIN_PREUNINSTALL_FILE: string
app: App

Access to application functions

clipboard: Clipboard

Access to clipboard functions

globalPreferences: Preferences

Access to hain global preferences

indexer: Indexer

Access to hain plugin indexer

localStorage: PluginLocalStorage

Access to plugin local storage

logger: Logger

Access to logging functionality

matchUtil: MatchUtil

Access to matching utility functions

deprecated
preferences: Preferences

Access to plugin preferences

shell: Shell

Access to shell functionality

toast: Toaster

Access to toast functionality

Generated using TypeDoc