You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
894 B
34 lines
894 B
1 month ago
|
/// <reference types="node" />
|
||
|
import KeyValue from './KeyValue';
|
||
|
import { EventEmitter } from 'events';
|
||
|
import Service from './service';
|
||
|
export interface BrowserConfig {
|
||
|
type: string;
|
||
|
name?: string;
|
||
|
protocol?: 'tcp' | 'udp';
|
||
|
subtypes?: string[];
|
||
|
txt?: KeyValue;
|
||
|
}
|
||
|
export type BrowserOnUp = (service: Service) => void;
|
||
|
export declare class Browser extends EventEmitter {
|
||
|
private mdns;
|
||
|
private onresponse;
|
||
|
private serviceMap;
|
||
|
private txt;
|
||
|
private name?;
|
||
|
private txtQuery;
|
||
|
private wildcard;
|
||
|
private _services;
|
||
|
constructor(mdns: any, opts: BrowserConfig | BrowserOnUp | null, onup?: BrowserOnUp);
|
||
|
start(): void;
|
||
|
stop(): void;
|
||
|
update(): void;
|
||
|
get services(): Service[];
|
||
|
private addService;
|
||
|
private updateService;
|
||
|
private removeService;
|
||
|
private goodbyes;
|
||
|
private buildServicesFor;
|
||
|
}
|
||
|
export default Browser;
|