mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
node: Fix net.Socket definition (#18275)
v0.12.x: https://nodejs.org/docs/latest-v0.12.x/api/net.html#net_new_net_socket_options v4: https://nodejs.org/dist/latest-v4.x/docs/api/net.html#net_new_net_socket_options v6: https://nodejs.org/dist/latest-v6.x/docs/api/net.html#net_new_net_socket_options v7: https://nodejs.org/dist/latest-v7.x/docs/api/net.html#net_new_net_socket_options v8: https://nodejs.org/api/net.html#net_new_net_socket_options
This commit is contained in:
committed by
Wesley Wigham
parent
e030446e88
commit
527914c2a3
2
types/node/v6/index.d.ts
vendored
2
types/node/v6/index.d.ts
vendored
@@ -2057,7 +2057,7 @@ declare module "net" {
|
||||
}
|
||||
|
||||
export var Socket: {
|
||||
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
|
||||
new (options?: { fd?: number; allowHalfOpen?: boolean; readable?: boolean; writable?: boolean; }): Socket;
|
||||
};
|
||||
|
||||
export interface ListenOptions {
|
||||
|
||||
@@ -1868,7 +1868,12 @@ namespace net_tests {
|
||||
* 7. lookup
|
||||
* 8. timeout
|
||||
*/
|
||||
let _socket: net.Socket;
|
||||
let _socket: net.Socket = new net.Socket({
|
||||
fd: 1,
|
||||
allowHalfOpen: false,
|
||||
readable: false,
|
||||
writable: false
|
||||
});
|
||||
|
||||
let bool: boolean;
|
||||
let buffer: Buffer;
|
||||
|
||||
Reference in New Issue
Block a user