@metreeca/blue - v0.12.0
    Preparing search index...

    Type Alias Draft<S, T>

    Draft: { inferred from <S, T> }

    Resolves the state of a resource to be persisted.

    Resolves to the state of a resource of the shape, with an optional identifier. The identifier is optional because the target of the operation already identifies the resource, or leaves the store to assign it on creation; if stated, it must agree with the target.

    Given a slice as well, resolves instead to the state of a new item for the collection it names, whether the collection property is declared or inherited. blueprint returns the shape such an item must satisfy, so it can be validated before it is stored. Resolves to never for properties holding values other than resources, which can't be drafted.

    The bare ResourceShape or a generic Template resolves to any Resource, so any draft is accepted where only a generic shape or model is known.

    Type Parameters

    • S extends Lazy<ResourceShape>

      The resource shape, or the shape of the resource holding the collection, possibly deferred to break definition cycles

    • T = never

      The slice naming the collection property; omit it to draft the resource itself