Member Junction
    Preparing search index...

    Optional injection points so the loader is unit-testable without a network/runtime.

    interface WidgetMountDeps {
        scheduler?: (cb: () => void, delayMs: number) => void;
        sessionClientFactory?: (
            apiUrl: string,
            widgetKey: string,
        ) => WidgetSessionClient;
        transportFactory?: (
            apiUrl: string,
        ) => IWidgetTransport | Promise<IWidgetTransport>;
        voiceControllerFactory?: (
            session: WidgetSession,
        ) => IVoiceController | Promise<IVoiceController>;
    }
    Index

    Properties

    scheduler?: (cb: () => void, delayMs: number) => void

    Schedules refresh (defaults to setTimeout); tests can stub.

    sessionClientFactory?: (
        apiUrl: string,
        widgetKey: string,
    ) => WidgetSessionClient

    Builds the session client (defaults to the real fetch-based one).

    transportFactory?: (
        apiUrl: string,
    ) => IWidgetTransport | Promise<IWidgetTransport>

    Builds the transport (defaults to RuntimeWidgetTransport; tests inject a mock). May be async (the default lazy-loads).

    voiceControllerFactory?: (
        session: WidgetSession,
    ) => IVoiceController | Promise<IVoiceController>

    Builds the voice controller for voice-enabled instances (defaults to RealtimeVoiceController). May be async (the default lazy-loads).