summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno.unstable.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r--cli/dts/lib.deno.unstable.d.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index 9ab9b5761..a61d672f7 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -1333,6 +1333,20 @@ declare namespace Deno {
* Make the timer of the given id not blocking the event loop from finishing
*/
export function unrefTimer(id: number): void;
+
+ /** **UNSTABLE**: new API, yet to be vetter.
+ *
+ * Allows to "hijack" a connection that the request is associated with.
+ * Can be used to implement protocols that build on top of HTTP (eg.
+ * WebSockets).
+ *
+ * The returned promise returns underlying connection and first packet
+ * received. The promise shouldn't be awaited before responding to the
+ * `request`, otherwise event loop might deadlock.
+ */
+ export function upgradeHttp(
+ request: Request,
+ ): Promise<[Deno.Conn, Uint8Array]>;
}
declare function fetch(