1 |
|
2 | import { EventEmitter } from "eventemitter3";
|
3 | export declare const VENDOR_ID = "0403";
|
4 | export declare const PRODUCT_ID = "6001";
|
5 | interface Events {
|
6 | ready: [];
|
7 | error: [Error];
|
8 | }
|
9 | type Usleep = (microSeconds: number) => unknown;
|
10 | export declare class EnttecOpenDMXUSBDevice extends EventEmitter<Events> {
|
11 | private shouldBeSending;
|
12 | private sendTimeout;
|
13 | private buffer;
|
14 | private readonly port;
|
15 | private readonly usleep;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | constructor(path: string, startSending?: boolean, usleep?: Usleep | null);
|
23 | /**
|
24 | * Start sending.
|
25 | * @param [interval=0] The milliseconds between each attempt to send. Most of the time `0` works fine.
|
26 | * @throws When the device is not ready yet.
|
27 | */
|
28 | startSending(interval?: number): void;
|
29 | /**
|
30 | * Stop sending.
|
31 | */
|
32 | stopSending(): void;
|
33 | /**
|
34 | * Set channel values.
|
35 | * If channels is an Object, the keys are the channel numbers.
|
36 | *
|
37 | * @param channels
|
38 | * @param [clear=false] Whether all previously assigned channels should be set to `0`
|
39 | */
|
40 | setChannels(channels: Buffer | number[] | Record<number, number>, clear?: boolean): void;
|
41 | /**
|
42 | * @returns A Promise resolved when the whole universe was sent.
|
43 | * @private
|
44 | */
|
45 | _sendUniverse(): Promise<void>;
|
46 | /**
|
47 | * Get the paths of all available devices.
|
48 | */
|
49 | static listDevices(): Promise<string[]>;
|
50 | /**
|
51 | * Get the path of the first available device.
|
52 | * @throws When no device is found.
|
53 | */
|
54 | static getFirstAvailableDevice(): Promise<string>;
|
55 | }
|
56 | export {};
|