///
///
///
/**
* Freedom module which handles relay sockets for the TURN server.
*/
declare class Backend {
private dispatchEvent_;
/**
* All clients currently known to the server, indexed by tag.
* Note that this map is essentially the (extremely inaccurately) named
* "5-tuple" introduced in section 2.2 of the TURN RFC:
* http://tools.ietf.org/html/rfc5766#section-2.2
*/
private allocations_;
constructor(dispatchEvent_?: (name: string, args: any) => void);
handleIpc: (data: ArrayBuffer) => Promise;
/**
* Emits a Freedom message which should be relayed to the remote side.
* The message is a STUN message, as received from a TURN client but with
* the addition of an IPC_TAG attribute identifying the TURN client.
*/
private emitIpc_;
/** Promises to allocate a socket, wrapped in an Allocation. */
private makeAllocation_;
/**
* Copies a Uint8Array into a new ArrayBuffer. Useful when the array
* has been constructed from a subarray of the buffer, in which case
* bytes.buffer is a much larger array than you are expecting.
* TODO: be smarter about using slice in these instances
*/
private static bytesToArrayBuffer_;
private static getRandomTransactionId_;
}
export = Backend;