import type { StreamDeckModelInfo } from './modelInfo.js'; import type { EventEmitter } from 'eventemitter3'; import type { DeviceModelId, Dimension, EncoderIndex, KeyIndex } from './id.js'; import type { HIDDeviceInfo } from './hid-device.js'; import type { StreamDeckButtonControlDefinition, StreamDeckControlDefinition, StreamDeckEncoderControlDefinition, StreamDeckLcdSegmentControlDefinition } from './controlDefinition.js'; import type { PreparedBuffer } from './preparedBuffer.js'; export interface StreamDeckTcpChildDeviceInfo extends HIDDeviceInfo { readonly model: DeviceModelId; readonly serialNumber: string; readonly tcpPort: number; } export interface FillImageOptions { format: 'rgb' | 'rgba' | 'bgr' | 'bgra'; } export interface FillPanelOptions extends FillImageOptions, FillPanelDimensionsOptions { } export interface FillPanelDimensionsOptions { withPadding?: boolean; } export interface FillLcdImageOptions extends FillImageOptions { width: number; height: number; } export interface LcdPosition { x: number; y: number; } export type StreamDeckEvents = { down: [control: StreamDeckButtonControlDefinition | StreamDeckEncoderControlDefinition]; up: [control: StreamDeckButtonControlDefinition | StreamDeckEncoderControlDefinition]; error: [err: unknown]; rotate: [control: StreamDeckEncoderControlDefinition, amount: number]; lcdShortPress: [control: StreamDeckLcdSegmentControlDefinition, position: LcdPosition]; lcdLongPress: [control: StreamDeckLcdSegmentControlDefinition, position: LcdPosition]; lcdSwipe: [control: StreamDeckLcdSegmentControlDefinition, from: LcdPosition, to: LcdPosition]; nfcRead: [id: string]; }; export interface StreamDeck extends EventEmitter { /** Information about the model of this device */ readonly modelInfo: StreamDeckModelInfo; /** * List of the controls on this streamdeck * @deprecated Use `modelInfo.controls` instead */ readonly CONTROLS: Readonly; /** * The model of this device * @deprecated Use `modelInfo.id` instead */ readonly MODEL: DeviceModelId; /** * The name of the product/model * @deprecated Use `modelInfo.name` instead */ readonly PRODUCT_NAME: string; /** * Whether this device has a nfc reader * @deprecated Use `modelInfo.features.nfcReader` instead */ readonly HAS_NFC_READER: boolean; /** * Calculate the dimensions to use for `fillPanelBuffer`, to fill the whole button lcd panel with a single image. * @param options Options to control the write * @returns The dimensions to use for the image, or null if there is no panel */ calculateFillPanelDimensions(options?: FillPanelDimensionsOptions): Dimension | null; /** * Close the device */ close(): Promise; /** * Get information about the underlying HID device */ getHidDeviceInfo(): Promise; /** * Send a prepared buffer operation * * @param {PreparedBuffer} buffer The prepared buffer to draw */ sendPreparedBuffer(buffer: PreparedBuffer): Promise; /** * Fills the given key with a solid color. * * @param {number} keyIndex The key to fill * @param {number} r The color's red value. 0 - 255 * @param {number} g The color's green value. 0 - 255 * @param {number} b The color's blue value. 0 -255 */ fillKeyColor(keyIndex: KeyIndex, r: number, g: number, b: number): Promise; /** * Fills the given key with an image in a Buffer. * * @param {number} keyIndex The key to fill * @param {Buffer} imageBuffer The image to write * @param {Object} options Options to control the write */ fillKeyBuffer(keyIndex: KeyIndex, imageBuffer: Uint8Array | Uint8ClampedArray, options?: FillImageOptions): Promise; /** * Prepare to fill the given key with an image in a Buffer. * Note: The result is only guaranteed to be valid for this specific StreamDeck and the same library version, but is safe to store externally. * * @param {number} keyIndex The key to fill * @param {Buffer} imageBuffer The image to write * @param {Object} options Options to control the write * @param {boolean} jsonSafe Whether the result should be packed to be safe to json serialize */ prepareFillKeyBuffer(keyIndex: KeyIndex, imageBuffer: Uint8Array | Uint8ClampedArray, options?: FillImageOptions, jsonSafe?: boolean): Promise; /** * Fills the whole panel with an image in a Buffer. * * @param {Buffer} imageBuffer The image to write * @param {Object} options Options to control the write */ fillPanelBuffer(imageBuffer: Uint8Array | Uint8ClampedArray, options?: FillPanelOptions): Promise; /** * Prepare to fill the whole panel with an image in a Buffer. * Note: The result is only guaranteed to be valid for this specific StreamDeck and the same library version, but is safe to store externally. * * @param {Buffer} imageBuffer The image to write * @param {Object} options Options to control the write * @param {boolean} jsonSafe Whether the result should be packed to be safe to json serialize */ prepareFillPanelBuffer(imageBuffer: Uint8Array | Uint8ClampedArray, options?: FillPanelOptions, jsonSafe?: boolean): Promise; /** * Fill the whole lcd segment * @param {number} lcdIndex The id of the lcd segment to draw to * @param {Buffer} imageBuffer The image to write * @param {Object} sourceOptions Options to control the write */ fillLcd(lcdIndex: number, imageBuffer: Uint8Array | Uint8ClampedArray, sourceOptions: FillImageOptions): Promise; /** * Fills the primary led of an encoder * @param {number} index The encoder to fill * @param {number} r The color's red value. 0 - 255 * @param {number} g The color's green value. 0 - 255 * @param {number} b The color's blue value. 0 -255 */ setEncoderColor(index: EncoderIndex, r: number, g: number, b: number): Promise; /** * Fills the led ring of an encoder with a single color * @param {number} index The encoder to fill * @param {number} r The color's red value. 0 - 255 * @param {number} g The color's green value. 0 - 255 * @param {number} b The color's blue value. 0 -255 */ setEncoderRingSingleColor(index: EncoderIndex, r: number, g: number, b: number): Promise; /** * Fill the led ring of an encoder * @param index The encoder to fill * @param colors rgb packed pixel values for the encoder ring */ setEncoderRingColors(index: EncoderIndex, colors: number[] | Uint8Array): Promise; /** * Fill a region of the lcd segment, ignoring the boundaries of the encoders * @param {number} lcdIndex The id of the lcd segment to draw to * @param {number} x The x position to draw to * @param {number} y The y position to draw to * @param {Buffer} imageBuffer The image to write * @param {Object} sourceOptions Options to control the write */ fillLcdRegion(lcdIndex: number, x: number, y: number, imageBuffer: Uint8Array, sourceOptions: FillLcdImageOptions): Promise; /** * Prepare to fill region of the lcd with an image in a Buffer. * Note: The result is only guaranteed to be valid for this specific StreamDeck and the same library version, but is safe to store externally. * * @param {number} lcdIndex The id of the lcd segment to draw to * @param {number} x The x position to draw to * @param {number} y The y position to draw to * @param {Buffer} imageBuffer The image to write * @param {Object} sourceOptions Options to control the write * @param {boolean} jsonSafe Whether the result should be packed to be safe to json serialize */ prepareFillLcdRegion(lcdIndex: number, x: number, y: number, imageBuffer: Uint8Array, sourceOptions: FillLcdImageOptions, jsonSafe?: boolean): Promise; /** * Clear the lcd segment to black * @param {number} lcdIndex The id of the lcd segment to clear */ clearLcdSegment(lcdIndex: number): Promise; /** * Clears the given key. * * @param {number} keyIndex The key to clear */ clearKey(keyIndex: KeyIndex): Promise; /** * Clears all keys. */ clearPanel(): Promise; /** * Sets the brightness of the keys on the Stream Deck * * @param {number} percentage The percentage brightness */ setBrightness(percentage: number): Promise; /** * Resets the display to the startup logo */ resetToLogo(): Promise; /** * Get firmware version from Stream Deck */ getFirmwareVersion(): Promise; /** * Get all the firmware versions from a Stream Deck * Some models have secondary firmware blobs * The exact names of these varies per model and hardware revision */ getAllFirmwareVersions(): Promise>; /** * Get serial number from Stream Deck */ getSerialNumber(): Promise; /** * Get information about a child device connected to this Stream Deck, if any is connected * Note: This is only available for the Stream Deck Studio, but is safe to call for other models */ getChildDeviceInfo(): Promise; } //# sourceMappingURL=types.d.ts.map