import { Document } from 'mongoose'; /** * Defines which array-type attributes of a document should be tracked, * along with human-readable labels for reporting. * * Only attributes of type `string[]` are tracked. * * Example: * { genres: "Genres", tags: "Tags" } */ type ReportCategoryAttributes = Partial<{ [K in keyof Omit as T[K] extends string[] ? K : never]: string; }>; type ReportCategoryExport = Array<{ id: string; } & Record>; /** * ReportCategory * * Manages multiple AttributeAggregator instances, each associated * with a unique entity key (e.g., organization, category). * Provides methods to insert documents and export aggregated reports. * * @template T - A Mongoose document type with array attributes to track. */ export declare class ReportCategory { private aggregators; private attributes; /** * Initializes the report manager with the attributes to track. * * @param attributes - Mapping of document array attributes to display labels. */ constructor(attributes: ReportCategoryAttributes); /** * Inserts a document into one or multiple entity aggregators. * Automatically creates the aggregator if it does not exist. * * @param document - The document to insert. * @param entityKeys - Single or multiple entity identifiers. */ insertDocument(document: T, entityKeys: string[] | string): void; /** * Exports aggregated statistics for all entities. * * Each object contains: * - id: Entity key * - documents: Number of documents processed for this entity * - totalX / uniqueX: Aggregated counts for each tracked attribute * * @returns An array of aggregated reports for all entities. */ export(): ReportCategoryExport; } export {};