package.json
package.json tells Freedeck how to handle your package (duh), but also retains full compatibility with NPM.
Here’s the most basic package Freedeck will allow:
plugin.js
This file can be named whatever you want, only it must be specified in the main part of the package. Here’s a bare minimum implementation that is required for a Plugin to load.Events? This? Register?
This is the PluginV2 API which is an extension of the legacy Plugin structure left over from before v6.0.0-rc1 . The Plugin works on a registry like structure, you give the server your data, request intents, subscribe to events, and it forwards events made for you back to you. Currently, there is no deny procedure for requesting intents, but the server does block parts of your plugin that extend their reach without requesting it (like the IO intent for access to the server, and SOCKET intent for the individual connection.)Type Registry
To actually display types, you must go through the Type Registry.Type vs Interaction
They are used interchangably. A type is an interaction, therefore an interaction is a type. A more concrete definition of a type is: having some data you specify, that Freedeck can display as a configurable tile, that the user can interact with and fire events back and forth. There are multiple render types, with more coming soon.Display
The display field of an interaction will be shown in the Tile Editor.Type
The type field of an interaction is simply a unique identifier.Template Data
Tiles store information, and can store your custom information too. Template data is not used by Freedeck unless you have a slider type, which some fields are required.Render Types
Render types describe how to actually render your tile.button
The button is the simplest, the default, and the original concept Freedeck bases itself on. Press it, your event handler will receive an event back, and you can handle the rest.slider
The slider is the most complex tile type, sending multiple “press” events as the value changes slid by the user. This type requires templateData.Events
Events are simply events that you can subscribe to and receive. There are a few currently,connection, button, ready, stopping, stopped.