UNPKG

@huddle01/react

Version:

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

26 lines (23 loc) 883 B
import * as _huddle01_web_core_types from '@huddle01/web-core/types'; import { CustomMediaDevice, StreamPermissionsError } from '@huddle01/web-core/types'; interface Props { type: CustomMediaDevice; onPermissionGranted?: () => void; onPermissionDenied?: () => void; onDeviceChanged?: (deviceId: string) => void; } declare const useDevices: (props: Props) => { devices: MediaDeviceInfo[]; refreshDevices: () => void; preferredDeviceId: string | null; preferredDevice: MediaDeviceInfo | null; fetchStream: (data: { mediaDeviceKind: Exclude<CustomMediaDevice, "speaker">; }) => Promise<_huddle01_web_core_types.FetchStreamResponse>; getPermission: () => Promise<{ permission: "granted" | "denied"; error?: StreamPermissionsError; }>; setPreferredDevice: (deviceId: string) => void; }; export { useDevices };