@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.
34 lines (31 loc) • 878 B
TypeScript
import { TPermissions } from 'types/dist/common.types';
declare const useLocalPeer: <T = unknown>(props?: {
onMetadataUpdated?: (metadata: T) => void;
onPermissionsUpdated?: (permissions: TPermissions) => void;
onRoleUpdated?: (role: string) => void;
}) => {
peerId: string | null;
role: string | null;
permissions: {
admin: boolean;
canConsume: boolean;
canProduce: boolean;
canProduceSources: {
cam: boolean;
mic: boolean;
screen: boolean;
};
canSendData: boolean;
canRecvData: boolean;
canUpdateMetadata: boolean;
};
metadata: T | null;
updateMetadata: (data: T) => Promise<void>;
updateRole: (data: {
role: string;
options?: {
custom: TPermissions;
};
}) => void;
};
export { useLocalPeer };