@elgato/streamdeck
Version:
The official Node.js SDK for creating Stream Deck plugins.
41 lines (40 loc) • 2.38 kB
TypeScript
import type { IDisposable, JsonObject } from "@elgato/utils";
import { type ApplicationDidLaunchEvent, type ApplicationDidTerminateEvent, DidReceiveDeepLinkEvent, type SystemDidWakeUpEvent } from "./events/index.js";
/**
* Occurs when a monitored application is launched. Monitored applications can be defined in the manifest via the {@link Manifest.ApplicationsToMonitor} property.
* See also {@link onApplicationDidTerminate}.
* @param listener Function to be invoked when the event occurs.
* @returns A disposable that, when disposed, removes the listener.
*/
export declare function onApplicationDidLaunch(listener: (ev: ApplicationDidLaunchEvent) => void): IDisposable;
/**
* Occurs when a monitored application terminates. Monitored applications can be defined in the manifest via the {@link Manifest.ApplicationsToMonitor} property.
* See also {@link onApplicationDidLaunch}.
* @param listener Function to be invoked when the event occurs.
* @returns A disposable that, when disposed, removes the listener.
*/
export declare function onApplicationDidTerminate(listener: (ev: ApplicationDidTerminateEvent) => void): IDisposable;
/**
* Occurs when a deep-link message is routed to the plugin from Stream Deck. One-way deep-link messages can be sent to plugins from external applications using the URL format
* `streamdeck://plugins/message/<PLUGIN_UUID>/{MESSAGE}`.
* @param listener Function to be invoked when the event occurs.
* @returns A disposable that, when disposed, removes the listener.
*/
export declare function onDidReceiveDeepLink(listener: (ev: DidReceiveDeepLinkEvent) => void): IDisposable;
/**
* Occurs when the computer wakes up.
* @param listener Function to be invoked when the event occurs.
* @returns A disposable that, when disposed, removes the listener.
*/
export declare function onSystemDidWakeUp(listener: (ev: SystemDidWakeUpEvent) => void): IDisposable;
/**
* Opens the specified `url` in the user's default browser.
* @param url URL to open.
* @returns `Promise` resolved when the request to open the `url` has been sent to Stream Deck.
*/
export declare function openUrl(url: string): Promise<void>;
/**
* Gets the secrets associated with the plugin.
* @returns `Promise` resolved with the secrets associated with the plugin.
*/
export declare function getSecrets<T extends JsonObject = JsonObject>(): Promise<T>;