tuil
ReferencePackages@mwillbanks/tuil-formAPI

FormFieldRegistration

interface exported by @mwillbanks/tuil-form.

View rawEdit

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

MemberTypeRequiredDescriptionRelated types
namestringYesThe name member uses the string contract.
validate(trigger: ValidationTrigger, signal?: AbortSignal) => Promise<&#123; readonly valid: boolean; &#125;>YesThe validate member uses the (trigger: ValidationTrigger, signal?: AbortSignal) => Promise<&#123; readonly valid: boolean; &#125;> contract.ValidationTrigger
reset() => voidYesThe reset member uses the () => void contract.
dirty() => booleanYesThe dirty member uses the () => boolean contract.
value(redactSecrets?: boolean) => unknownYesThe value member uses the (redactSecrets?: boolean) => unknown contract.
errors(() => readonly string[]) | undefinedNoThe errors member uses the (() => readonly string[]) | undefined contract.
restore((value: unknown) => void | Promise<void>) | undefinedNoThe restore member uses the ((value: unknown) => void | Promise<void>) | undefined contract.
subscribe((observer: () => void) => () => void) | undefinedNoThe 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.

Source

View the secondary source reference

Package

@mwillbanks/tuil-form

On this page