import { Service, ServiceMessage, ServiceOptions } from "../Service"; export declare type WebRTCProps = { _id?: string; channels?: { [key: string]: (true | RTCDataChannelInit | RTCDataChannel); }; config?: RTCConfiguration; hostdescription?: RTCSessionDescriptionInit | string; peerdescription?: RTCSessionDescriptionInit | string; offer?: RTCOfferOptions; hostcandidates?: { [key: string]: RTCIceCandidate; }; peercandidates?: { [key: string]: RTCIceCandidate; }; answer?: RTCAnswerOptions; ontrack?: (ev: RTCTrackEvent) => void; onicecandidate?: (ev: RTCPeerConnectionIceEvent) => void; onicecandidateerror?: (ev: Event) => void; onnegotiationneeded?: (ev: Event) => void; ondatachannel?: (ev: RTCDataChannelEvent) => void; ondata?: (ev: MessageEvent, channel: RTCDataChannel, room: any) => void; onconnectionstatechange?: (ev: Event) => void; oniceconnectionstatechange?: (ev: Event) => void; onclose?: (rtc: WebRTCInfo) => void; }; export declare type WebRTCInfo = { _id: string; rtc: RTCPeerConnection; send: (message: any) => void; request: (message: any, method?: string) => Promise; post: (route: any, args?: any) => void; run: (route: any, args?: any, method?: string) => Promise; subscribe: (route: any, callback?: ((res: any) => void) | string, args?: any[], key?: string, subInput?: boolean, channelId?: string) => Promise; unsubscribe: (route: any, sub: number) => Promise; terminate: () => boolean; graph: WebRTCfrontend; } & WebRTCProps; export declare class WebRTCfrontend extends Service { name: string; rtc: { [key: string]: WebRTCInfo; }; iceServers: { urls: string[]; }[]; connections: { rtc: { [key: string]: WebRTCInfo; }; }; constructor(options?: ServiceOptions, iceServers?: { urls: string[]; }[]); createStream: (options: { [key: string]: { track: MediaStreamTrack | MediaTrackConstraints; onended: (ev: any) => void; onmute: (ev: any) => void; onunmute: (ev: any) => void; }; }) => MediaStream; openRTC: (options?: WebRTCProps) => Promise; open: (options?: WebRTCProps) => Promise; addIceCandidate(rtc: RTCPeerConnection, candidate: RTCIceCandidate): Promise; answerPeer(rtc: RTCPeerConnection, options: WebRTCProps): Promise; addUserMedia: (rtc: RTCPeerConnection, options?: MediaStreamConstraints) => any[]; addTrack: (rtc: RTCPeerConnection, track: MediaStreamTrack, stream: MediaStream) => boolean; removeTrack: (rtc: RTCPeerConnection, sender: RTCRtpSender) => boolean; addDataChannel: (rtc: RTCPeerConnection, name: string, options?: RTCDataChannelInit) => RTCDataChannel; transmit: (data: ServiceMessage | any, id?: string, channel?: string | RTCDataChannel) => boolean; terminate: (rtc: RTCPeerConnection | WebRTCInfo | string) => boolean; request: (message: ServiceMessage | any, channel: RTCDataChannel, _id: string, method?: string) => Promise; runRequest: (message: any, channel: RTCDataChannel | string, callbackId: string | number) => any; subscribeRTC: (route: string, rtcId: string, args?: any[], key?: string, subInput?: boolean, channel?: string | RTCDataChannel) => any; subscribeToRTC: (route: string, rtcId: string, channelId: string, callback?: string | ((res: any) => void), args?: any[], key?: string, subInput?: boolean) => Promise; }