UNPKG

@fishjam-cloud/react-client

Version:
35 lines 1.13 kB
import type { GenericMetadata } from "@fishjam-cloud/ts-client"; export interface JoinRoomConfig<PeerMetadata extends GenericMetadata = GenericMetadata> { /** * Token received from server (or Room Manager) */ peerToken: string; /** * String indexed record with metadata, that will be available to all other peers */ peerMetadata?: PeerMetadata; } /** * Hook allows to join or leave a room and check the current connection status. * @category Connection * @group Hooks */ export declare function useConnection(): { /** * Join room and start streaming camera and microphone */ joinRoom: <PeerMetadata extends GenericMetadata = GenericMetadata>({ peerToken, peerMetadata, }: JoinRoomConfig<PeerMetadata>) => Promise<void>; /** * Leave room and stop streaming */ leaveRoom: () => void; /** * Current peer connection status */ peerStatus: import("..").PeerStatus; /** * Current reconnection status */ reconnectionStatus: import("@fishjam-cloud/ts-client").ReconnectionStatus; }; //# sourceMappingURL=useConnection.d.ts.map