@iotize/device-client.js
Version:
IoTize Device client for Javascript
37 lines (36 loc) • 1.21 kB
TypeScript
import { Subscription } from "rxjs";
import { ComProtocol } from "../../protocol/api/com-protocol.interface";
export declare class ComRelayError extends Error {
static illegalArgument(message: string): ComRelayError;
code: string;
constructor(code: ComRelayError.Code, msg: string);
}
export declare namespace ComRelayError {
enum Code {
IllegalArgmentError = "IllegalArgmentError"
}
}
/**
* This is an experimental feature.
*
* @experimental
*/
export declare class ComRelay {
protected _sourceProtocolSubscription?: Subscription;
protected mSourceProtocol?: ComProtocol;
protected mTargetProtocol?: ComProtocol;
/**
* @param sourceProtocol protocol that will received commands
* @param targetProtocol protocol on wich commmand will be sent
*/
constructor(sourceProtocol?: ComProtocol, targetProtocol?: ComProtocol);
setSourceProtocol(protocol: ComProtocol): this;
removeSourceProtocol(): this;
setTargetProtocol(protocol: ComProtocol): this;
start(options?: {
timeout?: number;
}): Promise<{}>;
stop(): void;
listenToDataStream(): Promise<any>;
onStop(): this;
}