@iotize/device-client.js
Version:
IoTize Device client for Javascript
36 lines (35 loc) • 840 B
TypeScript
import { Observable } from "rxjs";
/**
* Scan options provided when starting scan
*/
export interface DeviceScannerOptions {
/**
* Timeout in milliseconds
*/
timeout?: number;
}
export interface DeviceScanner<DataType> {
/**
* Observable on scanner state (true = scanner is running)
*/
scanning: Observable<boolean>;
/**
* return true if scanner is currently running
*/
isScanning: boolean;
/**
* Emit scan results
*/
results: Observable<DataType[]>;
/**
* Start scan
* Will return an Observable that emitts @{link DeviceScanResult} each time
* a device is disoverd
* @param option
*/
start(option?: DeviceScannerOptions): Promise<any>;
/**
* Stop scan
*/
stop(): Promise<any>;
}