@shuttle-lib/core
Version:
NPM package to interact with the Shuttle devices
43 lines • 1.7 kB
TypeScript
import { EventEmitter } from 'eventemitter3';
import { ButtonStates, ShuttleEvents, ShuttleInfo } from './api.js';
import { HIDDevice } from './genericHIDDevice.js';
export declare class Shuttle extends EventEmitter<ShuttleEvents> {
private _device;
private _deviceInfo;
private _devicePath;
private product;
private _buttonStates;
private _shuttleState;
private _jogState;
private _initialized;
private _disconnected;
/** Vendor ids for the Shuttle devices */
static get vendorIds(): number[];
constructor(_device: HIDDevice, _deviceInfo: DeviceInfo, _devicePath: string | undefined);
private _setupDevice;
/** Initialize the device. This ensures that the essential information from the device about its state has been received. */
init(): Promise<void>;
/** Closes the device. Subsequent commands will raise errors. */
close(): Promise<void>;
/** Various information about the device and its capabilities */
get info(): ShuttleInfo;
/**
* Returns an object with current Button states
*/
getButtons(): ButtonStates;
private _triggerHandleDeviceDisconnected;
/** (Internal function) Called when there has been detected that the device has been disconnected */
_handleDeviceDisconnected(): Promise<void>;
get hidDevice(): HIDDevice;
get deviceInfo(): DeviceInfo;
get devicePath(): string | undefined;
/** Check that the .init() function has run, throw otherwise */
private ensureInitialized;
}
export interface DeviceInfo {
product: string | undefined;
vendorId: number;
productId: number;
interface: number | null;
}
//# sourceMappingURL=Shuttle.d.ts.map