@types/dns2 2.0.9 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -15
- package/package.json +5 -20
- package/index.d.ts +0 -159
package/README.md
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for dns2 (https://github.com/song940/node-dns#readme).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dns2.
|
|
9
|
-
|
|
10
|
-
### Additional Details
|
|
11
|
-
* Last updated: Mon, 26 Feb 2024 07:07:08 GMT
|
|
12
|
-
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
|
-
|
|
14
|
-
# Credits
|
|
15
|
-
These definitions were written by [Tim Perry](https://github.com/pimterry).
|
|
1
|
+
This is a stub types definition for @types/dns2 (https://github.com/lsongdev/node-dns#readme).
|
|
2
|
+
|
|
3
|
+
dns2 provides its own type definitions, so you don't need @types/dns2 installed!
|
package/package.json
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/dns2",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "TypeScript definitions for dns2",
|
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dns2",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": "Tim Perry",
|
|
10
|
-
"githubUsername": "pimterry",
|
|
11
|
-
"url": "https://github.com/pimterry"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
3
|
+
"version": "3.1.1",
|
|
4
|
+
"description": "Stub TypeScript definitions entry for dns2, which provides its own types definitions",
|
|
14
5
|
"main": "",
|
|
15
|
-
"types": "index.d.ts",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
19
|
-
"directory": "types/dns2"
|
|
20
|
-
},
|
|
21
6
|
"scripts": {},
|
|
7
|
+
"license": "MIT",
|
|
22
8
|
"dependencies": {
|
|
23
|
-
"
|
|
9
|
+
"dns2": "*"
|
|
24
10
|
},
|
|
25
|
-
"
|
|
26
|
-
"typeScriptVersion": "4.6"
|
|
11
|
+
"deprecated": "This is a stub types definition. dns2 provides its own type definitions, so you do not need this installed."
|
|
27
12
|
}
|
package/index.d.ts
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
import * as udp from "dgram";
|
|
4
|
-
import { EventEmitter } from "events";
|
|
5
|
-
import * as net from "net";
|
|
6
|
-
|
|
7
|
-
declare class Packet {
|
|
8
|
-
static TYPE: {
|
|
9
|
-
A: 0x01;
|
|
10
|
-
NS: 0x02;
|
|
11
|
-
MD: 0x03;
|
|
12
|
-
MF: 0x04;
|
|
13
|
-
CNAME: 0x05;
|
|
14
|
-
SOA: 0x06;
|
|
15
|
-
MB: 0x07;
|
|
16
|
-
MG: 0x08;
|
|
17
|
-
MR: 0x09;
|
|
18
|
-
NULL: 0x0a;
|
|
19
|
-
WKS: 0x0b;
|
|
20
|
-
PTR: 0x0c;
|
|
21
|
-
HINFO: 0x0d;
|
|
22
|
-
MINFO: 0x0e;
|
|
23
|
-
MX: 0x0f;
|
|
24
|
-
TXT: 0x10;
|
|
25
|
-
AAAA: 0x1c;
|
|
26
|
-
SRV: 0x21;
|
|
27
|
-
EDNS: 0x29;
|
|
28
|
-
SPF: 0x63;
|
|
29
|
-
AXFR: 0xfc;
|
|
30
|
-
MAILB: 0xfd;
|
|
31
|
-
MAILA: 0xfe;
|
|
32
|
-
ANY: 0xff;
|
|
33
|
-
CAA: 0x101;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
static CLASS: {
|
|
37
|
-
IN: 0x01;
|
|
38
|
-
CS: 0x02;
|
|
39
|
-
CH: 0x03;
|
|
40
|
-
HS: 0x04;
|
|
41
|
-
ANY: 0xff;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
static createResponseFromRequest(request: DNS.DnsRequest): DNS.DnsResponse;
|
|
45
|
-
|
|
46
|
-
toBuffer(): Buffer;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
declare namespace DNS {
|
|
50
|
-
interface DnsClientOptions {
|
|
51
|
-
port: number;
|
|
52
|
-
retries: number;
|
|
53
|
-
timeout: number;
|
|
54
|
-
recursive: boolean;
|
|
55
|
-
resolverProtocol: "UDP" | "TCP";
|
|
56
|
-
nameServers: string[];
|
|
57
|
-
rootServers: string[];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
interface DnsRequest {
|
|
61
|
-
header: { id: string };
|
|
62
|
-
questions: DnsQuestion[];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface DnsQuestion {
|
|
66
|
-
name: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface DnsResponse {
|
|
70
|
-
answers: DnsAnswer[];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface DnsAnswer {
|
|
74
|
-
name: string;
|
|
75
|
-
type: number;
|
|
76
|
-
class: number;
|
|
77
|
-
ttl: number;
|
|
78
|
-
address?: string;
|
|
79
|
-
domain?: string;
|
|
80
|
-
data?: string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface UdpDnsServerOptions {
|
|
84
|
-
type: "udp4" | "udp6";
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface DnsServerListenOptions {
|
|
88
|
-
udp?: ListenOptions;
|
|
89
|
-
tcp?: ListenOptions;
|
|
90
|
-
doh?: ListenOptions;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
type DnsHandler = (
|
|
94
|
-
request: DnsRequest,
|
|
95
|
-
sendResponse: (response: DnsResponse) => void,
|
|
96
|
-
remoteInfo: udp.RemoteInfo,
|
|
97
|
-
) => void;
|
|
98
|
-
|
|
99
|
-
type PacketClass = typeof Packet.CLASS[keyof typeof Packet.CLASS];
|
|
100
|
-
type PacketQuestion = keyof typeof Packet.TYPE;
|
|
101
|
-
type ListenOptions = number | {
|
|
102
|
-
port: number;
|
|
103
|
-
address: string;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
declare class DnsServer extends EventEmitter {
|
|
108
|
-
addresses(): {
|
|
109
|
-
udp?: net.AddressInfo;
|
|
110
|
-
tcp?: net.AddressInfo;
|
|
111
|
-
doh?: net.AddressInfo;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
listen(options: DNS.DnsServerListenOptions): Promise<void>;
|
|
115
|
-
|
|
116
|
-
close(): Promise<void>;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
declare class UdpDnsServer extends udp.Socket {
|
|
120
|
-
constructor(arg?: DNS.UdpDnsServerOptions | DNS.DnsHandler);
|
|
121
|
-
listen(port: number, address?: string): Promise<void>;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
declare class TcpDnsServer extends net.Server {
|
|
125
|
-
constructor(callback?: DNS.DnsHandler);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
declare class DNS {
|
|
129
|
-
constructor(options?: Partial<DNS.DnsClientOptions>);
|
|
130
|
-
|
|
131
|
-
static createServer(options: {
|
|
132
|
-
udp?: boolean | DNS.UdpDnsServerOptions;
|
|
133
|
-
tcp?: boolean;
|
|
134
|
-
doh?: boolean;
|
|
135
|
-
handle: DNS.DnsHandler;
|
|
136
|
-
}): DnsServer;
|
|
137
|
-
|
|
138
|
-
static Packet: typeof Packet;
|
|
139
|
-
|
|
140
|
-
static createUDPServer: (...options: ConstructorParameters<typeof UdpDnsServer>) => UdpDnsServer;
|
|
141
|
-
static UDPServer: typeof UdpDnsServer;
|
|
142
|
-
|
|
143
|
-
static createTCPServer: (...options: ConstructorParameters<typeof TcpDnsServer>) => TcpDnsServer;
|
|
144
|
-
static TCPServer: typeof TcpDnsServer;
|
|
145
|
-
|
|
146
|
-
query(name: string, type: DNS.PacketQuestion, cls?: DNS.PacketClass, clientIp?: string): Promise<DNS.DnsResponse>;
|
|
147
|
-
resolve(
|
|
148
|
-
domain: string,
|
|
149
|
-
type?: DNS.PacketQuestion,
|
|
150
|
-
cls?: DNS.PacketClass,
|
|
151
|
-
clientIp?: string,
|
|
152
|
-
): Promise<DNS.DnsResponse>;
|
|
153
|
-
resolveA(domain: string, clientIp?: string): Promise<DNS.DnsResponse>;
|
|
154
|
-
resolveAAAA(domain: string): Promise<DNS.DnsResponse>;
|
|
155
|
-
resolveMX(domain: string): Promise<DNS.DnsResponse>;
|
|
156
|
-
resolveCNAME(domain: string): Promise<DNS.DnsResponse>;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export = DNS;
|