// Type definitions for dnssd 0.4 // Project: https://github.com/DeMille/dnssd.js#readme // Definitions by: Angel Merino // Max Rumpf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// import { EventEmitter } from 'events'; /** Declaration file generated by dts-gen */ export class Advertisement extends EventEmitter { constructor(type: string | string[] | ServiceType, port: number, ...args: any[]); start(): Advertisement; stop(forceImmediate?: boolean, callback?: () => any): void; updateTXT(txtObj: any): void; } export class Options { name?: string; host?: string; txt?: any; subtypes?: string[]; interface?: string; } /** * A service entry as returned by serviceUp */ export class Service { fullname: string; // 'InstanceName._googlecast._tcp.local.' name: string; // 'InstanceName' type: ServiceType; // { name: 'googlecast'; protocol: 'tcp' } domain: string; // 'local' host: string; // 'Hostname.local.' port: number; // 8009 addresses: string[]; // ['192.168.1.15'] txt: any; // { id: 'strings' } txtRaw: any; } export class ServiceType { constructor(...args: Array) constructor(args: ServiceType); name: string; protocol: string; subtypes: string[]; toString(): string; static all(): ServiceType; static tcp(...args: string[]): ServiceType; static udp(...args: string[]): ServiceType; } export class Browser extends EventEmitter { constructor(type: string | string[] | ServiceType, ...args: any[]); start(): Browser; stop(): void; list(): any[]; } export function resolve(name: string, type: string, args: object): Promise; export function resolve4(name: string, type: string, args: object): Promise; export function resolve6(name: string, type: string, args: object): Promise; export function resolveSRV(name: string, args: object): Promise; export function resolveTXT(name: string, args: object): Promise; export function resolveService(name: string, args: object): Promise; export function tcp(...args: string[]): ServiceType; export function udp(...args: string[]): ServiceType; export function all(): ServiceType;