UNPKG

@anoki/fse-common

Version:

Common types for FSE

37 lines (33 loc) 773 B
import { Answer, Question } from './question' import { RatingProps } from './rating' import { WithMongooseProps } from './with-mongoose-props' export type AnswerResponse = { rating: number closedAnswer: Array<string> openAnswer: string } export type FeedBackProps = RatingProps & { question: string questions: Question[] | [] buttons: { next: string previous: string } loadingMessage: string successMessage: string errorMessage: string maxCharactersMessage?: string isLoading?: boolean hasError?: boolean onSend: (value: AnswerResponse) => void openAnswerPlaceholder: string } export type SendAnswer = { id: string answer: Array<Answer> } export type Feedback = WithMongooseProps< AnswerResponse & { pageUrl: string } >