/** * @typetrackerMessage * Dictionary key-value with all the parameters to communicate with the tracker */ export type trackerMessage = { [key: string]: any; }; /** * @typejoinResponse * Tracker response for join request */ export type joinResponse = { status: 'ok' | 'error'; interval: number; p2p_enabled?: boolean; offer_timeout?: number; rendition?: string; protocol_version?: number; }; /** * @typeanswerData * Object received in answer event callback */ export type answerData = { action: 'answer'; answer: answerObject; info_hash: string; peer_id: string; }; /** * @typeanswerObject * Object received in answer event callback */ export type answerObject = { type: 'answer'; offer_id: string; sdp: string; }; /** * @typecandidatesData * Object received in candidates event callback */ export type candidatesData = { action: 'candidates'; candidates: null | candidate[]; info_hash: string; offer_id: string; peer_id: string; }; /** * @typecandidate * Object received in candidates event callback */ export type candidate = { candidate: string; }; /** * @typeofferData * Object received in offer event callback */ export type offerData = { action: 'offer'; info_hash: string; offer: offerObject; peer_id: string; rendition?: string; protocol_version?: number; }; /** * @typeconfigData * Runtime tracker config message. */ export type configData = { action: 'config'; p2p_enabled?: boolean; protocol_version?: number; }; /** * @typeofferObject * Object received in offer event callback */ export type offerObject = { offer_id: string; sdp: string; type: 'offer'; }; /** * @typeOffer * @property {string} offer_id ID of the offer * @property {string} export type offer type * @property {string} sdp sdp string */ export type Offer = { offer_id: string; type: string; sdp: string; }; /** * @typeP2PConfig * @property {string} tracker tracker domain * @property {string?} accountCode customer code * @property {iceServer[]?} iceServers iceServers config * @property {number?} announcePeers number of announces sent * @property {number?} maxAnnouncePeers max of announces to be sent * @property {string?} token tracker token */ export type P2PConfig = { tracker: string; accountCode?: string; configName?: string; iceServers?: RTCConfiguration | undefined; announcePeers?: number; maxAnnouncePeers?: number; token?: string; protocolVersion?: number; rendition?: string; swarmGroup?: string; resource?: string; canonicalSwarmId?: string; canonicalSwarmSource?: string; };