UNPKG

anton-fedosieiev-sdk

Version:
41 lines (40 loc) 1.05 kB
import { FILTER_COMPARISON } from '../constants'; export declare type ApiResponse<T> = { docs: [T]; total: number; limit?: number; offset?: number; page?: number; pages?: number; }; export declare type HasId = { _id: string; }; export declare type Sort = { property: string; direction: 'asc' | 'desc'; }; export declare type Pagination = { limit: number; page?: number; offset?: number; }; export declare type Filter = { property: string; value?: string | string[] | RegExp; exclude?: boolean; exists?: boolean; comparisonRule?: typeof FILTER_COMPARISON.LESS_THAN | typeof FILTER_COMPARISON.LESS_THAN_EQUAL | typeof FILTER_COMPARISON.GREATER_THAN | typeof FILTER_COMPARISON.GREATER_THAN_EQUAL; }; export declare type UserRequestParams = { pagination?: Pagination; sort?: Sort; filter?: Filter; }; export declare type RequestParams = UserRequestParams & { id?: string; token?: string; }; export declare type AuthRequestParams = RequestParams & { token: string; };