Questionnaire.Answer# const · packages/mixins-ui/src/questionnaire.ts:150
const Answer: Schema . Struct <{
readonly chosen: Schema . $Array < Schema . String >
readonly text: Schema . String
}> The options chosen and the text written, whatever the question's kind.
Questionnaire.Answered# const · packages/mixins-ui/src/questionnaire.ts:189
const Answered: Schema . Struct <{
readonly question: Schema . String
readonly chosen: Schema . $Array < Schema . String >
readonly text: Schema . String
}> One question's answer, as the submit sends it.
Questionnaire.answerOf# function · packages/mixins-ui/src/questionnaire.ts:254
function answerOf ( model: Model , question: string ) : Answer The answer to question so far.
Questionnaire.Choice# const · packages/mixins-ui/src/questionnaire.ts:58
const Choice: Schema . Struct <{
readonly value: Schema . String
readonly label: Schema . String
readonly description: Schema . OptionFromNullOr < Schema . String >
}> Questionnaire.init# function · packages/mixins-ui/src/questionnaire.ts:211
function init ( options: {
readonly id: string
readonly questions: ReadonlyArray < Question >
readonly layout?: Layout | undefined
}) : Model A questionnaire, unanswered. Question ids must be unique: an answer is
kept by its question's, and a repeat would share it, so it throws.
Questionnaire.isAnswered# function · packages/mixins-ui/src/questionnaire.ts:258
function isAnswered ( question: Question , answer: Answer ) : boolean Whether answer answers question: an option, or text that is not blank.
Questionnaire.Layout# const · packages/mixins-ui/src/questionnaire.ts:155
const Layout: Schema . Literals < readonly ['all' , 'paged' ]> Questionnaire.Message# const · packages/mixins-ui/src/questionnaire.ts:177
const Message: MessageUnion <{
readonly GotRadio: {
readonly question: Schema . String
readonly message: MessageUnion <{
readonly SelectedOption: { index: Schema . Number ; value: Schema . String }
readonly FocusedOption: { index: Schema . Number }
readonly CompletedFocusOption: {}
}>
}
readonly Toggled: {
readonly question: Schema . String
readonly value: Schema . String
}
readonly Typed: {
readonly question: Schema . String
readonly text: Schema . String
}
readonly Submitted: {}
readonly Backed: {}
readonly CompletedFocus: {}
}> Show all 21 lines Questionnaire.Model# const · packages/mixins-ui/src/questionnaire.ts:158
const Model: Schema . Struct <{
readonly id: Schema . String
readonly questions: Schema . $Array <
TaggedUnion <{
readonly Single: {
id: Schema . String
prompt: Schema . String
options: Schema . $Array <
Schema . Struct <{
readonly value: Schema . String
readonly label: Schema . String
readonly description: Schema . OptionFromNullOr < Schema . String >
}>
>
other: Schema . OptionFromNullOr < Schema . String >
optional: Schema . Boolean
}
readonly Multiple: {
id: Schema . String
prompt: Schema . String
options: Schema . $Array <
Schema . Struct <{
readonly value: Schema . String
readonly label: Schema . String
readonly description: Schema . OptionFromNullOr < Schema . String >
}>
>
other: Schema . OptionFromNullOr < Schema . String >
optional: Schema . Boolean
}
readonly Text: {
readonly id: Schema . String
readonly prompt: Schema . String
readonly placeholder: Schema . OptionFromNullOr < Schema . String >
readonly multiline: Schema . Boolean
readonly optional: Schema . Boolean
}
}>
>
readonly answers: Schema . $Record <
Schema . String ,
Schema . Struct <{
readonly chosen: Schema . $Array < Schema . String >
readonly text: Schema . String
}>
>
readonly radios: Schema . $Record <
Schema . String ,
Schema . Struct <{
readonly id: Schema . String
readonly maybeFocusedIndex: Schema . Option < Schema . Number >
}>
>
readonly layout: Schema . Literals < readonly ['all' , 'paged' ]>
readonly page: Schema . Number
readonly missing: Schema . $Array < Schema . String >
readonly submitted: Schema . Boolean
}> Show all 58 lines Questionnaire.multiple# function · packages/mixins-ui/src/questionnaire.ts:124
function multiple ( question: ChoiceQuestionInput ) : Question A multiple-choice question, its omitted fields defaulted.
Questionnaire.OutMessage# const · packages/mixins-ui/src/questionnaire.ts:195
const OutMessage: MessageUnion <{
readonly Answered: {
readonly answers: Schema . $Array <
Schema . Struct <{
readonly question: Schema . String
readonly chosen: Schema . $Array < Schema . String >
readonly text: Schema . String
}>
>
}
}> Questionnaire.Question# const · packages/mixins-ui/src/questionnaire.ts:76
const Question: TaggedUnion <{
readonly Single: {
id: Schema . String
prompt: Schema . String
options: Schema . $Array <
Schema . Struct <{
readonly value: Schema . String
readonly label: Schema . String
readonly description: Schema . OptionFromNullOr < Schema . String >
}>
>
other: Schema . OptionFromNullOr < Schema . String >
optional: Schema . Boolean
}
readonly Multiple: {
id: Schema . String
prompt: Schema . String
options: Schema . $Array <
Schema . Struct <{
readonly value: Schema . String
readonly label: Schema . String
readonly description: Schema . OptionFromNullOr < Schema . String >
}>
>
other: Schema . OptionFromNullOr < Schema . String >
optional: Schema . Boolean
}
readonly Text: {
readonly id: Schema . String
readonly prompt: Schema . String
readonly placeholder: Schema . OptionFromNullOr < Schema . String >
readonly multiline: Schema . Boolean
readonly optional: Schema . Boolean
}
}> Show all 35 lines Questionnaire.QuestionnaireSlots# const · packages/mixins-ui/src/questionnaire.ts:34
const QuestionnaireSlots: Slots . Contract <{ readonly root: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly title: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly progress: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly question: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly prompt: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Interactive" , readonly [Capability . Capability < "Base" , readonly []> ]> ]>, readonly Slot . EventName [], readonly Slot . AttributeName [], readonly Slot . RequirementName [], boolean >; readonly words: Slot . UnnamedSlot < Capability . Capability < "Container" , readonly [Capability . Capability < "Intera …; An assistant asking the reader structured questions in the chat, as
Claude Code's and ChatGPT's clarifying questions: a single choice (the
package's RadioGroup), a multiple choice (its CheckboxGroup), or free text
(its Input or Textarea), each choice question with an optional "Other"
field, asked all at once or one at a time, and sent with a submit. The
questions, the answers so far and the radio groups' focus are a Model of
this module's, which the application keeps and folds with update; once
every question that must be is answered, the submit comes out as
OutMessage.Answered, and the form gives way to a summary of the answers.
A submit with one missing says so beside it and moves the focus to it, as
Next does to the next question. The parts the reused components draw are
styled by their own recipes, passed beside this one's style.
Questionnaire.QuestionnaireView# interface · packages/mixins-ui/src/questionnaire.ts:446
interface QuestionnaireView < Message > {
readonly model: Model
readonly onMessage : ( message: typeof Message. Type) => NoInfer < Message >
readonly title?: string | undefined
readonly words?: Partial < QuestionnaireWords > | undefined
readonly style?: NamedStyle < typeof QuestionnaireSlots> | undefined
readonly mixins?: MixinList < Message > | undefined
readonly radioGroup?: NamedStyle < typeof RadioGroupSlots> | undefined
readonly checkboxGroup?: NamedStyle < typeof CheckboxGroupSlots> | undefined
readonly input?: NamedStyle < typeof InputSlots> | undefined
readonly textarea?: NamedStyle < typeof TextareaSlots> | undefined
readonly button?: NamedStyle < typeof ButtonSlots> | undefined
readonly submitButton?: NamedStyle < typeof ButtonSlots> | undefined
} Questionnaire.QuestionnaireWords# interface · packages/mixins-ui/src/questionnaire.ts:425
interface QuestionnaireWords {
readonly submit: string
readonly next: string
readonly back: string
readonly missing: string
readonly skipped: string
readonly progress: string
} The text a questionnaire draws that is not a question's.
Questionnaire.single# function · packages/mixins-ui/src/questionnaire.ts:114
function single ( question: ChoiceQuestionInput ) : Question A single-choice question, its omitted fields defaulted.
Questionnaire.text# function · packages/mixins-ui/src/questionnaire.ts:134
function text ( question: {
readonly id: string
readonly prompt: string
readonly placeholder?: string | undefined
readonly multiline?: boolean | undefined
readonly optional?: boolean | undefined
}) : Question A free-text question, its omitted fields defaulted.
Questionnaire.update# function · packages/mixins-ui/src/questionnaire.ts:302
function update ( model: Model , message: Message ) : Return The questionnaire after message; the same Model when nothing changes.
Questionnaire.view# function · packages/mixins-ui/src/questionnaire.ts:481
function view < Outer >(
options: QuestionnaireView < Outer >,
h: HtmlBuilder < Outer >,
) : Html Questionnaire.words# const · packages/mixins-ui/src/questionnaire.ts:437
const words = { submit, next, back, missing, skipped, progress }