From 01b6e38bafb4c60a281ba7e854a06a1e8b554bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 23 Jan 2024 13:02:25 +0100 Subject: feat: Stabilize Deno.listen for 'unix' transport (#21938) --- ext/net/lib.deno_net.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ext/net/lib.deno_net.d.ts') diff --git a/ext/net/lib.deno_net.d.ts b/ext/net/lib.deno_net.d.ts index e77b1bc6f..c019c8d61 100644 --- a/ext/net/lib.deno_net.d.ts +++ b/ext/net/lib.deno_net.d.ts @@ -138,6 +138,32 @@ declare namespace Deno { options: TcpListenOptions & { transport?: "tcp" }, ): Listener; + /** Options which can be set when opening a Unix listener via + * {@linkcode Deno.listen} or {@linkcode Deno.listenDatagram}. + * + * @category Network + */ + export interface UnixListenOptions { + /** A path to the Unix Socket. */ + path: string; + } + + /** Listen announces on the local transport address. + * + * ```ts + * const listener = Deno.listen({ path: "/foo/bar.sock", transport: "unix" }) + * ``` + * + * Requires `allow-read` and `allow-write` permission. + * + * @tags allow-read, allow-write + * @category Network + */ + // deno-lint-ignore adjacent-overload-signatures + export function listen( + options: UnixListenOptions & { transport: "unix" }, + ): Listener; + /** @category Network */ export interface ListenTlsOptions extends TcpListenOptions { /** Server private key in PEM format */ -- cgit v1.2.3