From a04576e8000854a4ba527c155901f7f4e72bf18a Mon Sep 17 00:00:00 2001 From: Max Rumpf Date: Mon, 6 Aug 2018 21:02:58 +0200 Subject: [PATCH] [@types/dnssd] More fixes according the original source (#27877) * Another set of fixes * Fix lint * Fix support for object type --- types/dnssd/index.d.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts index 80de2900f3..8ef8aa84fd 100644 --- a/types/dnssd/index.d.ts +++ b/types/dnssd/index.d.ts @@ -3,13 +3,14 @@ // 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 { +export class Advertisement extends EventEmitter { constructor(type: string | string[] | ServiceType, port: number, ...args: any[]); start(): Advertisement; @@ -43,7 +44,7 @@ export class Service { } export class ServiceType { - constructor(...args: string[]) + constructor(...args: Array) constructor(args: ServiceType); name: string; @@ -60,29 +61,29 @@ export class ServiceType { } export class Browser extends EventEmitter { - constructor(type: any, ...args: any[]); + constructor(type: string | string[] | ServiceType, ...args: any[]); - list(): any; + start(): Browser; - start(): any; + stop(): void; - stop(): any; + list(): any[]; } -export const resolveA: any; +export function resolve(name: string, type: string, args: object): Promise; -export const resolveAAAA: any; +export function resolve4(name: string, type: string, args: object): Promise; -export function all(): ServiceType; +export function resolve6(name: string, type: string, args: object): Promise; -export function resolve(name: any, type: any, ...args: any[]): any; +export function resolveSRV(name: string, args: object): Promise; -export function resolveSRV(name: any, opts: any): any; +export function resolveTXT(name: string, args: object): Promise; -export function resolveService(name: any, ...args: any[]): any; - -export function resolveTXT(name: any, opts: any): any; +export function resolveService(name: string, args: object): Promise; export function tcp(...args: string[]): ServiceType; export function udp(...args: string[]): ServiceType; + +export function all(): ServiceType;