Files
web2.0-frontend/src/components/Widgets/SignupQuestionsWidget/common.ts
T
2021-09-01 21:29:05 +03:00

40 lines
658 B
TypeScript

import type { SignupFormQuestion } from "@models/Signup";
export interface Question {
id: string;
name: string;
type: OptionTypes;
enum?: string[];
enumNames?: string[];
description?: string;
required?: boolean;
}
export interface InputProps {
index: number;
value: SignupFormQuestion["options"];
questions: SignupFormQuestion[];
type: string;
}
export type OptionTypes =
"text" |
"info" |
"integer" |
"radiobutton" |
"checkbox" |
"email" |
"name";
export const optionTypes = [
"text",
"info",
"integer",
"radiobutton",
"checkbox",
"email",
"name",
];
export class SignupQuestionError extends Error { }