The base field context that is available for all fields.
API
interface RootFieldContext<TValue> {
readonly value: Signal<TValue>;
readonly state: FieldState<TValue, string | number>;
readonly fieldTree: FieldTree<TValue, string | number>;
valueOf<PValue>(p: SchemaPath<PValue, SchemaPathRules, Root>): PValue;
stateOf<PControl extends AbstractControl>(p: CompatSchemaPath<PControl, Root>): CompatFieldState<PControl, string | number>;
stateOf<PValue>(p: SchemaPath<PValue, SchemaPathRules, Root>): FieldState<PValue, string | number>;
fieldTreeOf<PModel>(p: SchemaPathTree<PModel, Root>): FieldTree<PModel, string | number>;
readonly pathKeys: Signal<readonly string[]>;
}
value
Signal<TValue>A signal containing the value of the current field.
state
FieldState<TValue, string | number>The state of the current field.
fieldTree
FieldTree<TValue, string | number>The current field.
valueOf
PValueGets the value of the field represented by the given path.
@returns
PValue
stateOf
CompatFieldState<PControl, string | number>Gets the state of the field represented by the given path.
@returns
CompatFieldState<PControl, string | number>
stateOf
FieldState<PValue, string | number>
@returns
FieldState<PValue, string | number>
fieldTreeOf
FieldTree<PModel, string | number>Gets the field represented by the given path.
@returns
FieldTree<PModel, string | number>
pathKeys
Signal<readonly string[]>The list of keys that lead from the root field to the current field.