FormFieldRegistration
interface exported by @mwillbanks/tuil-form.
interface
Public interface exported by @mwillbanks/tuil-form.
export interface FormFieldRegistration {
readonly name: string;
readonly validate: (
trigger: ValidationTrigger,
signal?: AbortSignal,
) => Promise<{ readonly valid: boolean }>;
readonly reset: () => void;
readonly dirty: () => boolean;
readonly value: (redactSecrets?: boolean) => unknown;
readonly errors?: () => readonly string[];
readonly restore?: (value: unknown) => void | Promise<void>;
readonly subscribe?: (observer: () => void) => () => void;
}Members
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
name | string | Yes | The name member uses the string contract. | — |
validate | (trigger: ValidationTrigger, signal?: AbortSignal) => Promise<{ readonly valid: boolean; }> | Yes | The validate member uses the (trigger: ValidationTrigger, signal?: AbortSignal) => Promise<{ readonly valid: boolean; }> contract. | ValidationTrigger |
reset | () => void | Yes | The reset member uses the () => void contract. | — |
dirty | () => boolean | Yes | The dirty member uses the () => boolean contract. | — |
value | (redactSecrets?: boolean) => unknown | Yes | The value member uses the (redactSecrets?: boolean) => unknown contract. | — |
errors | (() => readonly string[]) | undefined | No | The errors member uses the (() => readonly string[]) | undefined contract. | — |
restore | ((value: unknown) => void | Promise<void>) | undefined | No | The restore member uses the ((value: unknown) => void | Promise<void>) | undefined contract. | — |
subscribe | ((observer: () => void) => () => void) | undefined | No | The subscribe member uses the ((observer: () => void) => () => void) | undefined contract. | — |
Parameters
This declaration has no public members.
Returns
This declaration does not return a value.
Throws
No thrown errors are documented for this declaration.
Related types
Source
View the secondary source reference