Libraries
    Preparing search index...

    Type Alias EntityResult<TEntity>

    EntityResult: TEntity extends Entity<any, any, infer U>
        ? [U] extends [never] ? InferType<EntitySchema<TEntity>> : U
        : InferType<EntitySchema<TEntity>>

    The natural result row for a freshly initiated query against an entity.

    For ordinary entities this is InferType<EntitySchema<T>>. For polymorphic entities (declared via .withVariants()), this resolves to the discriminated union of all variant rows, so:

    const a = await db.activities.find(1);
    if (a?.type === 'assigned') {
    a.assigneeId; // narrowed
    }

    Type Parameters

    • TEntity extends Entity<any, any, any>