Skip to main content

FieldFactory

A configured field factory with nullable and strict declaration modes.

Import

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

When to use it

Use when passing a configured field factory to shared declaration code. Its overloads preserve nullable and strict modes.

Declaration

type FieldFactory<TNullable extends boolean | undefined> = ([
TNullable
] extends [
false
] ? NonNullableFieldFactory : [
TNullable
] extends [
undefined
] ? typeof import('./field').field : typeof import('./field').field.nullable) & FieldNullabilityOverrides;

Type parameters

ParameterConstraintDefault
TNullableboolean | undefinedRequired