Maps a single StateSchema field definition to its corresponding Channel type.
This utility type inspects the type of the field and returns an appropriate
BaseChannel type, parameterized with the state "value" and "input" types according to the field's shape.
Rules:
F) is a ReducedValue<V, I>, the channel will store values of type V
and accept input of type I.UntrackedValue<V>, the channel will store and accept values of type V.SerializableSchema<I, O>, the channel will store values of type O
(the schema's output/validated value) and accept input of type I.BaseChannel<unknown, unknown> is used as fallback.StateSchemaFieldToChannel: F extends ReducedValue<
V,
I
> BaseChannel<V, OverwriteValue<V> | I> : F extends UntrackedValue<V> BaseChannel<V, V> : F extends SerializableSchema<I, O> BaseChannel<O, I> : BaseChannel<unknown, unknown>type MyField = ReducedValue<number, string>;
type ChannelType = StateSchemaFieldToChannel<MyField>;
// ChannelType is BaseChannel<number, string>