/** * Type declarations for the ReachyMini SDK loaded from a CDN script tag in * index.html. We only expose what we actually consume here. */ export interface RobotInfo { id: string; meta?: { name?: string }; } export interface RobotState { head: { roll: number; pitch: number; yaw: number }; antennas: { right: number; left: number }; } export interface ReachyMiniOptions { signalingUrl?: string; enableMicrophone?: boolean; clientId?: string; appName?: string; } export interface ReachyMiniInstance extends EventTarget { readonly state: "disconnected" | "connected" | "streaming"; readonly robots: RobotInfo[]; readonly username: string | null; readonly isAuthenticated: boolean; readonly micSupported: boolean; readonly micMuted: boolean; readonly audioMuted: boolean; /** Internal RTCPeerConnection used for the robot peer (audio + data). */ _pc: RTCPeerConnection | null; authenticate(): Promise; /** * Redirect to HF OAuth. The clientId comes from the constructor option, or * (when omitted) from `window.huggingface.variables.OAUTH_CLIENT_ID` * which HF Spaces injects at runtime. */ login(): Promise; logout(): void; connect(token?: string): Promise; disconnect(): void; startSession(robotId: string): Promise; stopSession(): Promise; attachVideo(el: HTMLVideoElement): () => void; setHeadPose(roll: number, pitch: number, yaw: number): boolean; setAntennas(right: number, left: number): boolean; playSound(file: string): boolean; sendRaw(data: unknown): boolean; setAudioMuted(muted: boolean): void; setMicMuted(muted: boolean): void; } export type ReachyMiniConstructor = new ( options?: ReachyMiniOptions, ) => ReachyMiniInstance; declare global { interface Window { ReachyMini: ReachyMiniConstructor; huggingface?: { variables?: { OAUTH_CLIENT_ID?: string; OAUTH_SCOPES?: string; SPACE_HOST?: string; SPACE_ID?: string; }; }; } } export {};