UNPKG

@ginden/blinkstick-v2

Version:
83 lines 2.38 kB
import { MinimalDeviceInfo } from '../transport'; /** * @summary Type used to describe a Blinkstick device. * @category Constants */ export type BlinkstickDeviceDefinition = { ledCount: number; variableLedCount?: boolean; }; /** * @summary Known Blinkstick devices and their LED counts. * @remarks Have a look at https://github.com/arvydas/blinkstick-python/blob/master/blinkstick/blinkstick.py#L302 to see existing code. * @category Constants */ export declare const deviceDescriptions: { readonly 'BlinkStick Nano': { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 2; }; }; readonly 'BlinkStick Square': { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 8; }; }; readonly 'BlinkStick Strip': { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 8; }; }; readonly 'BlinkStick Strip Mini': { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 4; }; }; /** * @experimental */ readonly 'BlinkStick Pro': { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 192; readonly variableLedCount: true; }; }; /** * @experimental */ readonly 'BlinkStick Flex': { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 32; readonly variableLedCount: true; }; }; readonly BlinkStick: { readonly test: (d: MinimalDeviceInfo) => boolean; readonly description: { readonly ledCount: 1; }; }; }; /** * @useDeclaredType */ export type KnownDeviceName = keyof typeof deviceDescriptions; /** * @useDeclaredType */ export type KnownDeviceInfo = { [K in KnownDeviceName]: { name: K; } & (typeof deviceDescriptions)[K]['description']; }[KnownDeviceName]; /** * @expandType KnownDeviceInfo */ export declare function attemptToGetDeviceDescription(device: MinimalDeviceInfo): KnownDeviceInfo | null; //# sourceMappingURL=device-descriptions.d.ts.map