import { IZFilter } from '../filter/filter.mjs'; import { IZSort } from '../sort/sort.mjs'; /** * Describes a request as if it was placed an a url in the query params. */ export interface IZDataRequestQuery { /** * Page number. */ page?: string; /** * Page size. */ size?: string; /** * Search criterion. */ search?: string; /** * Filter criterion. */ filter?: string; /** * Sort criterion. */ sort?: string; } /** * Describes a request for a given set of data. */ export interface IZDataRequest { /** * The page number. * * This is one based. Should always default * to 1. */ page?: number; /** * The page size. * * If not set, it will be up to the consumer * to decide the default. */ size?: number; /** * Search query. * * How the search is performed is done * through the consumer. * * @see * {@link ZDataSearchFields} for a basic * implementation. */ search?: string; /** * The filter query. * * How the filter is applied is done through * the consumer. * * @see * {@link ZDataFilterFields} for a basic * implementation. */ filter?: IZFilter; /** * The sort order. * * How the sort is applied is done through * the consumer. * * @see * {@link ZSorterSingle} for a basic * implementation. */ sort?: IZSort[]; } /** * Represents a builder for a data request. */ export declare class ZDataRequestBuilder { private _request; /** * Initializes a new instance of this object. */ constructor(); /** * Sets the page to retrieve. * * @param page - * The page number * * @returns * A reference to this object. */ page(page?: number): this; /** * Sets the page size. * * @param size - * The page size. * * @returns * A reference to this object. */ size(size?: number): this; /** * Sets the search criteria. * * @param search - * The search query. * * @returns * A reference to this object. */ search(search?: string): this; /** * Sets the filter criteria. * * @param filter - * The filter criteria. If this is a string, * then it will be parsed according to the filter * criteria. * * @returns * A reference to this object. */ filter(filter?: IZFilter | string): this; /** * Sets the sort criteria. * * @param sort - * The list of sorts to make on the request. * * @returns * A reference to this object. */ sort(sort?: IZSort[] | string): this; /** * Copies an existing data request into this object. * * @param other - * The data request object to copy. * * @returns * A reference to this object. */ copy(other: IZDataRequest): this; /** * Constructs the data from a request query. * * This is useful for putting request parameters on a url. * * @param query - * The query that was requested. * * @returns * This object. */ query(query: IZDataRequestQuery): this; /** * Returns the currently built request. * * The returned request will be a deep copy. * * @returns * The currently built request. */ build(): IZDataRequest; }