import { Transformation } from "./tranformation"; import { ODataFilter, ParamBoundedFilter } from "./filter"; import type { ODataVariant, ODataVersion } from "./types"; export interface ODataParamOrderField { /** * field name */ field: keyof T; /** * order asc or desc */ order?: "asc" | "desc"; } /** * OData System Query Options * * like `$filter`, `$format`, `$top` .... * */ export declare class SystemQueryOptions { #private; /** * @deprecated * @returns */ static newParam(): SystemQueryOptions; static newOptions(): SystemQueryOptions; constructor(); private $skip; private $filter; private $top; private $select; private $orderby; private $format; private $search; private $inlinecount; private $expand; private $count; private $apply; /** * with $inlinecount value * * @version 2.0.0 */ inlinecount(inlinecount?: boolean): this; /** * * count items in odata v4 * * @param count * * @version 4.0.0 */ count(count?: boolean): this; /** * apply filter for query * * @param filter */ filter(): ParamBoundedFilter; filter(filter: string | ODataFilter): this; /** * skip first records * * @param skip */ skip(skip: number): this; /** * limit result max records * * @param top */ top(top: number): this; /** * select viewed fields * * @param selects */ select(selects: keyof T | Array): this; /** * set order sequence * * @param fieldOrOrders * @param order default desc, disabled when first params is array */ orderby(fieldOrOrders: keyof T | ODataParamOrderField[], order?: "asc" | "desc"): this; /** * set order by multi field * * @param fields */ orderbyMulti(fields?: ODataParamOrderField[]): this; /** * result format, please keep it as json * * @param format deafult json */ format(format: "json" | "xml"): this; /** * full text search * * default with fuzzy search, SAP system or OData V4 only * * @param value * @version 4.0.0 */ search(value: string, fuzzy?: boolean): this; /** * apply data aggregation * * @experimental * * @see [OData Extension for Data Aggregation Version 4.0](http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs01/odata-data-aggregation-ext-v4.0-cs01.html) * @param expression * @returns */ apply(expression: Array): this; apply(expression: Transformation): this; apply(expression: Array): this; apply(expression: string): this; /** * expand navigation props * * @param fields * @param replace */ expand(fields: keyof T | Array, replace?: boolean): this; /** * add addtional custom properties in final url query * * @param key addtional url query parameter key * @param value value * @returns * * @example * * ```ts * OData.newParam(). * ``` */ custom(key: any, value: any): this; /** * convert param object to query string * * @param version * @param variant * @returns */ toString(version?: ODataVersion, variant?: ODataVariant): string; } export declare const ODataParam: typeof SystemQueryOptions; /** * odata system query options */ export declare const ODataQueryParam: typeof SystemQueryOptions; /** * * @deprecated * @returns */ export declare function param(): SystemQueryOptions; /** * create new system options * * @returns */ export declare function systemOptions(): SystemQueryOptions;