import { ViewStyle } from 'react-native'; export declare enum ParticipantType { Remote = "Remote", Local = "Local" } export declare enum TrackType { Audio = "Audio", Video = "Video" } export declare type Track = { id: string; type: TrackType; metadata: Metadata; }; export declare type Metadata = { [key: string]: any; }; export declare type SocketConnectionParams = { [key: string]: any; }; export declare type Participant = { /** * id used to identify a participant */ id: string; /** * used to indicate participant type. */ type: ParticipantType; /** * a map `string -> any` containing participant metadata from the server */ metadata: Metadata; /** * a list of participant's video and audio tracks */ tracks: Track[]; }; export declare enum VideoLayout { FILL = "FILL", FIT = "FIT" } export declare enum VideoQuality { QVGA_169 = "QVGA169", VGA_169 = "VGA169", QHD_169 = "QHD169", HD_169 = "HD169", FHD_169 = "FHD169", QVGA_43 = "QVGA43", VGA_43 = "VGA43", QHD_43 = "QHD43", HD_43 = "HD43", FHD_43 = "FHD43" } export declare enum ScreencastQuality { VGA = "VGA", HD5 = "HD5", HD15 = "HD15", FHD15 = "FHD15", FHD30 = "FHD30" } export declare type TrackEncoding = 'l' | 'm' | 'h'; /** * A type describing simulcast configuration. * * At the moment, simulcast track is initialized in three versions - low, medium and high. * High resolution is the original track resolution, while medium and low resolutions are * the original track resolution scaled down by 2 and 4 respectively. */ export declare type SimulcastConfig = { /** * whether to simulcast track or not. By default simulcast is disabled. */ enabled: boolean; /** * list of active encodings. Encoding can be one of `"h"` (original encoding), `"m"` (scaled down x2), `"l"` (scaled down x4). */ activeEncodings: TrackEncoding[]; }; /** * Type describing maximal bandwidth that can be used, in kbps. 0 is interpreted as unlimited bandwidth. */ export declare type BandwidthLimit = number; /** * Type describing bandwidth limit for simulcast track. It is a mapping `encoding -> BandwidthLimit`. If encoding isn't present in this mapping, * it will be assumed that this particular encoding shouldn't have any bandwidth limit. */ export declare type SimulcastBandwidthLimit = Map; /** * A type describing bandwidth limitation of a track, including simulcast and non-simulcast tracks. Can be `BandwidthLimit` or `SimulcastBandwidthLimit`. */ export declare type TrackBandwidthLimit = BandwidthLimit | SimulcastBandwidthLimit; export declare type ConnectionOptions = { /** * resolution + aspect ratio of local video track, one of: `QVGA_169`, `VGA_169`, `QHD_169`, `HD_169`, * `FHD_169`, `QVGA_43`, `VGA_43`, `QHD_43`, `HD_43`, `FHD_43`. Note that quality might be worse than * specified due to device capabilities, internet connection etc. * @default `VGA_169` */ quality: VideoQuality; /** * whether to flip the dimensions of the video, that is whether to film in vertical orientation. * @default `true` */ flipVideo: boolean; /** * a map `string -> any` containing user metadata to be sent to the server. Use it to send for example user display name or other options. */ userMetadata: Metadata; /** * a map `string -> any` containing video track metadata to be sent to the server. */ videoTrackMetadata: Metadata; /** * a map `string -> any` containing audio track metadata to be sent to the server. */ audioTrackMetadata: Metadata; /** * SimulcastConfig of a video track. By default simulcast is disabled. */ simulcastConfig: SimulcastConfig; /** * bandwidth limit of a video track. By default there is no bandwidth limit. */ maxBandwidth: TrackBandwidthLimit; /** * a map `string -> string` containing connection params passed to the socket. */ connectionParams: SocketConnectionParams; /** * whether to turn the speakersphone on/off. * @default `true` */ isSpeakerphoneOn: boolean; }; export declare type ScreencastOptions = { /** * Resolution + fps of screencast track, one of: `VGA`, `HD5`, `HD15`, `FHD15`, `FHD30`. * Note that quality might be worse than specified due to device capabilities, internet * connection etc. * @default `HD15`` */ quality: ScreencastQuality; /** * a map `string -> any` containing screencast track metadata to be sent to the server */ screencastMetadata: Metadata; /** * SimulcastConfig of a screencast track. By default simulcast is disabled. */ simulcastConfig: SimulcastConfig; /** * bandwidth limit of a screencast track. By default there is no bandwidth limit. */ maxBandwidth: TrackBandwidthLimit; }; /** * The hook used to manage a connection with membrane server. * @returns An object with functions to manage membrane server connection and `error` if connection failed. */ export declare function useMembraneServer(): { connect: (url: string, roomName: string, connectionOptions?: Partial | undefined) => Promise; disconnect: () => Promise; joinRoom: () => Promise; error: string | null; }; /** * This hook provides live updates of room participants. * @returns An array of room participants. */ export declare function useRoomParticipants(): Participant[]; /** * This hook can toggle camera on/off and provides current camera state. */ export declare function useCameraState(): { isCameraOn: boolean; toggleCamera: () => Promise; }; /** * This hook can toggle microphone on/off and provides current microphone state. */ export declare function useMicrophoneState(): { isMicrophoneOn: boolean; toggleMicrophone: () => Promise; }; /** * Function that's toggles between front and back camera. By default the front camera is used. * @returns A promise that resolves when camera is toggled. */ export declare function flipCamera(): Promise; /** * This hook can toggle screen sharing on/off and provides current screencast state. * @returns An object with functions to manage screencast. */ export declare function useScreencast(): { isScreencastOn: boolean; toggleScreencast: (screencastOptions?: Partial) => Promise; updateScreencastTrackMetadata: (metadata: Metadata) => Promise; toggleScreencastTrackEncoding: (encoding: TrackEncoding) => Promise; simulcastConfig: SimulcastConfig; setScreencastTrackEncodingBandwidth: (encoding: TrackEncoding, bandwidth: BandwidthLimit) => Promise; setScreencastTrackBandwidth: (bandwidth: BandwidthLimit) => Promise; }; /** * This hook manages user's metadata. Use it to for example update when user is muted etc. */ export declare function usePeerMetadata(): { updatePeerMetadata: (metadata: Metadata) => Promise; }; /** * This hook manages video track metadata. */ export declare function useVideoTrackMetadata(): { updateVideoTrackMetadata: (metadata: Metadata) => Promise; }; /** * This hook manages audio track metadata. */ export declare function useAudioTrackMetadata(): { updateAudioTrackMetadata: (metadata: Metadata) => Promise; }; /** * This hook manages audio settings. */ export declare function useAudioSettings(): { toggleSpeakerphone: () => Promise; isSpeakerphoneOn: boolean; }; /** * This hook manages the simulcast configuration of a video track. * @returns An object with functions and data to manage simulcast configuration. */ export declare function useSimulcast(): { simulcastConfig: SimulcastConfig; setTargetTrackEncoding: (trackId: string, encoding: TrackEncoding) => Promise; toggleVideoTrackEncoding: (encoding: TrackEncoding) => Promise; setVideoTrackEncodingBandwidth: (encoding: TrackEncoding, bandwidth: BandwidthLimit) => Promise; }; /** * This hook manages the bandwidth limit of a video track. */ export declare function useBandwidthLimit(): { setVideoTrackBandwidth: (bandwidth: BandwidthLimit) => Promise; }; export declare type VideoRendererProps = { /** * id of the video track which you want to render. */ trackId: string; /** * `FILL` or `FIT` - it works just like RN Image component. `FILL` fills the whole view * with video and it may cut some parts of the video. `FIT` scales the video so the whole * video is visible, but it may leave some empty space in the view. * @default `FILL` */ videoLayout?: VideoLayout; style?: ViewStyle; }; /** * A component used for rendering participant's video and audio. You can add some basic View styling. */ export declare const VideoRendererView: import("react-native").HostComponent | (() => never);