import type { ObjectLiteral, SelectQueryBuilder } from 'typeorm'; import type { GridView, ExpressRequest } from './interfaces/index.js'; /** * A class that serves as a bridge between the frontend requests and the TypeORM backend, * facilitating data querying, sorting, filtering, and pagination based on the parameters * received from an Express request. It leverages the QuerystringParser for parsing the * request URL into a structured format and uses FilterBuilder to apply filtering logic * directly on the SQL query built with TypeORM's SelectQueryBuilder. * * @typeParam T - The entity type that this OData instance will manage, extending TypeORM's * ObjectLiteral, which allows for any object shape that can be managed by TypeORM. */ export declare class ODataQuery { #private; /** * Initializes a new instance of the OData class with a TypeORM query builder, the * Express request object, and an optional map of filter column parsers for custom * filter parsing logic. * * @param query - The TypeORM SelectQueryBuilder instance used to build and execute * database queries for the specified entity. * @param request - The Express request object, containing the URL from which query * string parameters are parsed. * @param filterColumnParsers - An optional object mapping column names to custom * parsing functions, allowing for complex filter logic on specific columns. */ constructor(query: SelectQueryBuilder, request: ExpressRequest, filterColumnParsers?: Record any>); /** * Retrieves many entities as raw data based on the parsed query string parameters. * This method is particularly useful for complex queries that involve operations * beyond simple CRUD, such as aggregations or transformations directly on the database. * It returns the data in a grid view format along with the total count of records. * * @typeParam O - An optional generic parameter specifying the shape of the raw data * to be returned. Defaults to the entity type T if not specified. * @returns A Promise resolving to a GridView object containing the raw queried data and * total record count. */ getRawMany = T>(): Promise>; }