UNPKG

@elgato/streamdeck

Version:

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

47 lines (46 loc) 2.31 kB
import type { IDisposable, JsonObject } from "@elgato/utils"; import { DidReceiveGlobalSettingsEvent, type DidReceiveSettingsEvent } from "./events/index.js"; export declare const settings: { /** * Available from Stream Deck 7.1; determines whether message identifiers should be sent when getting * action-instance or global settings. * * When `true`, the did-receive events associated with settings are only emitted when the action-instance * or global settings are changed in the property inspector. * @returns The value. */ useExperimentalMessageIdentifiers: boolean; /** * Gets the global settings associated with the plugin. * @template T The type of global settings associated with the plugin. * @returns Promise containing the plugin's global settings. */ getGlobalSettings: <T extends JsonObject = JsonObject>() => Promise<T>; /** * Occurs when the global settings are requested, or when the the global settings were updated in * the property inspector. * @template T The type of settings associated with the action. * @param listener Function to be invoked when the event occurs. * @returns A disposable that removes the listener. */ onDidReceiveGlobalSettings: <T extends JsonObject = JsonObject>(listener: (ev: DidReceiveGlobalSettingsEvent<T>) => void) => IDisposable; /** * Occurs when the settings associated with an action instance are requested, or when the the settings * were updated in the property inspector. * @template T The type of settings associated with the action. * @param listener Function to be invoked when the event occurs. * @returns A disposable that removes the listener. */ onDidReceiveSettings: <T extends JsonObject = JsonObject>(listener: (ev: DidReceiveSettingsEvent<T>) => void) => IDisposable; /** * Sets the global settings associated the plugin; these settings are only available to this plugin, * and should be used to persist information securely. * @param settings Settings to save. * @example * streamDeck.settings.setGlobalSettings({ * apiKey, * connectedDate: new Date() * }) */ setGlobalSettings: <T extends JsonObject>(settings: T) => Promise<void>; };