import { mongo } from 'mongoose'; /** * Validation helper functions for repository operations */ /** * Normalizes an ID value to a string representation * Handles strings, ObjectId instances, and buffer-like objects */ export declare function normalizeIdToString(id: unknown): string | null; /** * Converts an array of IDs to ObjectIds for MongoDB queries * Handles strings, ObjectId instances, and buffer-like objects * Filters out invalid ObjectIds silently */ export declare function convertToObjectIds(ids: unknown[]): mongo.ObjectId[]; export declare const MAX_LIMIT = 100; export declare const MIN_LIMIT = 1; export declare const DEFAULT_PAGE = 1; /** * Validates ObjectId format * @throws {ValidationError} If ID is invalid */ export declare function validateObjectId(id: string, fieldName?: string): void; /** * Validates pagination parameters and returns normalized values * @returns Validated and normalized pagination parameters */ export declare function validatePagination(limit?: number, page?: number): { limit: number; page: number; }; /** * Selects fields to show in query projection * Converts comma-separated string to space-separated format for Mongoose */ export declare function selectFieldsShow(fields?: string): string; /** * Sanitizes a query condition object to convert buffer-like ObjectId values * Handles: _id, id, and any field ending in Id or Ids (positionId, orgIds, etc.) * Handles nested conditions: $in, $or, $and, $nor, $not, $elemMatch * Filters out empty objects that would cause MongoDB casting errors */ export declare function sanitizeQueryCondition>(cond: T | null | undefined): T | null;