mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Fixed the bind method for UDP.
This commit is contained in:
2
types/node/index.d.ts
vendored
2
types/node/index.d.ts
vendored
@@ -2437,6 +2437,8 @@ declare module "dgram" {
|
||||
send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
|
||||
send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
|
||||
bind(port?: number, address?: string, callback?: () => void): void;
|
||||
bind(port?: number, callback?: () => void): void;
|
||||
bind(callback?: () => void): void;
|
||||
bind(options: BindOptions, callback?: Function): void;
|
||||
close(callback?: () => void): void;
|
||||
address(): AddressInfo;
|
||||
|
||||
@@ -1045,6 +1045,10 @@ namespace dgram_tests {
|
||||
});
|
||||
ds.bind();
|
||||
ds.bind(41234);
|
||||
ds.bind(4123, 'localhost');
|
||||
ds.bind(4123, 'localhost', () => {});
|
||||
ds.bind(4123, () => {});
|
||||
ds.bind(() => {});
|
||||
var ai: dgram.AddressInfo = ds.address();
|
||||
ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => {
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user