This document provides guidance for upgrading between major versions of streamdeck-ts.
No code changes.
The minimum required nodejs version is now v18.17.
No code changes.
The minimum required nodejs version is now v14.17.
The type of the row/column propperties in the payload for the keyUp
/ keyDown
, willAppear
/ willDisappear
and
didReceiveSettings
events got changed from number
to number | undefined
!
Code using these properties might have to be adjusted accordingly.
Most changes were made for ease of use by removing a lot of unnecessary imports (of classes and enums).
The all-in-one sendEvent methods were replaced by single methods for each event. Thus, explicitely creating the event classes is no longer necessary.
The payload params or order have changed for some methods! See the according part of the readme for details.
before:
plugin.sendEvent(new SetTitleEvent('the new title', context));
after:
plugin.setTitle('the new title', context);
When registering event listeners, now use the event names directly instead of the Enums:
before:
plugin.on(IncomingPluginEventsEnum.KeyDown, event => {
console.log(`key pressed on row ${event.row} and column ${event.column}`);
});
after:
plugin.on('keyDown', event => {
console.log(`key pressed on row ${event.row} and column ${event.column}`);
});
The Enum was replaced by the target names (string).
before:
plugin.sendEvent(new SetTitleEvent('the new title', context, TargetEnum.Both));
after:
plugin.setTitle('the new title', context, { target: 'both' }); // or 'hardware' or 'software'
The assertType export was removed without replacemeht, as it's not in the scope of this package to offer that. It can still be imported from the streamdeck-events package, but I suggest implementing that yourself.
The DeviceType export was removed from this package. It can now be imported from the streamdeck-events directly. Alternatively the typeName property can be used:
before:
plugin.on('deviceDidConnect', ({ type }) => {
if (type === DeviceType.StreamDeckMini) {
// do smth
}
});
after:
plugin.on('deviceDidConnect', ({ typeName }) => {
if (typeName === 'StreamDeckMini') {
// do smth
}
});
The following properties (on the Plugin and Propertyinspector classes) were changed:
-
plugin.context
-> replaced byplugin.pluginUUID
(before: string|null; now: string|undefined) -
plugin.action
-> replaced byplugin.info
-
plugin.pluginUUID
-> changed to return string|undefined instead of string|null