UNPKG

@versatiledatakit/shared

Version:

Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.

110 lines (109 loc) 2.9 kB
import { Literal } from '../../interfaces'; export declare type LiteralRequestPage = { pageNumber: number; pageSize: number; }; export interface RequestPage extends Literal<LiteralRequestPage> { readonly page: number; readonly size: number; } /** * ** Request Page DTO. */ export declare class RequestPageImpl implements RequestPage { readonly page: number; readonly size: number; constructor(page: number, size: number); /** * ** Factory method. */ static of(page: number, size: number): RequestPageImpl; /** * ** Factory method for empty RequestPageDTO. */ static empty(): RequestPageImpl; /** * ** Creates DTO from literal. */ static fromLiteral(literalDTO: { pageNumber: number; pageSize: number; }): RequestPageImpl; /** * @inheritDoc */ toLiteral(): LiteralRequestPage; /** * @inheritDoc */ toLiteralCloneDeep(): LiteralRequestPage; } export interface RequestOrder extends Literal<LiteralApiPredicates> { readonly criteria: ApiPredicate[]; } /** * ** Request Order DTO. */ export declare class RequestOrderImpl implements RequestOrder { readonly criteria: ApiPredicate[]; constructor(...criteria: ApiPredicate[]); /** * ** Factory method. */ static of(...criteria: ApiPredicate[]): RequestOrderImpl; /** * ** Factory method for empty RequestOrderDTO. */ static empty(): RequestOrderImpl; /** * ** Creates DTO from literal. */ static fromLiteral(literalCriteria: Array<ApiPredicate>): RequestOrderImpl; /** * @inheritDoc */ toLiteral(): LiteralApiPredicates; /** * @inheritDoc */ toLiteralCloneDeep(): LiteralApiPredicates; } export interface RequestFilter extends Literal<LiteralApiPredicates> { readonly criteria: ApiPredicate[]; } /** * ** Request Filter DTO. */ export declare class RequestFilterImpl implements RequestFilter { readonly criteria: ApiPredicate[]; constructor(...criteria: ApiPredicate[]); /** * ** Factory method. */ static of(...criteria: ApiPredicate[]): RequestFilterImpl; /** * ** Factory method for empty RequestFilterDTO. */ static empty(): RequestFilterImpl; /** * ** Creates DTO from literal. */ static fromLiteral(literalCriteria: Array<ApiPredicate>): RequestFilterImpl; /** * @inheritDoc */ toLiteral(): LiteralApiPredicates; /** * @inheritDoc */ toLiteralCloneDeep(): LiteralApiPredicates; } export declare type LiteralApiPredicates = Array<ApiPredicate>; export declare const ASC = "ASC"; export declare const DESC = "DESC"; export declare type DirectionType = typeof ASC | typeof DESC; export interface ApiPredicate { readonly property: string; readonly pattern: string; readonly sort: DirectionType; }