From 4c34a2f2df595fa43b3eb06722c3ad742450d8bd Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Mon, 20 Mar 2023 21:27:00 +0000 Subject: feat(ext/net): Add multicasting APIs to DatagramConn (#10706) (#17811) --- cli/tsc/dts/lib.deno.unstable.d.ts | 49 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'cli/tsc') diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index ed7e682f1..62426ca35 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -163,7 +163,7 @@ declare namespace Deno { */ type ToNativeResultType = T extends NativeStructType ? BufferSource - : ToNativeResultTypeMap[Exclude]; + : ToNativeResultTypeMap[Exclude]; /** **UNSTABLE**: New API, yet to be vetted. * @@ -225,7 +225,7 @@ declare namespace Deno { */ type FromNativeResultType = T extends NativeStructType ? Uint8Array - : FromNativeResultTypeMap[Exclude]; + : FromNativeResultTypeMap[Exclude]; /** **UNSTABLE**: New API, yet to be vetted. * @@ -850,6 +850,34 @@ declare namespace Deno { options: CreateHttpClientOptions, ): HttpClient; + /** **UNSTABLE**: New API, yet to be vetted. + * + * Represents membership of a IPv4 multicast group. + * + * @category Network + */ + interface MulticastV4Membership { + /** Leaves the multicast group. */ + leave: () => Promise; + /** Sets the multicast loopback option. If enabled, multicast packets will be looped back to the local socket. */ + setLoopback: (loopback: boolean) => Promise; + /** Sets the time-to-live of outgoing multicast packets for this socket. */ + setTTL: (ttl: number) => Promise; + } + + /** **UNSTABLE**: New API, yet to be vetted. + * + * Represents membership of a IPv6 multicast group. + * + * @category Network + */ + interface MulticastV6Membership { + /** Leaves the multicast group. */ + leave: () => Promise; + /** Sets the multicast loopback option. If enabled, multicast packets will be looped back to the local socket. */ + setLoopback: (loopback: boolean) => Promise; + } + /** **UNSTABLE**: New API, yet to be vetted. * * A generic transport listener for message-oriented protocols. @@ -857,6 +885,18 @@ declare namespace Deno { * @category Network */ export interface DatagramConn extends AsyncIterable<[Uint8Array, Addr]> { + /** Joins an IPv4 multicast group. */ + joinMulticastV4( + address: string, + networkInterface: string, + ): Promise; + + /** Joins an IPv6 multicast group. */ + joinMulticastV6( + address: string, + networkInterface: number, + ): Promise; + /** Waits for and resolves to the next message to the instance. * * Messages are received in the format of a tuple containing the data array @@ -918,6 +958,11 @@ declare namespace Deno { * * @default {false} */ reuseAddress?: boolean; + + /** When `true`, sent multicast packets will be looped back to the local socket. + * + * @default {false} */ + loopback?: boolean; } /** **UNSTABLE**: New API, yet to be vetted. -- cgit v1.2.3