UNPKG

@elgato/streamdeck

Version:

The official Node.js SDK for creating Stream Deck plugins.

35 lines (34 loc) 1.15 kB
import { Event } from "./event.js"; /** * Provides information for an event relating to an action. */ export class ActionWithoutPayloadEvent extends Event { action; /** * Initializes a new instance of the {@link ActionWithoutPayloadEvent} class. * @param action Action that raised the event. * @param source Source of the event, i.e. the original message from Stream Deck. */ constructor(action, source) { super(source); this.action = action; } } /** * Provides information for an event relating to an action. */ export class ActionEvent extends ActionWithoutPayloadEvent { /** * Provides additional information about the event that occurred, e.g. how many `ticks` the dial was rotated, the current `state` of the action, etc. */ payload; /** * Initializes a new instance of the {@link ActionEvent} class. * @param action Action that raised the event. * @param source Source of the event, i.e. the original message from Stream Deck. */ constructor(action, source) { super(action, source); this.payload = source.payload; } }