From 817899a53110ea674c6216728825cc891ccce392 Mon Sep 17 00:00:00 2001 From: mutec Date: Sun, 10 Mar 2024 12:36:27 +0100 Subject: [PATCH] export sender props and make them re-usable --- src/sender.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sender.ts b/src/sender.ts index ed70aad..5136344 100644 --- a/src/sender.ts +++ b/src/sender.ts @@ -2,7 +2,7 @@ import { Socket, createSocket } from 'dgram'; import { multicastGroup } from './util'; import { Packet, Options } from './packet'; -interface Props { +export interface SenderProps { universe: number; port?: number; reuseAddr?: boolean; @@ -33,9 +33,9 @@ interface Props { export class Sender { private socket: Socket; - private readonly port: Props['port']; + private readonly port: SenderProps['port']; - public readonly universe: Props['universe']; + public readonly universe: SenderProps['universe']; /** * this is normally a multicast address, but it could be @@ -43,7 +43,7 @@ export class Sender { */ readonly #destinationIp: string; - private readonly defaultPacketOptions: Props['defaultPacketOptions']; + private readonly defaultPacketOptions: SenderProps['defaultPacketOptions']; private sequence = 0; @@ -64,7 +64,7 @@ export class Sender { defaultPacketOptions, iface, useUnicastDestination, - }: Props) { + }: SenderProps) { this.port = port; this.universe = universe; this.#destinationIp = useUnicastDestination || multicastGroup(universe);