UNPKG

vlibras-player-nextjs

Version:

VLibras Player para Next.js - Biblioteca moderna para tradução de texto em Libras com callbacks de estado

43 lines (42 loc) 1.14 kB
import type { UnityPlayerInstance } from '@/types'; export interface UnityLoaderConfig { targetPath: string; gameContainer: HTMLElement; onSuccess: (_player: UnityPlayerInstance) => void; onError: (_error: string) => void; onProgress?: (_progress: number) => void; } /** * Gerencia o carregamento do Unity WebGL Player */ export declare class UnityLoader { private static loadedScripts; /** * Carrega e inicializa o Unity WebGL Player */ static loadPlayer(config: UnityLoaderConfig): Promise<void>; /** * Carrega o script do Unity Loader */ private static loadUnityScript; /** * Aguarda o UnityLoader estar disponível no window */ private static waitForUnityLoader; /** * ✅ MELHORADO: Configura o container do jogo com ID estável */ private static setupGameContainer; /** * Junta URLs de forma segura */ private static joinUrl; /** * Verifica se o navegador suporta WebGL */ static checkWebGLSupport(): boolean; /** * Remove todos os scripts Unity carregados */ static cleanup(): void; }