@blackmagic-controller/core
Version:
An npm module for interfacing with the Blackmagic usb/bluetooth controllers
49 lines • 2.94 kB
TypeScript
import { EventEmitter } from 'eventemitter3';
import type { HIDDevice, HIDDeviceInfo } from '../hid-device.js';
import type { DeviceModelId, KeyId } from '../id.js';
import type { BlackmagicController, BlackmagicControllerEvents, BlackmagicControllerSetButtonColorValue } from '../types.js';
import type { BlackmagicControllerButtonControlDefinition, BlackmagicControllerControlDefinition, BlackmagicControllerTBarControlDefinition } from '../controlDefinition.js';
import type { PropertiesService } from '../services/properties/interface.js';
import type { CallbackHook } from '../services/callback-hook.js';
import type { BlackmagicControllerInputService } from '../services/input/interface.js';
import type { BlackmagicControllerLedService } from '../services/led/interface.js';
export type EncodeJPEGHelper = (buffer: Uint8Array, width: number, height: number) => Promise<Uint8Array>;
export type OpenBlackmagicControllerOptions = Record<string, never>;
export interface OpenBlackmagicControllerOptionsInternal {
nextAuthMaxDelay: number | null;
authenticate: ((device: HIDDevice) => Promise<number>) | null;
}
export type BlackmagicControllerProperties = Readonly<{
MODEL: DeviceModelId;
PRODUCT_NAME: string;
CONTROLS: Readonly<BlackmagicControllerControlDefinition[]>;
}>;
export interface BlackmagicControllerServicesDefinition {
deviceProperties: BlackmagicControllerProperties;
events: CallbackHook<BlackmagicControllerEvents>;
properties: PropertiesService;
inputService: BlackmagicControllerInputService;
led: BlackmagicControllerLedService;
}
export declare class BlackmagicControllerBase extends EventEmitter<BlackmagicControllerEvents> implements BlackmagicController {
#private;
get CONTROLS(): Readonly<BlackmagicControllerControlDefinition[]>;
get MODEL(): DeviceModelId;
get PRODUCT_NAME(): string;
protected readonly device: HIDDevice;
protected readonly deviceProperties: Readonly<BlackmagicControllerProperties>;
constructor(device: HIDDevice, options: OpenBlackmagicControllerOptionsInternal, services: BlackmagicControllerServicesDefinition);
protected checkValidKeyId(keyId: KeyId, feedbackType: BlackmagicControllerButtonControlDefinition['feedbackType'] | null): BlackmagicControllerButtonControlDefinition;
protected checkValidTbarIndex(id: number): BlackmagicControllerTBarControlDefinition;
close(): Promise<void>;
getHidDeviceInfo(): Promise<HIDDeviceInfo>;
getBatteryLevel(): Promise<number | null>;
getFirmwareVersion(): Promise<string>;
getSerialNumber(): Promise<string>;
setButtonColor(keyId: KeyId, red: boolean, green: boolean, blue: boolean): Promise<void>;
setButtonColors(values: BlackmagicControllerSetButtonColorValue[]): Promise<void>;
setTbarLeds(leds: boolean[]): Promise<void>;
clearKey(keyId: KeyId): Promise<void>;
clearPanel(): Promise<void>;
}
//# sourceMappingURL=base.d.ts.map