- Name
mode- Kind
- property
- Type
BindingMode- Requirement
- required
DocsAPI referenceUI machinesasync-validated-input
async-validated-input machine
The public state machine contract for @grassroot/ui-machines/async-validated-input. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/async-validated-input
Package
Service example
async-validated-input.tsts
import { createService } from "@grassroot/statechart";import { asyncValidatedInputMachine } from "@grassroot/ui-machines/async-validated-input"; const service = createService(asyncValidatedInputMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();11 of 11
Exports
AsyncValidatedInputCommandts
type AsyncValidatedInputCommand = (CommandObject & { readonly type: "VALIDATE_REQUEST"; readonly value: string; readonly reason: AsyncValidatedInputReason;}) | (CommandObject & { readonly type: "VALUE_CHANGE_REQUEST"; readonly value: string; readonly reason: AsyncValidatedInputReason;});AsyncValidatedInputContextts
type AsyncValidatedInputContext = { readonly value: string; readonly pending: boolean; readonly status: AsyncValidatedInputStatus; readonly mode: BindingMode;};Name
Kind
Type
Requirement
modeproperty
BindingModerequired
pendingproperty
booleanrequired
statusproperty
AsyncValidatedInputStatusrequired
valueproperty
stringrequired
- Name
pending- Kind
- property
- Type
boolean- Requirement
- required
- Name
status- Kind
- property
- Type
AsyncValidatedInputStatus- Requirement
- required
- Name
value- Kind
- property
- Type
string- Requirement
- required
AsyncValidatedInputDiagnosticCodests
export declare const AsyncValidatedInputDiagnosticCodes: readonly DiagnosticCatalogueEntry[];AsyncValidatedInputEventts
type AsyncValidatedInputEvent = { readonly type: "SET_VALUE"; readonly value: string; readonly reason: AsyncValidatedInputReason;} | { readonly type: "VALIDATE"; readonly reason: AsyncValidatedInputReason;} | { readonly type: "VALIDATE_SUCCEEDED";} | { readonly type: "VALIDATE_FAILED";} | { readonly type: "RESET";};AsyncValidatedInputInputts
type AsyncValidatedInputInput = { readonly value?: string; readonly defaultValue?: string; readonly pending?: boolean; readonly status?: AsyncValidatedInputStatus;};Name
Kind
Type
Requirement
defaultValueproperty
stringoptional
pendingproperty
booleanoptional
statusproperty
AsyncValidatedInputStatusoptional
valueproperty
stringoptional
- Name
defaultValue- Kind
- property
- Type
string- Requirement
- optional
- Name
pending- Kind
- property
- Type
boolean- Requirement
- optional
- Name
status- Kind
- property
- Type
AsyncValidatedInputStatus- Requirement
- optional
- Name
value- Kind
- property
- Type
string- Requirement
- optional
asyncValidatedInputMachinets
export declare const asyncValidatedInputMachine: Machine<AsyncValidatedInputInput, "ready", AsyncValidatedInputContext, AsyncValidatedInputEvent, AsyncValidatedInputCommand>;AsyncValidatedInputReasonts
type AsyncValidatedInputReason = "pointer" | "keyboard" | "programmatic";asyncValidatedInputReplaySequencets
export declare const asyncValidatedInputReplaySequence: readonly AsyncValidatedInputEvent[];asyncValidatedInputSelectorsts
export declare const asyncValidatedInputSelectors: { value: (snapshot: AsyncValidatedInputSnapshot) => string; pending: (snapshot: AsyncValidatedInputSnapshot) => boolean;};Name
Kind
Type
Requirement
pendingproperty
(snapshot: AsyncValidatedInputSnapshot) => booleanrequired
valueproperty
(snapshot: AsyncValidatedInputSnapshot) => stringrequired
- Name
pending- Kind
- property
- Type
(snapshot: AsyncValidatedInputSnapshot) => boolean- Requirement
- required
- Name
value- Kind
- property
- Type
(snapshot: AsyncValidatedInputSnapshot) => string- Requirement
- required
AsyncValidatedInputSnapshotts
type AsyncValidatedInputSnapshot = Snapshot<"ready", AsyncValidatedInputContext>;AsyncValidatedInputStatusts
type AsyncValidatedInputStatus = "idle" | "validating" | "valid" | "error";