SiteFrontend/src/components/form/formInterfaces.tsx

30 lines
740 B
TypeScript
Raw Normal View History

import * as Yup from "yup";
type InputNames = "username" | "email" | "question" | "discord" | "pc_requirements" | "age" | "pronoun" | "join_date" |
"avg_time" | "available_days" | "available_time" | "staff_experience" | "plugin_experience" | "why_staff" |
"expectations_mod" | "other";
export interface Step {
label: string;
name: InputNames;
type: "text" | "email" | "textarea" | "date";
min_length: number;
max_length: number;
required: boolean;
}
export interface UserInput {
[key: string]: string;
}
export type FormData = {
steps: Step[];
backend: string;
userInput: UserInput;
spec: Yup.Schema<any>
}
export interface FormProperties {
path: string
formData: FormData;
}