Refactored modules and updated loader.
This commit is contained in:
@@ -6,7 +6,10 @@ import { TTSHandlerModule } from './tts-handler-module.js';
|
||||
|
||||
export class KokoroTTSModule extends TTSHandlerModule {
|
||||
constructor() {
|
||||
super('kokoro', 'Kokoro TTS');
|
||||
super('kokoro-tts', 'Kokoro TTS');
|
||||
|
||||
// Declare proper dependencies according to architecture principles
|
||||
this.dependencies = ['persistence-manager', 'localization'];
|
||||
|
||||
// State
|
||||
this.iframe = null;
|
||||
@@ -641,17 +644,6 @@ export class KokoroTTSModule extends TTSHandlerModule {
|
||||
}
|
||||
}
|
||||
|
||||
// Register the module with the module registry
|
||||
// Module registry MUST be accessed via window, not direct import
|
||||
if (window.moduleRegistry) {
|
||||
try {
|
||||
// Create instance first, then register it
|
||||
const kokoroTTSModule = new KokoroTTSModule();
|
||||
window.moduleRegistry.register(kokoroTTSModule);
|
||||
console.log('Kokoro TTS Module registered successfully');
|
||||
} catch (err) {
|
||||
console.error('Failed to register Kokoro TTS Module:', err);
|
||||
}
|
||||
} else {
|
||||
console.error('Module registry not available when attempting to register Kokoro TTS Module');
|
||||
}
|
||||
const kokoroTTSModule = new KokoroTTSModule();
|
||||
|
||||
export { kokoroTTSModule };
|
||||
Reference in New Issue
Block a user