/**
 * DigitalHumanSubtitleOverlay.ts — DigitalHuman 字幕叠加层
 *
 * 在虚拟人头像容器上渲染助手/用户字幕气泡，支持打字机逐字显示、思考动画、
 * 括号动作文本剥离、自动隐藏等。被 DigitalHuman 主类使用。
 */
/** 字幕叠加层注入的 CSS（含助手/用户气泡样式与思考动画） */
export declare const DIGITAL_HUMAN_SUBTITLE_CSS = "\n.dh-avatar-root .dh-subtitle-root {\n  position: absolute;\n  inset: 0;\n  z-index: var(--dh-subtitle-z-index, 20);\n  pointer-events: none;\n  overflow: visible;\n}\n.dh-avatar-root .dh-subtitle-slot {\n  position: absolute;\n  pointer-events: none;\n  opacity: 0;\n  transition: opacity 0.24s ease;\n  max-width: var(--dh-subtitle-max-width, 40%);\n}\n.dh-avatar-root .dh-subtitle-slot.dh-subtitle-visible { opacity: 1; }\n.dh-avatar-root .dh-subtitle-assistant-slot {\n  top: var(--dh-subtitle-assistant-top, 5%);\n  left: var(--dh-subtitle-assistant-left, 3%);\n}\n.dh-avatar-root .dh-subtitle-user-slot {\n  left: var(--dh-subtitle-user-left, 3%);\n  bottom: var(--dh-subtitle-user-bottom, 10%);\n  max-width: var(--dh-subtitle-user-max-width, 35%);\n}\n.dh-avatar-root .dh-subtitle-bubble {\n  box-sizing: border-box;\n  max-height: var(--dh-subtitle-max-height, 42vh);\n  overflow: hidden;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n  white-space: pre-wrap;\n  text-align: left;\n  backdrop-filter: blur(8px);\n  -webkit-backdrop-filter: blur(8px);\n  pointer-events: none;\n  letter-spacing: 0;\n}\n.dh-avatar-root .dh-subtitle-assistant {\n  background: var(--dh-subtitle-assistant-bg, rgba(255, 255, 255, 0.92));\n  color: var(--dh-subtitle-assistant-color, #222);\n  font-size: var(--dh-subtitle-assistant-font-size, clamp(14px, 3.4vw, 24px));\n  line-height: 1.55;\n  padding: var(--dh-subtitle-assistant-padding, 12px 16px);\n  border-radius: var(--dh-subtitle-assistant-radius, 16px 16px 0 16px);\n  box-shadow: var(--dh-subtitle-assistant-shadow, 0 4px 18px rgba(0, 0, 0, 0.14));\n}\n.dh-avatar-root .dh-subtitle-user {\n  background: var(--dh-subtitle-user-bg, rgba(0, 0, 0, 0.66));\n  color: var(--dh-subtitle-user-color, #fff);\n  font-size: var(--dh-subtitle-user-font-size, clamp(12px, 2.8vw, 20px));\n  line-height: 1.5;\n  padding: var(--dh-subtitle-user-padding, 8px 14px);\n  border-radius: var(--dh-subtitle-user-radius, 12px);\n}\n.dh-avatar-root .dh-subtitle-thinking {\n  display: inline-block;\n  background: linear-gradient(90deg, rgba(0,0,0,0.25), rgba(0,0,0,0.75), rgba(0,0,0,0.25));\n  background-size: 200% 100%;\n  -webkit-background-clip: text;\n  background-clip: text;\n  color: transparent;\n  animation: dh-subtitle-thinking 1.2s linear infinite;\n}\n@keyframes dh-subtitle-thinking {\n  from { background-position: 200% 0; }\n  to { background-position: -200% 0; }\n}\n";
/** 字幕配置 */
export interface SubtitleConfig {
    enabled: boolean;
    showUser: boolean;
    showAssistant: boolean;
    showThinking: boolean;
    typewriter: boolean;
    charIntervalMs: number;
    autoHideDelayMs: number;
    userAutoHideDelayMs: number;
    stripBracketText: boolean;
    pointerEvents: 'none' | 'auto';
    dismissOnClick: boolean;
    clearOnStandby: boolean;
    thinkingText: string;
}
/** 字幕更新数据 */
export interface SubtitleUpdateData {
    text?: string;
    isUser?: boolean;
    roundId?: string | number;
    /** 用户字幕是否为最终结果（决定是否自动隐藏） */
    definite?: boolean;
    [key: string]: unknown;
}
/** DigitalHuman owner 需提供的最小接口 */
export interface SubtitleOwner {
    _avatarRoot?: HTMLElement | null;
    [key: string]: unknown;
}
/** Agent 状态码映射（由 DigitalHuman/AIChatRTC 传入） */
export interface AgentStateMap {
    SPEAKING?: number;
    FINISHED?: number;
    INTERRUPTED?: number;
    [key: string]: number | undefined;
}
export default class DigitalHumanSubtitleOverlay {
    owner: SubtitleOwner;
    root: HTMLDivElement | null;
    userSlot: HTMLDivElement | null;
    userText: HTMLDivElement | null;
    assistantSlot: HTMLDivElement | null;
    assistantText: HTMLDivElement | null;
    userHideTimer: ReturnType<typeof setTimeout> | null;
    assistantHideTimer: ReturnType<typeof setTimeout> | null;
    rafId: number;
    revealStartTime: number;
    targetText: string;
    displayText: string;
    revealIndex: number;
    textCompleteReceived: boolean;
    thinkingVisible: boolean;
    lastRoundId: string;
    config: SubtitleConfig;
    constructor(owner: SubtitleOwner, config?: Partial<SubtitleConfig> | boolean);
    /** 设置/合并字幕配置；true/false 作为 enabled 快捷开关 */
    setConfig(config?: Partial<SubtitleConfig> | boolean): SubtitleConfig;
    /** 获取当前配置副本 */
    getConfig(): SubtitleConfig;
    /** 把字幕 DOM 挂载到头像容器 */
    attachRoot(avatarRoot: HTMLElement): void;
    /** 确保 DOM 已挂载，返回是否就绪 */
    private _ensure;
    private _syncPointerEvents;
    /** 清理文本：剥离括号动作段 + 去除 `*` */
    private _cleanText;
    private _show;
    private _hide;
    /** 显示"思考中"动画 */
    showThinking(): void;
    /** 隐藏思考动画 */
    hideThinking(): void;
    /** 统一字幕更新入口（按 isUser 分发） */
    updateSubtitle(data?: SubtitleUpdateData): void;
    /** 更新用户字幕 */
    updateUser(text: string, data?: SubtitleUpdateData): void;
    /** 更新助手字幕（支持流式增量 + 打字机显示） */
    updateAssistant(text: string, data?: SubtitleUpdateData): void;
    private _resetAssistantText;
    /** 启动打字机逐字揭示（基于 requestAnimationFrame） */
    private _startReveal;
    private _cancelReveal;
    /** 立即显示完整助手文本（非打字机模式或强制刷新） */
    private _flushAssistant;
    /** 标记本轮文本已接收完毕 */
    markTextComplete(): void;
    /** 标记最终态：立即刷完助手文本并调度用户字幕自动隐藏 */
    markFinal(): void;
    /** 根据语音 Agent 状态码联动字幕（思考/最终态） */
    handleVoiceState(data?: {
        code?: number;
    }, AGENT_STATE?: AgentStateMap): void;
    private _scheduleAssistantHide;
    /** 隐藏用户字幕 */
    hideUser(): void;
    /** 隐藏助手字幕 */
    hideAssistant(): void;
    /** 清空所有字幕状态与定时器 */
    clear(): void;
    /** 从 DOM 移除字幕容器 */
    destroyDom(): void;
    /** 完全销毁（清状态 + 移除 DOM） */
    destroy(): void;
}
//# sourceMappingURL=DigitalHumanSubtitleOverlay.d.ts.map