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 CEP and UXP, 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-bookUsage
// 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);Make sure that Spell Book is installed (both app and Spell Book extension).
Installation
Usage
Add command entrypoint and enablePluginCommunication to manifest.json, for Inter Plugin Communication:
Add Spell Book plugin:
Spellbook constructor
Methods
Events
The plugin extends EventEmitter and emits events when commands are triggered:
Last updated