/** * [WHO]: Output: exports UserQuestion types and constants; Inputs: none (type-only module) * [FROM]: react * [TO]: CLI `add` copy target; canonical implementation in `src/components` * [HERE]: registry/chat/user-question - single source for types * * [PROTOCOL]: * 1. Keep this P3 header in sync when the public contract changes. * 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change. * 3. Follow design tokens and explicit type exports. */ import type { ReactNode } from 'react'; /** 单个问题的选项 */ export interface UserQuestionOption { label: string; description?: string; } /** 单个问题 */ export interface UserQuestionItem { question: string; header?: string; options: UserQuestionOption[]; multiSelect?: boolean; /** 是否允许用户自定义输入(默认 true) */ allowCustomInput?: boolean; } export interface UserQuestionLabels { multiSelect?: string; singleSelect?: string; questionHeader?: string; skipAll?: string; continue?: string; submit?: string; sending?: string; customInputPlaceholder?: string; recommend?: string; } export declare const DEFAULT_LABELS: Required; /** 跳过问题时填充的默认值 */ export declare const NO_PREFERENCE_VALUE = "[No preference]"; export interface UserQuestionProps { questions: UserQuestionItem[]; resetKey?: string; onAnswer: (answers: Record) => void; onSkip: () => void; hasCustomText?: boolean; labels?: UserQuestionLabels; chat4Icon?: ReactNode; arrowUpSIcon?: ReactNode; arrowDownSIcon?: ReactNode; sparklingIcon?: ReactNode; } export interface UserQuestionHandle { getAnswers: () => Record; }