@anoki/fse-common
Version:
Common types for FSE
32 lines (31 loc) • 832 B
TypeScript
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;
}>;