13 lines
314 B
TypeScript
13 lines
314 B
TypeScript
export const FORM_CONTEXT = Symbol("FORM_CONTEXT")
|
|
|
|
export interface ValidatableField {
|
|
validate: () => Promise<boolean> | boolean
|
|
reset: () => void
|
|
focus?: () => void
|
|
}
|
|
|
|
export interface FormContext {
|
|
register: (field: ValidatableField) => void
|
|
unregister: (field: ValidatableField) => void
|
|
}
|