-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathServerSerial.d.ts
More file actions
27 lines (24 loc) · 978 Bytes
/
ServerSerial.d.ts
File metadata and controls
27 lines (24 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* References `serialport` / `@serialport/stream`. `serialport` is optional; add it (or `skipLibCheck`)
* if this file must type-check when optional deps were skipped.
*/
import * as events from 'events';
import * as stream from 'stream';
import { SerialPortOpenOptions } from 'serialport';
import { FCallback, IServiceVector } from './ServerTCP';
import { ErrorCallback } from '@serialport/stream';
export class ServerSerial extends events.EventEmitter {
socks: Map<stream.Transform, 0>;
constructor(vector: IServiceVector, options: IServerSerialOptions);
close(cb: FCallback): void;
}
type IServerSerialOptions = SerialPortOpenOptions<any> & {
debug?: boolean,
unitID?: number,
openCallback?: ErrorCallback
}
export declare interface ServerSerial {
on(event: 'socketError', listener: FCallback): this;
on(event: 'error', listener: FCallback): this;
on(event: 'initialized', listener: FCallback): this;
}