UNPKG

@fremtind/jkl-feedback-react

Version:
20 lines (19 loc) 735 B
import { Dispatch, SetStateAction } from "react"; import { FeedbackAnswer, FeedbackOption, FollowupQuestion } from "../types"; type CurrentValue = FeedbackOption<string | number> | FeedbackOption<string | number>[] | undefined; type Followup = { questions: FollowupQuestion[]; values: FeedbackAnswer[] | undefined; step: { number: number; question: FollowupQuestion; isLast: boolean; }; currentValue: CurrentValue; setCurrentValue: Dispatch<SetStateAction<CurrentValue>>; submitted: boolean; handleNext: () => void; handleAbort: () => void; }; export declare const useFollowup: (questions: FollowupQuestion[], onSubmit: (a: FeedbackAnswer[]) => void) => Followup; export {};