diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-02-27 15:18:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-27 15:18:30 +0100 |
commit | 7e3d9084b69d12119b2ad6ef7ac2681e66e36aa0 (patch) | |
tree | 623cc4785c7fc18f91cf9a51763e5517a2aca640 /ext/net/lib.deno_net.d.ts | |
parent | a65ce33fabb44bb2d9ed04773f7f334ed9c9a6b5 (diff) |
feat: Add Deno.TcpConn class, change return type from Deno.connect (#13714)
Diffstat (limited to 'ext/net/lib.deno_net.d.ts')
-rw-r--r-- | ext/net/lib.deno_net.d.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/net/lib.deno_net.d.ts b/ext/net/lib.deno_net.d.ts index 038452055..ab779a1ff 100644 --- a/ext/net/lib.deno_net.d.ts +++ b/ext/net/lib.deno_net.d.ts @@ -143,7 +143,22 @@ declare namespace Deno { * ``` * * Requires `allow-net` permission for "tcp". */ - export function connect(options: ConnectOptions): Promise<Conn>; + export function connect(options: ConnectOptions): Promise<TcpConn>; + + export interface TcpConn extends Conn { + /** + * **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617. + * + * Enable/disable the use of Nagle's algorithm. Defaults to true. + */ + setNoDelay(nodelay?: boolean): void; + /** + * **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617. + * + * Enable/disable keep-alive functionality. + */ + setKeepAlive(keepalive?: boolean): void; + } export interface ConnectTlsOptions { /** The port to connect to. */ |