mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
Add lookup to dgram SocketOptions (#20636)
This commit is contained in:
2
types/node/index.d.ts
vendored
2
types/node/index.d.ts
vendored
@@ -2657,6 +2657,7 @@ declare module "net" {
|
||||
|
||||
declare module "dgram" {
|
||||
import * as events from "events";
|
||||
import * as dns from "dns";
|
||||
|
||||
interface RemoteInfo {
|
||||
address: string;
|
||||
@@ -2683,6 +2684,7 @@ declare module "dgram" {
|
||||
reuseAddr?: boolean;
|
||||
recvBufferSize?: number;
|
||||
sendBufferSize?: number;
|
||||
lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void;
|
||||
}
|
||||
|
||||
export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
|
||||
@@ -1375,6 +1375,7 @@ namespace dgram_tests {
|
||||
});
|
||||
ds.send(new Buffer("hello"), 5000, "127.0.0.1");
|
||||
ds.setMulticastInterface("127.0.0.1");
|
||||
ds = dgram.createSocket({ type: "udp4", reuseAddr: true, recvBufferSize: 1000, sendBufferSize: 1000, lookup: dns.lookup });
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user