ecspresso
    Preparing search index...

    Type Alias QueryResultEntity<ComponentTypes, QueryDef>

    QueryResultEntity: FilteredEntity<
        ComponentTypes,
        QueryDef["with"][number],
        QueryDef["without"] extends ReadonlyArray<any>
            ? QueryDef["without"][number]
            : never,
        QueryDef["optional"] extends ReadonlyArray<any>
            ? QueryDef["optional"][number]
            : never,
    >

    Utility type to derive the entity type that would result from a query definition. This is useful for creating helper functions that operate on query results.

    Type Parameters

    const queryDef = {
    with: ['position', 'sprite'],
    without: ['dead']
    };

    type EntityType = QueryResultEntity<Components, typeof queryDef>;

    function updateSpritePosition(entity: EntityType) {
    entity.components.sprite.position.set(
    entity.components.position.x,
    entity.components.position.y
    );
    }