mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add types for dnssd (#24760)
* Added types for dnssd * Cosmetics, test passed * Removed unused rules
This commit is contained in:
committed by
Mohamed Hegazy
parent
6fda8a5f9d
commit
ad0637bfe3
6
types/dnssd/dnssd-tests.ts
Normal file
6
types/dnssd/dnssd-tests.ts
Normal file
@@ -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);
|
||||
58
types/dnssd/index.d.ts
vendored
Normal file
58
types/dnssd/index.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// 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" />
|
||||
|
||||
/** 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;
|
||||
23
types/dnssd/tsconfig.json
Normal file
23
types/dnssd/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/dnssd/tslint.json
Normal file
1
types/dnssd/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user