/** * Facet Aggregator * * Utilities for client-side facet counting from search results. * Used by sources without native facet support. */ import type { FacetValue, FacetsResponse, FacetFieldConfig, CountFacetsInput } from './types.js'; /** * Count facets from an array of records * * @param records - Array of record objects * @param input - Facet counting configuration * @returns FacetsResponse with counted facets * * @example * const facets = countFacets(records, { * facetConfigs: [ * { name: 'category', displayName: 'Category', fieldPath: 'category', nativeSupport: false }, * { name: 'state', displayName: 'State', fieldPath: 'location.state', nativeSupport: false }, * ], * includeFacets: ['category'], // Only include category * limit: 10, * }); */ export declare function countFacets(records: Record[], input: CountFacetsInput): FacetsResponse; /** * Merge facets from multiple pages/batches * * @param facetSets - Array of FacetsResponse objects to merge * @returns Combined FacetsResponse with merged counts */ export declare function mergeFacets(facetSets: FacetsResponse[]): FacetsResponse; /** * Create a simple facet config for common use cases */ export declare function simpleFacetConfig(name: string, displayName: string, fieldPath?: string): FacetFieldConfig; /** * Convert decade year to decade label * * @example * yearToDecade(1923) // Returns { value: "1920", label: "1920s" } */ export declare function yearToDecade(year: number): FacetValue; /** * Group records by decade from a date field */ export declare function countByDecade(records: Record[], dateFieldPath: string): FacetValue[]; //# sourceMappingURL=aggregator.d.ts.map