Skip to content

Overview / Form

Form<T, S>

Type Parameters

Type ParameterDefault type
T extends Record<string, z.ZodType>Record<string, z.ZodType>
S extends z.infer<z.ZodObject<T>>z.infer<z.ZodObject<T>>

Constructors

new Form()

new Form<T, S>(name, schema, options): Form<T, S>

Parameters

ParameterType
namestring
schemaT
optionsFormOptions<S>

Returns

Form<T, S>

Properties

PropertyTypeDefault value
askConfirmbooleanundefined
descriptionstringundefined
invalidFieldsstring[][]
modelSundefined
namestringundefined
schemaZodObject<T, UnknownKeysParam, ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<T>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<T>[k] }>undefined
startExamplesstring[]undefined
stopExamplesstring[]undefined
submitFormSubmit<S>undefined

Accessors

active

get active(): boolean

set active(active): void

Parameters

ParameterType
activeboolean

Returns

boolean


state

get state(): FormState

Returns

FormState

Methods

assignCat()

assignCat(cat): Form<T, S>

Parameters

ParameterType
catStrayCat

Returns

Form<T, S>


next()

next(): Promise<AgentFastReply>

Returns

Promise<AgentFastReply>


reset()

reset(): void

Returns

void

Released under the GPL-3.0 License.