mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-17 02:21:53 -05:00
This can correctly find and return IntelliCenter units on the local network now. Cleaned up a bunch of Finder code and added back in "debug" module logging. Fixed up types in Dns module so we can use instanceof
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { EventEmitter } from "events";
|
|
export declare class UnitInfo {
|
|
name: string;
|
|
hostname: string;
|
|
port: number;
|
|
address: number;
|
|
get addressStr(): string;
|
|
constructor(_name: string, _hostname: string, _port: number, _address: number);
|
|
}
|
|
export declare class FindUnits extends EventEmitter {
|
|
constructor();
|
|
private finder;
|
|
private bound;
|
|
private message;
|
|
private units;
|
|
/**
|
|
* Begins a search and returns immediately. Must close the finder with close() when done with all searches.
|
|
*/
|
|
search(): void;
|
|
/**
|
|
* Searches for the given amount of time. Must close the finder with close() when done with all searches.
|
|
* @param searchTimeMs the number of milliseconds to search before giving up and returning found results (default: 5000)
|
|
* @returns Promise resolving to a list of discovered units, if any.
|
|
*/
|
|
searchAsync(searchTimeMs?: number): Promise<UnitInfo[]>;
|
|
private foundServer;
|
|
private sendServerBroadcast;
|
|
/**
|
|
* Closes the finder socket.
|
|
*/
|
|
close(): void;
|
|
}
|