import { User } from "../../types/user.types.js";
import { ResponseWithSession } from "../../middlewares/sessionAuth.middleware.js";
import { FiltersAndPagination } from "./getFiltersAndPaginationFromBody.js";
import { GetUsersResult } from "../../controllers/user.controller.js";
import { RootFilterQuery } from "mongoose";
import { FastifyRequest } from "fastify";
import { Request } from "express";

//#region src/utils/filtersAndPagination/getUserFiltersAndPagination.d.ts
type UserFiltersParam = {
  ids?: string | string[];
  firstName?: string;
  lastName?: string;
  email?: string;
  emailVerified?: string;
  role?: string;
  search?: string;
  sortBy?: string;
  sortOrder?: string;
  /**
   * For admin users, if true, will fetch all users without filtering by organization
   */
  fetchAll?: 'true' | 'false';
};
type UserFilters = RootFilterQuery<User>;
/**
 * Extracts filters and pagination information from the request body.
 * @param req - Express or Fastify request object.
 * @param res - Express or Fastify response object (optional, for Express compatibility).
 * @returns Object containing filters, page, pageSize, and getNumberOfPages functions.
 */
declare const getUserFiltersAndPagination: (req: Request<FiltersAndPagination<UserFiltersParam>> | FastifyRequest<{
  Querystring: FiltersAndPagination<UserFiltersParam>;
}>, res?: ResponseWithSession<GetUsersResult>) => {
  page: number;
  skip: number;
  pageSize: number;
  getNumberOfPages: (totalItems: number) => number;
  filters: {};
  sortOptions: Record<string, 1 | -1>;
};
//#endregion
export { UserFilters, UserFiltersParam, getUserFiltersAndPagination };
//# sourceMappingURL=getUserFiltersAndPagination.d.ts.map