import { Entity, IDateType, IPrimaryType, IZeroType, KeyOf, Listable } from './base.dto'; export type IDataType = IZeroType | IPrimaryType | IDateType; export type ICompare = '$eq' | '$gt' | '$gte' | '$lt' | '$lte' | '$ne'; export type IArrayOperation = '$in' | '$nin' | '$all'; export type INotOperation = '$not'; export type ITextOperation = '$like' | '$begin' | '$end'; export type INumberOperation = '$size'; export type IBoolOperation = '$exists' | '$nil' | '$empty'; export type IOpField = { [op in ICompare]?: T; } | { [op in IArrayOperation]?: T[]; } | { [op in ITextOperation]?: string; } | { [op in IBoolOperation]?: boolean; } | { [op in INotOperation]: IOpField; }; export type ICondition = { [key in keyof T]?: T[key] extends (infer U extends IDataType)[] ? T[key] | IOpField | U | IOpField | { [op in INumberOperation]?: number; } : T[key] extends IDataType ? T[key] | IOpField : T[key] extends (infer U extends Entity)[] ? ICondition | { [op in INumberOperation]?: number; } : T[key] extends Entity ? ICondition : IDataType | IOpField | ICondition; } & { $or?: ICondition[]; $and?: ICondition[]; }; export type ILanguage = '*' | string; type IDirection = 'asc' | 'desc'; export type ISort = { [key in keyof T]?: T[key] extends IDataType | IDataType[] ? IDirection : T[key] extends (infer U extends Entity)[] ? ISort : T[key] extends Entity ? ISort : IDirection; }; type INearOption = { lat: number; lng: number; distance?: number; }; export type INear = { [key in keyof T]?: T[key] extends IDataType | IDataType[] ? never : T[key] extends Entity | Entity[] ? INearOption : never; }; export type IPopulate = { [key in keyof T]?: '*' | IPopulateOption; }; export type IPopulateOption = { select?: string | KeyOf[]; model?: string; populate?: IPopulate; match?: ICondition; }; export interface IBaseRequest { select?: string | KeyOf[]; keyword?: string; condition?: ICondition; language?: ILanguage; page?: number; limit?: number; offset?: number; cursor?: string; cursorKey?: Listable>; sort?: ISort; near?: INear; populate?: IPopulate; [key: string]: any; } export {}; //# sourceMappingURL=base.request.d.ts.map