import type { ProjectContext } from '../../../project'; import { Task } from '../../../task'; import type { OperationSchema } from '../../build-tool'; import type { FirestorePropKey } from '../properties'; import { QueryFilter } from '../utils/types'; export declare class FirestoreDistinctValuesError extends Error { readonly cause?: unknown | undefined; readonly _tag: "FirestoreDistinctValuesError"; constructor(message: string, cause?: unknown | undefined); } export declare const DISTINCT_VALUES: "distinct_values"; export declare const distinctValuesOp: OperationSchema; export interface DistinctValuesArgs { collection?: string; collectionId?: string; /** Single field shorthand. Use `fields` for multi-field grouping. */ field?: string; /** Fields to fetch and group by. Use `groupByFields` to group on a subset while treating the rest as labels. */ fields?: string[]; /** * Subset of `fields` to use as the grouping/identity key. * Remaining fields are treated as labels: collected as arrays of unique values seen per group. * Useful when a display name may vary slightly across collections but the ID field is stable. */ groupByFields?: string[]; filters?: QueryFilter[]; groupByPathSegment?: number; /** * Only return values that appear in at least this many distinct collection buckets. * Pass "all" to mean "present in every collection bucket found" without needing to * know the total count upfront. Only applies when using collectionId. All values are * annotated with collectionCount and collections[] regardless of whether this is set. */ minCollections?: number | 'all'; } type ScalarValue = string | null; export declare const distinctValues: (ctx: ProjectContext, input: DistinctValuesArgs) => Task<{ fields: string | string[]; totalDocsFetched: number; values: { value: ScalarValue | Record; count: number; collectionCount?: number; collections?: string[]; }[]; byCollection: Record; count: number; }[]>; } | { fields: string | string[]; totalDocsFetched: number; values: { value: ScalarValue | Record; count: number; collectionCount?: number; collections?: string[]; }[]; byCollection?: undefined; }, import("../../../project").AccessDeniedError | FirestoreDistinctValuesError>; export {}; //# sourceMappingURL=distinct_values.d.ts.map