Skip to main content

FieldNode

A field node. Omit TValue for an unspecified value, or supply it to constrain reads and writes.

Import

import type { FieldNode } from '@ngblocks/form-nodes';

When to use it

Use for inputs or helpers that accept a field with a known value type. A bare FieldNode accepts unspecified field values; prefer factory inference when declaring the field itself.

Declaration

type FieldNode<TValue = any, TParent extends AnyNode = AnyNode> = NodeSignal<TValue> & {
(): TValue;
$api: CallableNodeApi<FieldApi<TValue, TParent>>;
} & Omit<FieldApi<TValue, TParent>, 'patch'> & HiddenFunctionMembers;

Type parameters

ParameterConstraintDefault
TValueUnconstrainedany
TParentAnyNodeAnyNode

Declared members

The declaration above also includes inherited contracts and overloads where applicable.

MemberMeaning
$apiCallable, collision-safe access to the field API. Calling $api() reads the same exposed value as the node and tracks signal dependencies. Use direct members for application code and $api for generic code or child-name collisions.