@types/dns2 2.0.9 → 2.0.10
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.
- dns2/README.md +1 -1
- dns2/index.d.ts +36 -1
- dns2/package.json +4 -3
dns2/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for dns2 (https://github.com/song940/node
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dns2.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 21 Aug 2025 14:02:56 GMT
|
|
12
12
|
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
13
|
|
|
14
14
|
# Credits
|
dns2/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ declare namespace DNS {
|
|
|
52
52
|
retries: number;
|
|
53
53
|
timeout: number;
|
|
54
54
|
recursive: boolean;
|
|
55
|
-
resolverProtocol: "UDP" | "TCP";
|
|
55
|
+
resolverProtocol: "UDP" | "TCP" | "DOH" | "Google";
|
|
56
56
|
nameServers: string[];
|
|
57
57
|
rootServers: string[];
|
|
58
58
|
}
|
|
@@ -102,8 +102,38 @@ declare namespace DNS {
|
|
|
102
102
|
port: number;
|
|
103
103
|
address: string;
|
|
104
104
|
};
|
|
105
|
+
|
|
106
|
+
interface DnsResolveOptions {
|
|
107
|
+
recursive?: boolean;
|
|
108
|
+
/** EDNS ECS, in CIDR format */
|
|
109
|
+
clientIp?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type DnsResolver = (
|
|
113
|
+
name: string,
|
|
114
|
+
type?: DNS.PacketQuestion,
|
|
115
|
+
cls?: DNS.PacketClass,
|
|
116
|
+
options?: DNS.DnsResolveOptions,
|
|
117
|
+
) => Promise<DNS.DnsResponse>;
|
|
118
|
+
|
|
119
|
+
interface TCPClientOptions {
|
|
120
|
+
dns: string;
|
|
121
|
+
protocol?: "tcp:" | "tls:";
|
|
122
|
+
port?: 53 | 853 | (number & {});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface DOHClientOptions {
|
|
126
|
+
dns: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface UDPClientOptions {
|
|
130
|
+
dns: string;
|
|
131
|
+
port?: 53 | (number & {});
|
|
132
|
+
socketType?: udp.SocketType;
|
|
133
|
+
}
|
|
105
134
|
}
|
|
106
135
|
|
|
136
|
+
// ******** Server *******
|
|
107
137
|
declare class DnsServer extends EventEmitter {
|
|
108
138
|
addresses(): {
|
|
109
139
|
udp?: net.AddressInfo;
|
|
@@ -143,6 +173,11 @@ declare class DNS {
|
|
|
143
173
|
static createTCPServer: (...options: ConstructorParameters<typeof TcpDnsServer>) => TcpDnsServer;
|
|
144
174
|
static TCPServer: typeof TcpDnsServer;
|
|
145
175
|
|
|
176
|
+
static TCPClient: (options: DNS.TCPClientOptions) => DNS.DnsResolver;
|
|
177
|
+
static DOHClient: (options: DNS.DOHClientOptions) => DNS.DnsResolver;
|
|
178
|
+
static UDPClient: (options: DNS.UDPClientOptions) => DNS.DnsResolver;
|
|
179
|
+
static GoogleClient: () => DNS.DnsResolver;
|
|
180
|
+
|
|
146
181
|
query(name: string, type: DNS.PacketQuestion, cls?: DNS.PacketClass, clientIp?: string): Promise<DNS.DnsResponse>;
|
|
147
182
|
resolve(
|
|
148
183
|
domain: string,
|
dns2/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/dns2",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "TypeScript definitions for dns2",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dns2",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@types/node": "*"
|
|
24
24
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"peerDependencies": {},
|
|
26
|
+
"typesPublisherContentHash": "14ea7fcb4d6d35db47093b2aa384825d41128ba2c5a3799d1c844f004c4125dd",
|
|
27
|
+
"typeScriptVersion": "5.2"
|
|
27
28
|
}
|