import { DocumentData } from 'firebase-admin/firestore'; /** Firestore per-document serialized size limit (bytes). 1 MiB = 1,048,576 bytes. */ export declare const MAX_DOC_SIZE_BYTES = 1048576; /** * Checks whether a document fits Firestore’s per-document serialized size limit (≤ 1,048,576 bytes). * * The size is computed by {@link calcDocSize}, which includes: * - document name size (path segments relative to `/documents`, UTF-8 bytes + 1 per segment, +16), * - 32 bytes of document overhead, * - field name sizes (UTF-8 bytes + 1 each), * - field value sizes (e.g., strings = UTF-8 bytes + 1; bytes = raw length; numbers = 8; boolean/null = 1; * Timestamp = 8; GeoPoint = 16; Reference = document name size; arrays/maps = sum of children; * VectorValue = 8 bytes × dimensions). * * @param docName - Document path **relative to** the database `/documents` root (e.g. "users/alice/tasks/t1"). * @param docData - Document contents to be serialized using Firestore’s rules. * @returns `true` if the serialized size is **≤** {@link MAX_DOC_SIZE_BYTES}, otherwise `false`. */ export declare function isDocSizeWithinLimit(docName: string, docData: DocumentData): boolean; /** * Calculates the serialized Firestore document size in bytes. * * Formula: * docSize = * documentNameSize(docName) // sum(UTF-8 bytes + 1) for each path segment + 16 * + 32 // document overhead * + sum( fieldNameSize + valueSize ) // for all (possibly nested) fields * * String size = UTF-8 byte length + 1. * Array size = sum of element sizes (no extra array overhead). * Map size = sum over entries of (fieldNameSize + valueSize). * Number = 8 bytes (int or double). * Boolean = 1 byte. * Null = 1 byte. * Timestamp = 8 bytes. * GeoPoint = 16 bytes. * Reference = documentNameSize(referencedDocPath). * Bytes = byteLength + 1 (Buffer/Uint8Array/ArrayBuffer/DataView). * * Notes: * - `docName` must be the path relative to `/documents`, e.g. "users/alice/tasks/t1". * - `undefined` fields are ignored (the Admin SDK omits them on write). * - Sentinel FieldValue transforms are not accounted here (compute size after transforms). */ export declare function calcDocSize(docName: string, docData: DocumentData): number; //# sourceMappingURL=calc-doc-size.d.ts.map