UNPKG

@elgato/streamdeck

Version:

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

89 lines (88 loc) 2.59 kB
import { I18nProvider } from "@elgato/utils/i18n"; import { actionService } from "./actions/service.js"; import { connection } from "./connection.js"; import { deviceService } from "./devices/service.js"; import { fileSystemLocaleProvider } from "./i18n.js"; import { logger } from "./logging/index.js"; import * as profiles from "./profiles.js"; import { settings } from "./settings.js"; import * as system from "./system.js"; import { ui } from "./ui.js"; export { BarSubType, DeviceType, Target, } from "../api/index.js"; export * from "./actions/index.js"; export * from "./devices/index.js"; export {}; let i18n; export const streamDeck = { /** * Namespace for event listeners and functionality relating to Stream Deck actions. * @returns Actions namespace. */ get actions() { return actionService; }, /** * Namespace for interacting with Stream Deck devices. * @returns Devices namespace. */ get devices() { return deviceService; }, /** * Internalization provider, responsible for managing localizations and translating resources. * @returns Internalization provider. */ get i18n() { return (i18n ??= new I18nProvider(this.info.application.language, fileSystemLocaleProvider)); }, /** * Registration and application information provided by Stream Deck during initialization. * @returns Registration information. */ get info() { return connection.registrationParameters.info; }, /** * Logger responsible for capturing log messages. * @returns The logger. */ get logger() { return logger; }, /** * Namespace for Stream Deck profiles. * @returns Profiles namespace. */ get profiles() { return profiles; }, /** * Namespace for persisting settings within Stream Deck. * @returns Settings namespace. */ get settings() { return settings; }, /** * Namespace for interacting with, and receiving events from, the system the plugin is running on. * @returns System namespace. */ get system() { return system; }, /** * Namespace for interacting with UI (property inspector) associated with the plugin. * @returns UI namespace. */ get ui() { return ui; }, /** * Connects the plugin to the Stream Deck. * @returns A promise resolved when a connection has been established. */ connect() { return connection.connect(); }, }; export default streamDeck;