import _ from "lodash" import { type udp } from "bun" declare var self: Worker export type UDPServerMsgType = "port" interface BinaryTypeList { arraybuffer: ArrayBuffer; buffer: Buffer; uint8array: Uint8Array; // TODO: DataView // dataview: DataView; } type BinaryType = keyof BinaryTypeList; const udpServer = await Bun.udpSocket({ port: 33000, socket: { data( _socket: udp.Socket, data: BinaryTypeList[BinaryType], port: number, address: string, ) { // todo : Handle Recieved Data } } }) export function udpServerPort(): number { return udpServer.port }