object
Function: object()
Section titled “Function: object()”function object<F, P>(opts): ObjectProducer<{ [K in string | number | symbol]: ({ [K in string | number | symbol]: FieldValue<F[K]> } & { [K in string | number | symbol]?: FieldValue<F[K]> })[K] }, P> & object;Defined in: src/core/producer.ts:310
A fixed set of named fields. Output type is inferred from fields.
The concrete fields map type is also carried in the phantom _fields, so the
project selector can mirror the producer’s structure at the type level (an
atomic custom field stays a leaf even when its value type looks structural).
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
F extends Record<string, Producer<unknown, Presence>> | - |
P extends Presence | "optional" |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
opts | object & BaseMeta |
Returns
Section titled “Returns”ObjectProducer<{ [K in string | number | symbol]: ({ [K in string | number | symbol]: FieldValue<F[K]> } & { [K in string | number | symbol]?: FieldValue<F[K]> })[K] }, P> & object