UNPKG

@types/dnssd

Version:
102 lines (70 loc) 2.82 kB
# Installation > `npm install --save @types/dnssd` # Summary This package contains type definitions for dnssd (https://github.com/DeMille/dnssd.js#readme). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dnssd. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dnssd/index.d.ts) ````ts /// <reference types="node" /> 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 | undefined; host?: string | undefined; txt?: any; subtypes?: string[] | undefined; interface?: string | undefined; } /** * 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<string | string[]>); 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<any>; export function resolve4(name: string, type: string, args: object): Promise<string>; export function resolve6(name: string, type: string, args: object): Promise<string>; export function resolveSRV(name: string, args: object): Promise<any>; export function resolveTXT(name: string, args: object): Promise<any>; export function resolveService(name: string, args: object): Promise<any>; export function tcp(...args: string[]): ServiceType; export function udp(...args: string[]): ServiceType; export function all(): ServiceType; ```` ### Additional Details * Last updated: Mon, 06 Nov 2023 22:41:05 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node) # Credits These definitions were written by [Angel Merino](https://github.com/angelmerino), and [Max Rumpf](https://github.com/Maxr1998).