/** Check if a raw inbound message is large enough to offload to Worker. */ export declare function isLargeMessage(raw: string): boolean; /** Check if an outbound message object is large enough to offload. * Avoids JSON.stringify by checking known large-payload shapes (file attachments). */ export declare function isLargeOutbound(msg: unknown): boolean; /** Parse a large message in a Worker thread. Falls back to inline on failure. */ export declare function workerParseMessage(raw: string, sessionKey: Uint8Array | null): Promise | null>; /** Serialize+encrypt a large message in a Worker thread, then send via ws. */ export declare function workerEncryptAndSend(ws: { send: (data: string) => void; readyState: number; }, msg: unknown, sessionKey: Uint8Array | null): Promise; /** Shut down all workers. Call on server shutdown. */ export declare function terminateWorkerPool(): Promise;