import { type MutableRefObject, type RefObject } from "react"; import type { Callbacks, ClientToolsConfig, Conversation } from "@elevenlabs/client"; import type { HookOptions } from "./types.js"; type ClientToolEntry = ClientToolsConfig["clientTools"][string]; export type ConversationContextValue = { conversation: Conversation | null; /** Stable ref to the active conversation — use in callbacks to avoid re-renders. */ conversationRef: RefObject; startSession: (options?: HookOptions) => void; endSession: () => void; /** * For sub-providers — register callback handlers to be composed into the * next `Conversation.startSession()` call. Returns an unsubscribe function. */ registerCallbacks: (callbacks: Partial) => () => void; /** Registry of hook-registered client tools. Survives across sessions. */ clientToolsRegistry: Map; /** Ref to the live clientTools object currently held by BaseConversation. */ clientToolsRef: MutableRefObject>; }; export declare const ConversationContext: import("react").Context; /** * Returns the raw `Conversation` instance (or `null` if no session is active). * This is a public escape hatch for advanced use cases that need direct access * to the underlying `@elevenlabs/client` Conversation object. * * Can be used outside a `ConversationProvider` — returns `null` in that case. */ export declare function useRawConversation(): Conversation | null; /** * Returns a stable ref to the active `Conversation` instance. * The ref's `.current` is `null` when no session is active, and updates * without causing re-renders — ideal for use inside callbacks and sub-providers. * * Must be used within a `ConversationProvider`. */ export declare function useRawConversationRef(): RefObject; /** * Registers callback handlers with the nearest `ConversationProvider`. * Uses a ref internally so the latest callback values are always invoked * without re-subscribing on every render. * * Must be used within a `ConversationProvider`. */ export declare function useRegisterCallbacks(callbacks: Partial): void; export {}; //# sourceMappingURL=ConversationContext.d.ts.map