/** * @karaoke-migrate/kar-player * * KAR (Karaoke) file player library * * Features: * - Parse KAR files (MIDI + lyrics) * - Play MIDI audio using SpessaSynth * - Render synchronized lyrics * - Background playback support */ import { MIDIPlayer } from './core/MIDIPlayer'; import type { KaraokePlayerConfig, KaraokePlayerState, LoadKarFileResult } from './types'; declare const KarFile: any; declare const MIDIFile: any; export { KarFile, MIDIFile, MIDIPlayer }; export { convertEmkToKarBrowser, isEmkFile, isEmkFilename, getFileExtension, type EmkConversionResult } from './utils/EmkConverter'; export { SpessaSynthWrapper } from './utils/SpessaSynthWrapper'; export { AudioContextGuard, type AudioContextGuardConfig, type AudioContextState } from './utils/AudioContextGuard'; export { SequencerTimingHelper, type TimeSource } from './utils/SequencerTimingHelper'; export { LyricRenderer } from './utils/LyricRenderer'; export { PageVisibilityManager, getPageVisibilityManager, enableSmoothTabSwitching, type PageVisibilityOptions } from './utils/PageVisibilityManager'; export { loadGoogleFont, applyFontToLyrics, getFontConfig, getFontFamily, isValidThaiFont, getAvailableThaifonts, autoLoadFontFromEnv, THAI_FONTS } from './utils/GoogleFonts'; export type { ThaiGoogleFont } from './utils/GoogleFonts'; export { isThaiVowelOrDiacritic, isOnlyThaiVowels, mergeThaiVowelsWithPreviousParts, normalizeThaiText, splitThaiText } from './utils/ThaiTextUtils'; export { isProduction, devLog, devWarn, devError, rafThrottle, debounce, shallowArrayEqual, isLowEndDevice, requestIdleCallback, cancelIdleCallback, getGPUOptimizedStyle, batchDOMUpdates } from './utils/PerformanceOptimizer'; export { DOMElementPool, LazyRenderer, WeakCache, FrameBudgetManager, VirtualScroller, AdaptiveQuality, BatchScheduler, MemoryMonitor } from './utils/AdvancedPerformance'; export { MIDIEventCache, InstrumentCache, LyricCache, SeekOptimizer, ProgressivePreloader } from './utils/PreloadCache'; export type { PreloadRange, CacheStats } from './utils/PreloadCache'; export { LyricHighlighter, getLyricAtTime, getLyricsInRange, getLyricsDuration, searchLyrics, useLyricHighlight, useLyricRenderer, useLyricRendererOptimized, useLyricText, defaultTheme, karaokeTheme, minimalTheme, extremeKaraokeTheme, themes, getTheme, registerTheme, loadEnvConfig, envConfigToDisplayOptions, envConfigToTheme, createThemeFromEnv, loadDisplayOptionsFromEnv, mergeWithEnvConfig } from './components'; export type { UseLyricHighlightOptions, UseLyricHighlightReturn, UseLyricRendererOptions, UseLyricRendererReturn, UseLyricRendererOptimizedOptions, UseLyricRendererOptimizedReturn, UseLyricTextOptions, UseLyricTextReturn, LyricTextElement, EnvLyricConfig } from './components'; export type { KaraokePlayerConfig, KaraokePlayerState, LoadKarFileResult, KarFileLyricLine, KarFileLyricPart, KarFileMidiData, MIDISong, MIDITrack, MIDINote, MIDIBeat, MIDIBeatNote, LyricLine, LyricPart } from './types'; /** * Main KaraokePlayer class */ export declare class KaraokePlayer { private midiPlayer; private spessaWrapper; private audioGuard; private lyricRenderer; private timingHelper; private audioContext; private state; private onStateChange?; constructor(config: KaraokePlayerConfig); /** * Initialize SpessaSynth and load soundfont * @param soundFont - URL string or ArrayBuffer of the soundfont file * @param bankName - SoundFont bank name (default: 'main') * @param processorUrl - Required URL to spessasynth_processor.min.js */ loadSoundFont(soundFont: string | ArrayBuffer, bankName: string | undefined, processorUrl: string): Promise; /** * Load KAR file */ loadKarFile(buffer: ArrayBuffer | Uint8Array): Promise; /** * Set lyric renderer container */ setLyricContainer(container: HTMLElement): void; /** * Play */ play(): Promise; /** * Pause */ pause(): void; /** * Stop */ stop(): void; /** * Seek to position */ seek(time: number): void; /** * Set volume (0.0 - 1.0) */ setVolume(volume: number): void; /** * Get current state */ getState(): KaraokePlayerState; /** * Set state change callback */ onStateChangeCallback(callback: (state: KaraokePlayerState) => void): void; /** * Cleanup */ destroy(): void; }