@voxket-ai/voxket-live
Version:
A React widget for embedding Voxket-powered audio/video/chat experiences.
102 lines (101 loc) • 3.36 kB
TypeScript
import { VoxketClient } from '../core/client';
export interface UseVoxketClientProps {
client: VoxketClient;
}
/**
* Hook to get publish permissions
* Replaces usePublishPermissions from LiveKit
*/
export declare function useVoxketPublishPermissions(client: VoxketClient): {
camera: boolean;
microphone: boolean;
screenShare: boolean;
data: boolean;
};
/**
* Hook to get local participant
* Replaces useLocalParticipant from LiveKit
*/
export declare function useVoxketLocalParticipant(client: VoxketClient): {
localParticipant: import('livekit-client').LocalParticipant | null;
microphoneTrack: import('livekit-client').LocalTrack<import("livekit-client").Track.Kind> | null | undefined;
};
/**
* Hook for track toggle functionality
* Replaces useTrackToggle from LiveKit
*/
export declare function useVoxketTrackToggle(client: VoxketClient, source: 'microphone' | 'camera' | 'screenShare', options?: {
onDeviceError?: (error: Error) => void;
}): {
enabled: boolean;
pending: boolean;
toggle: (forceEnabled?: boolean) => Promise<void>;
};
/**
* Hook for room context
* Replaces useRoomContext from LiveKit
*/
export declare function useVoxketRoom(client: VoxketClient): import('livekit-client').Room | null;
/**
* Hook for device selection
* Replaces useMediaDeviceSelect from LiveKit
*/
export declare function useVoxketMediaDeviceSelect(client: VoxketClient, kind: 'audioinput' | 'videoinput'): {
devices: MediaDeviceInfo[];
activeDeviceId: string;
setActiveMediaDevice: (deviceId: string) => Promise<void>;
};
/**
* Hook for persistent user choices
* Replaces usePersistentUserChoices from LiveKit
*/
export declare function useVoxketPersistentUserChoices(options?: {
preventSave?: boolean;
}): {
saveAudioInputEnabled: (enabled: boolean) => void;
saveAudioInputDeviceId: (deviceId: string) => void;
saveVideoInputEnabled: (enabled: boolean) => void;
saveVideoInputDeviceId: (deviceId: string) => void;
};
/**
* Hook for voice assistant state
* Replaces useVoiceAssistant from LiveKit
*/
export declare function useVoxketVoiceAssistant(client: VoxketClient): {
agent: {
isActive: boolean;
info: import('..').AgentInfo | null;
};
session: import('..').VoxketSession | null;
state: "idle" | "thinking" | "speaking";
audioTrack: {
source: import("livekit-client").Track.Source;
participant: import('livekit-client').RemoteParticipant;
publication: import('livekit-client').RemoteTrackPublication;
} | null;
videoTrack: {
source: import("livekit-client").Track.Source;
participant: import('livekit-client').RemoteParticipant;
publication: import('livekit-client').RemoteTrackPublication;
} | null;
};
/**
* Hook for managing video tracks using VoxketClient methods
*/
export declare function useVoxketVideoTracks(client: VoxketClient): {
videoTrackRefs: {
source: import("livekit-client").Track.Source;
participant: any;
publication: any;
}[];
cameraTrackRefs: {
source: import("livekit-client").Track.Source;
participant: any;
publication: any;
}[];
screenShareTrackRefs: {
source: import("livekit-client").Track.Source;
participant: any;
publication: any;
}[];
};