UNPKG

@chatui/core

Version:

The React library for Chatbot UI

27 lines (26 loc) 963 B
import React from 'react'; /** 语音输入状态枚举 */ export declare const VoiceInputStatus: { readonly INITED: "inited"; readonly RECORDING: "recording"; readonly WILL_CANCEL: "willCancel"; }; export type VoiceInputStatus = (typeof VoiceInputStatus)[keyof typeof VoiceInputStatus]; export interface VoiceInputHandle { stop: () => void; } export interface VoiceInputProps { /** 开始录音回调 */ onStart?: () => void; /** 结束录音回调,返回录音时长 */ onEnd?: (data: { duration: number; }) => void; /** 取消录音回调 */ onCancel?: () => void; /** 关闭面板回调 */ onClose?: () => void; /** 语音输入状态变化回调(扩展点),用于联动 Composer 输入框样式变化 */ onStatusChange?: (status: VoiceInputStatus) => void; } export declare const VoiceInput: React.ForwardRefExoticComponent<VoiceInputProps & React.RefAttributes<VoiceInputHandle>>;