Beignet API reference
    Preparing search index...

    Type Alias EntityBaseInstance<Schema>

    EntityBaseInstance: InferOutput<Schema> & {
        toJSON(): InferOutput<Schema>;
        with(
            patch: Partial<InferOutput<Schema>>,
        ): EntityBaseInstance<Schema> | Promise<EntityBaseInstance<Schema>>;
    }

    Base entity instance passed to the .methods(...) builder: validated props plus the with and toJSON helpers, before domain methods attach.

    with(...) is typed as returning the base instance here because the final methods object is still being defined while the builder runs. At runtime the returned instance carries the entity's methods, and EntityInstance maps base-instance returns back to the full instance type so consumers keep typed method chaining.

    Type Parameters

    • Schema extends StandardSchema

    Type Declaration