Beignet API reference
    Preparing search index...

    Interface EntityDef<Name, Schema, Methods>

    Entity definition returned by defineEntity(...).build().

    interface EntityDef<
        Name extends string,
        Schema extends StandardSchema,
        Methods extends AnyMethods,
    > {
        name: Name;
        schema: Schema;
        Type: EntityInstance<Name, Schema, Methods>;
        create(
            props: InferOutput<Schema>,
        ):
            | EntityInstance<Name, Schema, Methods>
            | Promise<EntityInstance<Name, Schema, Methods>>;
        fromJSON(
            json: InferOutput<Schema>,
        ):
            | EntityInstance<Name, Schema, Methods>
            | Promise<EntityInstance<Name, Schema, Methods>>;
    }

    Type Parameters

    • Name extends string
    • Schema extends StandardSchema
    • Methods extends AnyMethods
    Index

    Properties

    Methods

    Properties

    name: Name

    Name used for debugging and introspection.

    schema: Schema

    Standard Schema used to validate entity props.

    Type-only alias for the entity instance type. Undefined at runtime.

    Methods