/**
 * Field Utilities
 *
 * Consolidated utilities for field validation, processing, and manipulation.
 * Brings together scattered field-related functions into a single module.
 */
import type { FlattenedField } from '../types/index.js';
export type { FlattenedField };
/**
 * Field utilities object
 */
declare const fieldUtils: {
    /**
     * Get flattened list of all fields in a collection, including nested relations
     * @param collectionName - Name of the collection
     * @param prefix - Prefix for nested fields (used in recursion)
     * @param visited - Set of visited collections to prevent circular references
     * @returns Array of flattened field objects
     *
     * @example
     * ```typescript
     * const fields = fieldUtils.getFlattenedFields('users');
     * // Returns: [
     * //   { name: 'id', fullPath: 'id', type: 'integer', isRelation: false },
     * //   { name: 'email', fullPath: 'email', type: 'string', isRelation: false },
     * //   { name: 'posts', fullPath: 'posts', type: 'o2m', isRelation: true, relationCollection: 'posts' },
     * //   { name: 'title', fullPath: 'posts.title', type: 'string', isRelation: false }
     * // ]
     * ```
     */
    getFlattenedFields(collectionName: string, prefix?: string, visited?: Set<string>): FlattenedField[];
    /**
     * Validate if a field exists in a collection
     * @param collectionName - Name of the collection
     * @param fieldPath - Field path (can include dots for nested fields)
     * @returns True if field exists
     *
     * @example
     * ```typescript
     * fieldUtils.fieldExists('users', 'email'); // true
     * fieldUtils.fieldExists('users', 'posts.title'); // true (if relation exists)
     * fieldUtils.fieldExists('users', 'nonexistent'); // false
     * ```
     */
    fieldExists(collectionName: string, fieldPath: string): boolean;
    /**
     * Get field type
     * @param collectionName - Name of the collection
     * @param fieldPath - Field path
     * @returns Field type or null if not found
     */
    getFieldType(collectionName: string, fieldPath: string): string | null;
    /**
     * Validate field permissions for a user
     * @param collectionName - Name of the collection
     * @param fieldNames - Array of field names to check
     * @param userPermissions - User's permissions object
     * @returns Object with allowed and denied fields
     *
     * @example
     * ```typescript
     * const result = fieldUtils.validateFieldPermissions('users', ['email', 'password'], userPerms);
     * // { allowed: ['email'], denied: ['password'] }
     * ```
     */
    validateFieldPermissions(collectionName: string, fieldNames: string[], userPermissions: Record<string, any>): {
        allowed: string[];
        denied: string[];
    };
    /**
     * Get required fields for a collection
     * @param collectionName - Name of the collection
     * @returns Array of required field names
     */
    getRequiredFields(collectionName: string): string[];
    /**
     * Get unique fields for a collection
     * @param collectionName - Name of the collection
     * @returns Array of unique field names
     */
    getUniqueFields(collectionName: string): string[];
    /**
     * Filter object to only include specified fields
     * @param data - Data object
     * @param allowedFields - Array of allowed field names
     * @returns Filtered object
     *
     * @example
     * ```typescript
     * const data = { id: 1, email: 'test@test.com', password: 'secret' };
     * const safe = fieldUtils.filterFields(data, ['id', 'email']);
     * // { id: 1, email: 'test@test.com' }
     * ```
     */
    filterFields<T extends Record<string, any>>(data: T, allowedFields: string[]): Partial<T>;
    /**
     * Remove specified fields from object
     * @param data - Data object
     * @param excludeFields - Array of field names to exclude
     * @returns Object without excluded fields
     */
    excludeFields<T extends Record<string, any>>(data: T, excludeFields: string[]): Partial<T>;
    /**
     * Validate required fields are present in data
     * @param collectionName - Name of the collection
     * @param data - Data object to validate
     * @returns Object with isValid flag and missing fields
     */
    validateRequiredFields(collectionName: string, data: Record<string, any>): {
        isValid: boolean;
        missing: string[];
    };
    /**
     * Get default values for fields that have them
     * @param collectionName - Name of the collection
     * @returns Object with field names and default values
     */
    getDefaultValues(collectionName: string): Record<string, any>;
    /**
     * Apply default values to data object
     * @param collectionName - Name of the collection
     * @param data - Data object
     * @returns Data object with defaults applied
     */
    applyDefaults(collectionName: string, data: Record<string, any>): Record<string, any>;
    /**
     * Get system fields (created_at, updated_at, deleted_at, etc.)
     * @param collectionName - Name of the collection
     * @returns Array of system field names
     */
    getSystemFields(collectionName: string): string[];
    /**
     * Get user-defined fields (excludes system fields)
     * @param collectionName - Name of the collection
     * @returns Array of user-defined field names
     */
    getUserFields(collectionName: string): string[];
    /**
     * Sanitize field name for safe use in queries
     * @param fieldName - Field name to sanitize
     * @returns Sanitized field name
     */
    sanitizeFieldName(fieldName: string): string;
    /**
     * Parse field path into parts
     * @param fieldPath - Field path (e.g., "user.posts.title")
     * @returns Array of path parts
     */
    parseFieldPath(fieldPath: string): string[];
    /**
     * Build field path from parts
     * @param parts - Array of path parts
     * @returns Field path string
     */
    buildFieldPath(parts: string[]): string;
    /**
     * Get list of hidden fields in a collection
     * Hidden fields should never be returned in API responses
     * @param collectionName - Name of the collection
     * @returns Array of hidden field names
     */
    getHiddenFields(collectionName: string): string[];
    /**
     * Strip hidden fields from a record
     * @param collectionName - Name of the collection
     * @param record - Record to strip hidden fields from
     * @returns Record without hidden fields
     */
    stripHiddenFields<T extends Record<string, any>>(collectionName: string, record: T): T;
    /**
     * Strip hidden fields from an array of records
     * @param collectionName - Name of the collection
     * @param records - Array of records to strip hidden fields from
     * @returns Array of records without hidden fields
     */
    stripHiddenFieldsFromRecords<T extends Record<string, any>>(collectionName: string, records: T[]): T[];
};
export default fieldUtils;
//# sourceMappingURL=fieldUtils.d.ts.map