import { ParamConfig } from '../interface'; import { Field } from '../components/formFields/common'; export interface InterfaceConfig { domain?: string; url?: string; urlParams?: { field: string; data: ParamConfig; }[]; method?: 'GET' | 'POST'; contentType?: 'json' | 'form-data'; withCredentials?: boolean; params?: { field: string; data: ParamConfig; }[]; data?: { field: string; data: ParamConfig; }[]; condition?: { enable?: boolean; field?: string; value?: any; success?: { type: 'none'; } | { type: 'modal'; content?: { type: 'static'; content?: string; } | { type: 'field'; field?: string; }; }; fail?: { type: 'none'; } | { type: 'modal'; content?: { type: 'static'; content?: string; } | { type: 'field'; field?: string; }; }; }; response?: { root?: string; } | { field?: string; path?: string; }[]; cache?: { global?: string; disabled?: boolean; }; } export interface IRenderSuccessModal { message: string; } export interface IRenderFailModal { message: string; } export default class InterfaceHelper { static cacheResolve: { [key: string]: ((value: any) => void)[]; }; static cache: { [key: string]: any; }; private _config; private _url; private _params; private _data; private _response; protected renderSuccessModal(props: IRenderSuccessModal): Promise; protected renderFailModal(props: IRenderFailModal): Promise; request(config: InterfaceConfig, source: any, datas: { record?: object; data: object[]; step: { [field: string]: any; }; extraContainerPath?: string; }, option?: { loadDomain?: (domain: string) => Promise; extra_data?: { params?: any; data?: any; }; }, _this?: Field): Promise; }