mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-04-02 03:34:32 +00:00
* Added types for dnssd * Cosmetics, test passed * Removed unused rules * Service entry type added Browser implements EventEmitter * make tslint happy
80 lines
1.8 KiB
TypeScript
80 lines
1.8 KiB
TypeScript
// Type definitions for dnssd 0.3
|
|
// Project: https://github.com/DeMille/dnssd.js#readme
|
|
// Definitions by: Angel Merino <https://github.com/angelmerino>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
import { EventEmitter } from 'events';
|
|
|
|
/** Declaration file generated by dts-gen */
|
|
|
|
export class Advertisement {
|
|
constructor(type: any, port: any, ...args: any[]);
|
|
|
|
start(): any;
|
|
|
|
stop(forceImmediate: any, callback: any): void;
|
|
|
|
updateTXT(txtObj: any): void;
|
|
}
|
|
|
|
/**
|
|
* A service entry as returned by serviceUp
|
|
*/
|
|
export class Service {
|
|
fullname: string; // 'InstanceName._googlecast._tcp.local.'
|
|
name: string; // 'InstanceName'
|
|
type: SType; // { 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 SType {
|
|
name: string;
|
|
protocol: string;
|
|
}
|
|
|
|
export class Browser extends EventEmitter {
|
|
constructor(type: any, ...args: any[]);
|
|
|
|
list(): any;
|
|
|
|
start(): any;
|
|
|
|
stop(): any;
|
|
}
|
|
|
|
export class ServiceType {
|
|
constructor(...args: any[]);
|
|
|
|
toString(): any;
|
|
|
|
static all(): any;
|
|
|
|
static tcp(...args: any[]): any;
|
|
|
|
static udp(...args: any[]): any;
|
|
}
|
|
|
|
export const resolveA: any;
|
|
|
|
export const resolveAAAA: any;
|
|
|
|
export function all(): any;
|
|
|
|
export function resolve(name: any, type: any, ...args: any[]): any;
|
|
|
|
export function resolveSRV(name: any, opts: any): any;
|
|
|
|
export function resolveService(name: any, ...args: any[]): any;
|
|
|
|
export function resolveTXT(name: any, opts: any): any;
|
|
|
|
export function tcp(...args: any[]): any;
|
|
|
|
export function udp(...args: any[]): any;
|