@karmaniverous/entity-manager
    Preparing search index...

    Type Alias ShardQueryFunction<CC, ET, IT, CF, K>Protected

    ShardQueryFunction: CF extends { indexes?: infer I }
        ? I extends Record<string, unknown>
            ? IT extends keyof I & string
                ? (
                    hashKey: string,
                    pageKey?: PageKeyByIndex<CC, ET, IT, CF>,
                    pageSize?: number,
                ) => Promise<ShardQueryResult<CC, ET, IT, CF, K>>
                : never
            : (
                hashKey: string,
                pageKey?: PageKeyByIndex<CC, ET, IT, CF>,
                pageSize?: number,
            ) => Promise<ShardQueryResult<CC, ET, IT, CF, K>>
        : (
            hashKey: string,
            pageKey?: PageKeyByIndex<CC, ET, IT, CF>,
            pageSize?: number,
        ) => Promise<ShardQueryResult<CC, ET, IT, CF, K>>

    A query function that returns a single page of results from an individual shard.

    This function will typically be composed dynamically to express a specific query index & logic. The arguments to this function will be provided by the EntityManager.query method, which assembles many returned pages queried across multiple shards into a single query result.

    Type Parameters

    • CC extends BaseConfigMap
    • ET extends EntityToken<CC>

      Entity token narrowing the item/record types.

    • IT extends string

      Index token (inferred from shardQueryMap keys).

    • CF = unknown

      Optional values-first config literal type for narrowing.

    • K = unknown

      Optional projection keys; narrows item shape when provided.

    The hash key value of the shard being queried.

    The typed page key for the index being queried.

    The maximum number of items to return from this query.