diff --git a/types/dnssd/dnssd-tests.ts b/types/dnssd/dnssd-tests.ts new file mode 100644 index 0000000000..14b637d384 --- /dev/null +++ b/types/dnssd/dnssd-tests.ts @@ -0,0 +1,6 @@ +import * as dnssd from 'dnssd'; + +const serviceType = new dnssd.ServiceType(dnssd.tcp('_mqtt'), dnssd.udp('_mqtt')); + +const advertisement = new dnssd.Advertisement(serviceType, 1883, { name: 'broker' }); +const browser: dnssd.Browser = new dnssd.Browser(serviceType); diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts new file mode 100644 index 0000000000..3f5617afcb --- /dev/null +++ b/types/dnssd/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for dnssd 0.3 +// Project: https://github.com/DeMille/dnssd.js#readme +// Definitions by: Angel Merino +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** 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; +} + +export class Browser { + 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; diff --git a/types/dnssd/tsconfig.json b/types/dnssd/tsconfig.json new file mode 100644 index 0000000000..88346a63fd --- /dev/null +++ b/types/dnssd/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dnssd-tests.ts" + ] +} diff --git a/types/dnssd/tslint.json b/types/dnssd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dnssd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }