summaryrefslogtreecommitdiff
path: root/cli/js/lib.deno.ns.d.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-04-28 21:46:39 +0200
committerGitHub <noreply@github.com>2020-04-28 21:46:39 +0200
commit1b6181e434422d3fe5aa49f59f1e7adc4ec4ce8f (patch)
tree6c58cc861c5efbbfcd51bb92e5a71d1db4ecf4ad /cli/js/lib.deno.ns.d.ts
parentea28a088a473083cb759a3264235005a25450cbc (diff)
refactor: factor out datagram from Deno.listen(), make it unstable (#4968)
This commit changes Deno.listen() API by factoring out datagram listeners to Deno.listenDatagram(). New Deno.listenDatagram() is unstable.
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r--cli/js/lib.deno.ns.d.ts34
1 files changed, 21 insertions, 13 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts
index db89ed97f..4659c1ff7 100644
--- a/cli/js/lib.deno.ns.d.ts
+++ b/cli/js/lib.deno.ns.d.ts
@@ -1920,9 +1920,7 @@ declare namespace Deno {
/** A Path to the Unix Socket. */
path: string;
}
- /** **UNSTABLE**: new API, yet to be vetted.
- *
- * Listen announces on the local transport address.
+ /** Listen announces on the local transport address.
*
* const listener1 = Deno.listen({ port: 80 })
* const listener2 = Deno.listen({ hostname: "192.0.2.1", port: 80 })
@@ -1933,9 +1931,7 @@ declare namespace Deno {
export function listen(
options: ListenOptions & { transport?: "tcp" }
): Listener;
- /** **UNSTABLE**: new API, yet to be vetted.
- *
- * Listen announces on the local transport address.
+ /** Listen announces on the local transport address.
*
* const listener = Deno.listen({ path: "/foo/bar.sock", transport: "unix" })
*
@@ -1943,25 +1939,37 @@ declare namespace Deno {
export function listen(
options: UnixListenOptions & { transport: "unix" }
): Listener;
- /** **UNSTABLE**: new API, yet to be vetted.
+
+ /** **UNSTABLE**: new API
*
* Listen announces on the local transport address.
*
- * const listener1 = Deno.listen({ port: 80, transport: "udp" })
- * const listener2 = Deno.listen({ hostname: "golang.org", port: 80, transport: "udp" });
+ * const listener1 = Deno.listenDatagram({
+ * port: 80,
+ * transport: "udp"
+ * });
+ * const listener2 = Deno.listenDatagram({
+ * hostname: "golang.org",
+ * port: 80,
+ * transport: "udp"
+ * });
*
* Requires `allow-net` permission. */
- export function listen(
+ export function listenDatagram(
options: ListenOptions & { transport: "udp" }
): DatagramConn;
- /** **UNSTABLE**: new API, yet to be vetted.
+
+ /** **UNSTABLE**: new API
*
* Listen announces on the local transport address.
*
- * const listener = Deno.listen({ path: "/foo/bar.sock", transport: "unixpacket" })
+ * const listener = Deno.listenDatagram({
+ * address: "/foo/bar.sock",
+ * transport: "unixpacket"
+ * });
*
* Requires `allow-read` and `allow-write` permission. */
- export function listen(
+ export function listenDatagram(
options: UnixListenOptions & { transport: "unixpacket" }
): DatagramConn;