import { type Program, type Type } from "@typespec/compiler"; import type { AggregationKind, AggregationOptions } from "./decorators.js"; import type { ResolvedProjection, ResolvedProjectionField } from "./projection.js"; export interface AggregationEntry { field: ResolvedProjectionField; kind: AggregationKind; aggName: string; openSearchField: string; useTextType: boolean; nestedPath?: string; options?: AggregationOptions; } /** * Inner agg name used when wrapping in `{ nested: { path }, aggs: { : {...} } }`. * Kept stable so the response handler can unwrap symmetrically. */ export declare const NESTED_INNER_AGG_NAME = "inner"; export declare function collectAggregations(projection: ResolvedProjection): AggregationEntry[]; /** * Two fields can derive the same aggregation name — `addressCountry` and a * nested `address.country` both reach `byAddressCountry`, and singularizing a * path segment widens the overlap. Assembly keeps the first and drops the * rest, so the second aggregation would silently never run: say so instead. */ export declare function reportAggregationNameCollisions(program: Program, aggregations: readonly AggregationEntry[]): void; export declare function hasAggregations(projection: ResolvedProjection): boolean; export declare function aggregationsTypeName(projectionName: string): string; export declare function aggregationFieldName(fieldName: string, kind: AggregationKind, documentPath?: string, fieldIsArray?: boolean): string; declare function singularize(name: string): string; declare function capitalize(name: string): string; declare function isTextField(field: ResolvedProjectionField): boolean; declare function isArrayType(type: Type): boolean; export declare const __test: { aggregationFieldName: typeof aggregationFieldName; singularize: typeof singularize; capitalize: typeof capitalize; isTextField: typeof isTextField; isArrayType: typeof isArrayType; }; export {}; //# sourceMappingURL=aggregations.d.ts.map