Skip to main content

TreeFieldFromImplicitField TypeAlias

Converts an ImplicitFieldSchema to a property type suitable for reading a field with this that schema.

Signature

export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TreeNode | TreeLeafValue | undefined;

Type Parameters

Parameter Constraint Default Description
TSchema ImplicitFieldSchema FieldSchema When non-exact schema are provided this errors on the side of returning too general of a type (a conservative union of all possibilities). This is ideal for "output APIs" - i.e. it converts the schema type to the runtime type that a user will _read_ from the tree. Examples of such "non-exact" schema include ImplicitFieldSchema, ImplicitAllowedTypes, and TypeScript unions of schema types.