mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
[serialport] added readonly properties
https://node-serialport.github.io/node-serialport/SerialPort.html
This commit is contained in:
Vendored
+5
@@ -12,6 +12,11 @@ declare class SerialPort extends Stream.Duplex {
|
||||
constructor(path: string, callback?: SerialPort.ErrorCallback);
|
||||
constructor(path: string, options?: SerialPort.OpenOptions, callback?: SerialPort.ErrorCallback);
|
||||
|
||||
readonly baudRate: number;
|
||||
readonly binding: SerialPort.BaseBinding;
|
||||
readonly isOpen: boolean;
|
||||
readonly path: string;
|
||||
|
||||
open(callback?: SerialPort.ErrorCallback): void;
|
||||
update(options: SerialPort.UpdateOptions, callback?: SerialPort.ErrorCallback): void;
|
||||
|
||||
|
||||
@@ -117,3 +117,12 @@ function test_parsers() {
|
||||
port.pipe(ReadyParser);
|
||||
port.pipe(RegexParser);
|
||||
}
|
||||
|
||||
function test_properties() {
|
||||
const port = new SerialPort('');
|
||||
|
||||
const baudRate: number = port.baudRate;
|
||||
const binding: SerialPort.BaseBinding = port.binding;
|
||||
const isOpen: boolean = port.isOpen;
|
||||
const path: string = port.path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user