import { MetaDocumentExists } from '../../data-accessor.js'; import { GapicContext } from '../gapic-context.js'; import { EvalDataType, FirestoreTypeOrder } from './types.js'; /** * Resolves a comparable value from a document given a field path. * * Special case: * - When the field path is `__name__` (the sentinel), the function * returns a Firestore reference value derived from the document path. * * @param context - GAPIC context providing serializer and path utilities. * @param meta - The metadata for a document that exists. * @param fieldPath - The dot-delimited field path (or `__name__` sentinel). * @returns The decoded or raw comparable value, or `undefined` if the field is not present. */ export declare function getComparable(context: GapicContext, meta: MetaDocumentExists, fieldPath: string): unknown; /** * Compares two Firestore values according to the canonical ordering * used by queries, cursors, and inequality filters. * * Ordering rules (by type precedence): * 1. Null * 2. Boolean (`false` < `true`) * 3. Number (with special handling: `NaN < -Infinity < ... < Infinity`; `-0 == 0`) * 4. Timestamp (seconds, then nanoseconds) * 5. String (lexicographic) * 6. Bytes (lexicographic by byte sequence) * 7. Reference (path segments) * 8. GeoPoint (latitude, then longitude) * 9. Array (lexicographic element-wise, shorter first) * 10. Vector (dimension length, then element-wise numeric) * 11. Map (sorted by key, then value; shorter first) * * @param a - First value. * @param b - Second value. * @returns -1 if a < b, 1 if a > b, 0 if equal. */ export declare function compareValues(a: unknown, b: unknown): number; /** * Returns the Firestore type precedence rank for a value. * * The rank corresponds to {@link FirestoreTypeOrder} and dictates * how values of different types are ordered in queries. * * @param v - The value to rank. * @returns The Firestore type order rank. */ export declare function valueTypeRank(v: unknown): FirestoreTypeOrder; /** * Classifies a runtime value into an {@link EvalDataType} for * query operator evaluation. * * Rules: * - Distinguishes `NumberNaN` from regular numbers. * - Treats `undefined` as {@link EvalDataType.Undefined}. * - Recognizes Firestore-specific types (Timestamp, GeoPoint, Reference). * - Recognizes plain objects as `Map`, shallow vector-like values as `Vector`. * - Everything else defaults to `Invalid`. * * @param v - The runtime value. * @returns The evaluated data type. */ export declare function evalDataType(v: unknown): EvalDataType; //# sourceMappingURL=compare-values.d.ts.map