/**
 * @fileoverview Generic handler to aggregate entities in Supabase.
 * @description Provides aggregate operations (COUNT, SUM, AVG, MIN, MAX, GROUP BY) for PostgreSQL.
 *
 * @version 0.1.0
 * @since 0.5.0
 * @author AMBROISE PARK Consulting
 */
import * as v from 'valibot';
import type { UserRole } from '@donotdev/core/server';
/** Request payload for aggregate operations (COUNT, SUM, AVG, MIN, MAX) on entities. */
export type AggregateEntityRequest = {
    where?: Array<[string, any, any]>;
    aggregate: {
        field: string;
        operation: 'count' | 'sum' | 'avg' | 'min' | 'max';
    };
    groupBy?: string[];
};
/**
 * Create a Supabase Edge Function handler for aggregating entities.
 *
 * @param collection - The Supabase table name
 * @param documentSchema - The Valibot schema for document validation
 * @param requiredRole - Minimum role required for this operation
 * @returns A `(req: Request) => Promise<Response>` handler for Deno.serve
 */
export declare function createSupabaseAggregateEntities(collection: string, documentSchema: v.BaseSchema<unknown, any, v.BaseIssue<unknown>>, requiredRole: UserRole): (req: Request) => Promise<Response>;
