Skip to content

Creating a Widget

Gabriel Enrico edited this page Mar 18, 2021 · 4 revisions

Differently from the Widget Guide, this is not to be a creation guide, but will rather show how to do DropMeter-specific stuff, such as Receiving Plugin messages; What to do and NOT to do; and Packaging.

Note that all JS on this guide will be using the ES6 Import/TypeScript Syntax

Receiving Plugin Messages

  1. Install the Widget SDK from npm

  2. Import the types from the Widget SDK:

import { DropMeter, PluginMessage } from "./DropMeter";
  1. Register your Plugin Message Handler (One for each plugin you are using):
(await DropMeter()).registerCallback(pluginId, (data: PluginMessage<MES, RET>)=> {
            console.log(data.messageID, data.data)
})

Packaging

SDK Version Range Manifest Documentation Final File Extension
1.0.0 -> Present The Universal Manifest .dmx
  1. Write a JSON Manifest File, named manifest.json. Documentation is available on the table above. If your build runner supports it set it to be copied to your build output.

    • Don't forget to run a build after doing it, to copy the file.
  2. Zip your build output. NOTE: make sure your files are at the root of the zip file. The final structure should look like:

    • MyPlugin.zip/manifest.json
    • MyPlugin.zip/index.html
    • MyPlugin.zip/{anyOtherFiles}
  3. Rename your ZIP file to have the Final File Extension, shown in the table above.

Clone this wiki locally