feat: Stabilize Deno.listen for 'unix' transport (#21938)

This commit is contained in:
Bartek Iwańczuk 2024-01-23 13:02:25 +01:00 committed by GitHub
parent 052fd78690
commit 01b6e38baf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 29 deletions

View file

@ -1058,18 +1058,6 @@ declare namespace Deno {
reusePort?: boolean;
}
/** **UNSTABLE**: New API, yet to be vetted.
*
* Unstable 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;
}
/** **UNSTABLE**: New API, yet to be vetted.
*
* Unstable options which can be set when opening a datagram listener via
@ -1091,23 +1079,6 @@ declare namespace Deno {
loopback?: boolean;
}
/** **UNSTABLE**: New API, yet to be vetted.
*
* 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
*/
export function listen(
options: UnixListenOptions & { transport: "unix" },
): Listener;
/** **UNSTABLE**: New API, yet to be vetted.
*
* Listen announces on the local transport address.

View file

@ -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 */