import { Vowel } from '../core/VowelClient'; /** * Configuration passed to the factory function */ export interface VowelFactoryConfig { /** App ID from the web component attribute */ appId: string; /** The web component DOM element */ element: HTMLElement; /** Position of the floating button */ position?: string; /** Any additional config from web component attributes */ [key: string]: any; } /** * Factory function that creates and returns a Vowel client instance * Can be async to support dynamic imports or API calls */ export type VowelFactory = (config: VowelFactoryConfig) => Promise | Vowel; /** * Registry for storing and retrieving the Vowel client factory function */ declare class VowelFactoryRegistry { private factory; private eventTarget; /** * Register a factory function * * @param factory - Function that creates and returns a Vowel client * * @example * ```typescript * window.registerVowelFactory(async (config) => { * const vowel = new window.Vowel({ * appId: config.appId, * _voiceConfig: { * provider: 'vowel-prime', * model: 'openai/gpt-oss-120b', * }, * }); * * // Register custom actions * vowel.registerAction('myAction', { ... }, handler); * * return vowel; * }); * ``` */ registerFactory(factory: VowelFactory): void; /** * Get the registered factory function * * @returns The factory function, or null if none registered */ getFactory(): VowelFactory | null; /** * Check if a factory has been registered * * @returns true if a factory is registered */ hasFactory(): boolean; /** * Wait for factory to be registered * * @param timeoutMs - Maximum time to wait in milliseconds (default: 30000) * @returns Promise that resolves with the factory when registered */ waitForFactory(timeoutMs?: number): Promise; /** * Clear the registered factory * Useful for testing or resetting state */ clearFactory(): void; } /** * Global singleton instance of the factory registry */ export declare const vowelFactoryRegistry: VowelFactoryRegistry; /** * Type augmentation for window object */ declare global { interface Window { registerVowelFactory: (factory: VowelFactory) => void; } } export {}; //# sourceMappingURL=VowelFactoryRegistry.d.ts.map