export interface ModelParam { modelToUse: string; threshold: number; bufferCount: number; onKeywordDetected: (result: { prediction: number; model: string; cntBuf: number; }) => void; } export interface KeywordDetectorHealth { activated: boolean; listening: boolean; initialized: boolean; licensed: boolean; audio: { isReceiving: boolean; lastReceivedAt: string | null; msSinceLastReceived: number | null; framesReceived: number; samplesReceived: number; }; wakeWord: { isProcessing: boolean; lastPredictionAt: string | null; msSinceLastPrediction: number | null; predictionsCalculated: number; lastPrediction: { model: string; score: number; threshold: number; fakeThreshold: number; aboveThreshold: boolean; consecutiveMatches: number; at: string; } | null; lastKeywordDetectedAt: string | null; detections: number; }; lastError: { message: string; at: string | null; } | null; } export class KeywordDetector { constructor( modelsFolderPath: string, modelToUse: string, threshold: number, bufferCount: number, onKeywordDetected: (result: { prediction: number; model: string; cntBuf: number; }) => void, wasmBasePath?: string, audioWorkletPath?: string ); constructor( modelsFolderPath: string, modelParams: ModelParam[], wasmBasePath?: string, audioWorkletPath?: string ); setLicense(licenseKey: string): Promise; init(): Promise; startListening(): Promise; stopListening(): Promise; getHealth(): Promise; }