UNPKG

@huddle01/web-core

Version:

The Huddle01 Javascript SDK offers a comprehensive suite of methods and event listeners that allow for seamless real-time audio and video communication with minimal coding required.

94 lines (91 loc) 2.75 kB
import LocalPeer from './LocalPeer.js'; import Socket from './Socket.js'; import { R as Room } from './common.types.d-C_43okHS.js'; import { HandlerFactory } from 'mediasoup-client/lib/types'; import 'mediasoup-client'; import 'types/dist/common.types'; import './DeviceHandler.js'; import './common-js/EnhancedEventEmitter.js'; import './Transport.js'; import './Consumer.js'; import 'mediasoup-client/lib/RtpParameters'; import './common-js/EnhancedMap.js'; import './types/common.types.js'; import './RemotePeer.js'; import './Bot.js'; import 'mediasoup-client/lib/DataConsumer'; import 'mediasoup-client/lib/DataProducer'; import 'types/dist/clientToSushiEvents'; import 'types/dist/sushiToClientEvents'; import 'types/dist/socket.types'; import 'zod'; import './ActiveSpeakers.js'; declare class HuddleClient { /** * Connection Manager Instance, Hanlder socket connection and stores information about the connection */ private __socket; /** * Room Instance, Handles the room and its connection */ private __room; /** * Local Peer Instance, Handles the local peer and its connection */ private __localPeer; /** * Project Id of the Huddle01 Project */ projectId: string; /** * Returns the underlying socket connection * @throws { Error } If the socket connection is not initialized */ get socket(): Socket; /** * Returns the room instance, throws an error if the room is not created * @throws { Error } If the room is not created, Call createRoom() method before you can access the room */ get room(): Room; get localPeer(): LocalPeer; /** * Room Id of the current room */ get roomId(): string | null; /** * Set a new region for the Huddle01 Media Servers */ setRegion: (region: string) => void; constructor(data: { projectId: string; options?: { huddle_api_url?: string; logging?: boolean; autoConsume?: boolean; activeSpeakers?: { size: number; }; volatileMessaging?: boolean; wsPolyfill?: typeof WebSocket; handlerFactory?: HandlerFactory; }; }); /** * Default method to connect to the Huddle01 Media Room. * * This method connects to socket, creates a room, and then connects to the room; */ joinRoom: (data: { roomId: string; token: string; }) => Promise<Room>; /** * Leave the room and disconnect from the socket */ leaveRoom: () => void; /** * Close the room and disconnect from the socket */ closeRoom: () => void; } export { HuddleClient as default };