/** * Create a broadcast helper bound to a Bun Server instance. * * @example * ```ts * import { broadcast } from '#services' * * // From a controller * broadcast.to('chat', 'general').emit('message', { text: 'Hello everyone' }) * * // From a queue job * broadcast.to('notifications', userId).emit('new-order', { orderId: 123 }) * ``` */ export declare function createBroadcast(getServer: () => any): { to(channel: string, room: string): BroadcastTarget; }; export type Broadcast = ReturnType; declare class BroadcastTarget { private getServer; private channel; private room; private topic; constructor(getServer: () => any, channel: string, room: string); /** Emit an event to all sockets in the room */ emit(event: string, data?: unknown): void; } export {};