API Reference

Spell Book works both in CEP and UXP platforms.

It consists of application and extension, which acts as a bridge between Spell Book app and your extension. Use npm modules, both for CEParrow-up-right and UXParrow-up-right, that provide interface for commands registration and handling command event.

Installation

Make sure that Spell Book is installed (both app and Spell Book extension).

Installation

npm install @knights-of-the-editing-table/spell-book

Usage

// code.js
import Spellbook from '@knights-of-the-editing-table/spell-book';

const commands = [
    {
        commandID: 'command.id',
        // name: use localised name if needed
        name: 'Command 1',
        // group: optional
        group: 'Group 1',
        // action runs when command is triggered
        action: () => { 
            console.log('command.id triggered!')
        }
    }
];

const spellbook = new Spellbook('Extension name', 'extension.id', commands);

Spellbook constructor

Methods

Events

The plugin extends EventEmitter and emits events when commands are triggered:

Last updated