@types/dns2 2.0.3 → 2.0.5
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/LICENSE +0 -0
- dns2/README.md +1 -1
- dns2/index.d.ts +22 -8
- dns2/package.json +3 -3
dns2/LICENSE
CHANGED
|
File without changes
|
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: Fri, 06 Oct 2023 15:35:00 GMT
|
|
12
12
|
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
dns2/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
/// <reference types="node" />
|
|
7
7
|
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import * as udp from "dgram";
|
|
9
|
+
import { EventEmitter } from "events";
|
|
10
|
+
import * as net from "net";
|
|
11
11
|
|
|
12
12
|
declare class Packet {
|
|
13
13
|
static TYPE: {
|
|
@@ -57,7 +57,7 @@ declare namespace DNS {
|
|
|
57
57
|
retries: number;
|
|
58
58
|
timeout: number;
|
|
59
59
|
recursive: boolean;
|
|
60
|
-
resolverProtocol:
|
|
60
|
+
resolverProtocol: "UDP" | "TCP";
|
|
61
61
|
nameServers: string[];
|
|
62
62
|
rootServers: string[];
|
|
63
63
|
}
|
|
@@ -85,6 +85,10 @@ declare namespace DNS {
|
|
|
85
85
|
data?: string;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
interface UdpDnsServerOptions {
|
|
89
|
+
type: 'udp4' | 'udp6';
|
|
90
|
+
}
|
|
91
|
+
|
|
88
92
|
type DnsHandler = (
|
|
89
93
|
request: DnsRequest,
|
|
90
94
|
sendResponse: (response: DnsResponse) => void,
|
|
@@ -108,8 +112,8 @@ declare class DnsServer extends EventEmitter {
|
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
declare class UdpDnsServer extends udp.Socket {
|
|
111
|
-
constructor(
|
|
112
|
-
listen(port: number, address
|
|
115
|
+
constructor(arg?: DNS.UdpDnsServerOptions | DNS.DnsHandler);
|
|
116
|
+
listen(port: number, address?: string): Promise<void>;
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
declare class TcpDnsServer extends net.Server {
|
|
@@ -119,7 +123,12 @@ declare class TcpDnsServer extends net.Server {
|
|
|
119
123
|
declare class DNS {
|
|
120
124
|
constructor(options?: Partial<DNS.DnsClientOptions>);
|
|
121
125
|
|
|
122
|
-
static createServer(options: {
|
|
126
|
+
static createServer(options: {
|
|
127
|
+
udp?: boolean | DNS.UdpDnsServerOptions;
|
|
128
|
+
tcp?: boolean;
|
|
129
|
+
doh?: boolean;
|
|
130
|
+
handle: DNS.DnsHandler;
|
|
131
|
+
}): DnsServer;
|
|
123
132
|
|
|
124
133
|
static Packet: typeof Packet;
|
|
125
134
|
|
|
@@ -130,7 +139,12 @@ declare class DNS {
|
|
|
130
139
|
static TCPServer: typeof TcpDnsServer;
|
|
131
140
|
|
|
132
141
|
query(name: string, type: DNS.PacketQuestion, cls?: DNS.PacketClass, clientIp?: string): Promise<DNS.DnsResponse>;
|
|
133
|
-
resolve(
|
|
142
|
+
resolve(
|
|
143
|
+
domain: string,
|
|
144
|
+
type?: DNS.PacketQuestion,
|
|
145
|
+
cls?: DNS.PacketClass,
|
|
146
|
+
clientIp?: string,
|
|
147
|
+
): Promise<DNS.DnsResponse>;
|
|
134
148
|
resolveA(domain: string, clientIp?: string): Promise<DNS.DnsResponse>;
|
|
135
149
|
resolveAAAA(domain: string): Promise<DNS.DnsResponse>;
|
|
136
150
|
resolveMX(domain: string): Promise<DNS.DnsResponse>;
|
dns2/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/dns2",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
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,6 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@types/node": "*"
|
|
24
24
|
},
|
|
25
|
-
"typesPublisherContentHash": "
|
|
26
|
-
"typeScriptVersion": "4.
|
|
25
|
+
"typesPublisherContentHash": "dec52803ab6c79ec8ec23f5a80ebd47a2c679d01587f767fc587c0615fac623e",
|
|
26
|
+
"typeScriptVersion": "4.5"
|
|
27
27
|
}
|