import SerialPort from './SerialPort'; export default class API { /** * @callback stringArrayCallback * @param {Array} values */ /** * @callback stringCallback * @param {string} value */ /** * @typedef {Object} openOptions * @property {number} baudRate such as 9600 * @property {number} [parity=0] 0: none, 1: odd, 2: even * @property {number} [dataBits=8] 5~8 * @property {number} [stopBits=1] 1 or 2 * @property {number} [readBufferSize=64] set read buffer size */ /** * Get serial port device names * @param {stringArrayCallback} callback */ static deviceNames(callback: (names: string[]) => void): void; /** * Get serial port device paths * @param {stringArrayCallback} callback */ static devicePaths(callback: (paths: string[]) => void): void; /** * Get serial port device paths * @returns {Promise>} paths */ static devicePathsAsync(): Promise; /** * set su binary path * @param {string} suPath */ static setSuPath(suPath: string): void; /** * get su binary path * @param {stringCallback} callback */ static getSuPath(callback: (suPath: string) => void): void; /** * Open serial port * @param {string} devicePath device path * @param {openOptions} options * @returns {Promise} connected serial port */ static open(devicePath: string, { baudRate, parity, dataBits, stopBits, readBufferSize }: { baudRate: number; parity?: number; dataBits?: number; stopBits?: number; readBufferSize?: number; }): Promise; } //# sourceMappingURL=API.d.ts.map