import { firestore } from "firebase-admin"; export declare class NumericUpdate { protected data: { [key: string]: any; }; /** * Merges numeric values from an arbitrary deep json into the NumericUpdate object. * - it ignores non-numeric leaves * - if there's a type mismatch ('number' vs 'object') current data will be overridden * @param from An object with numeric values to merge from. */ mergeFrom(from: { [key: string]: any; }): void; /** * Subtracts numeric values in an arbitrary deep json from the NumericUpdate object. * - it ignores non-numeric leaves * - if there's a type mismatch ('number' vs 'object') current data will be overridden * @param from An object with numeric values to merge from. */ subtractFrom(from: { [key: string]: any; }): void; /** * Exports an object with modified fields in the counter. * @param counter The counter data to be updated. */ toCounterUpdate(counter: { [key: string]: any; }): { [key: string]: any; }; /** * Exports an update object for partial shard. * * Resulting operation will append current data to an array "_updates_". */ toPartialUpdate(uuidv4: (() => string)): { [key: string]: any; }; toPartialShard(uuidv4: (() => string)): { [key: string]: any; }; isNoop(): boolean; private static mergeRecursive; private static addCommonFieldsRecursive; /** * Return true only if object contains only numeric fields and they are all 0. */ private static isNoop; } export declare class Aggregator { private uuidv4; constructor(uuidv4?: (() => string)); /** * Aggregates increments from shards and partials and returns an update object suitable for * DocumentRef.update() call. * @param counter Current snap of the main counter document. null means we aggregate to partial. * @param partials Shard snapshots with partial aggregations. * @param shards Shard snapshots with counter increments. */ aggregate(counter: firestore.DocumentSnapshot | null, partials: firestore.DocumentSnapshot[], shards: firestore.DocumentSnapshot[]): { [key: string]: any; }; /** * Returns an update object that will subtract the sum of all the fields in a partial. * @param partial Snapshot with partial aggregations to be subtracted. */ subtractPartial(partial: firestore.DocumentSnapshot): { [key: string]: any; }; } //# sourceMappingURL=aggregator.d.ts.map