1 | import { Domain, DomainModule, SearchFilter, SearchOptions as BfSearchOptions } from 'bf-types';
|
2 | import { Nullable } from '../common';
|
3 | import type { HeadersType, ObjectType } from '../system/Types';
|
4 | import { RequestMethod } from './Consts';
|
5 | export declare type SearchOptions<H extends HeadersType = HeadersType> = Omit<BfSearchOptions, 'filters'> & {
|
6 | headers?: H;
|
7 | withFormData?: boolean;
|
8 | };
|
9 | export interface Api {
|
10 | <R = any, P = ObjectType, H extends HeadersType = HeadersType>(method: RequestMethod, uri: string, data?: P, headers?: H): Promise<Nullable<R>>;
|
11 | get: <R = any, P = ObjectType, H extends HeadersType = HeadersType>(uri: string, params?: P, headers?: H, customBaseUrl?: string) => Promise<Nullable<R>>;
|
12 | delete: <R = any, P = ObjectType, H extends HeadersType = HeadersType>(uri: string, params?: P, headers?: H, customBaseUrl?: string) => Promise<Nullable<R>>;
|
13 | post: <R = any, P = ObjectType, H extends HeadersType = HeadersType>(uri: string, payload?: P, headers?: H, customBaseUrl?: string) => Promise<Nullable<R>>;
|
14 | put: <R = any, P = ObjectType, H extends HeadersType = HeadersType>(uri: string, payload?: P, headers?: H, customBaseUrl?: string) => Promise<Nullable<R>>;
|
15 | search: <T = any, H extends HeadersType = HeadersType>(domain: Domain, module: DomainModule, filters: SearchFilter[], options?: SearchOptions<H>) => Promise<T[]>;
|
16 | }
|