import { Cache } from '@easy-coder/sdk/helper';
import { EasyCoderHttp, EasyCoderData, Modal, WithEnumsGroup, FileInRecord, CRUD } from '../type';

interface QueryCacheMatch {
    key: string;
    modalName: string;
    method: string;
    options: CRUD.FindOption<any>;
}
interface RequestCacheMatch {
    url: string;
    method: string;
    params?: Record<string, any>;
    data?: Record<string, any>;
}
declare class Data {
    readonly requestCache: Cache<RequestCacheMatch>;
    readonly requestCacheSymbol: Record<string, symbol[]>;
    readonly queryCache: Cache<QueryCacheMatch>;
    readonly queryCacheSymbol: Record<string, symbol[]>;
    readonly cache: Cache<string>;
    readonly cacheKey: Readonly<{
        modalList: "MODAL_LIST";
        enumList: "ENUM_LIST";
    }>;
    private errorListenerList;
    config: EasyCoderData.Config;
    constructor();
    setConfig(config: EasyCoderData.Config): void;
    modalList(): Promise<Modal[]>;
    enumGroupList(): Promise<WithEnumsGroup[]>;
    crud<M extends Record<string, any>>(modalName: string, method: 'find', options: CRUD.FindOption<M>, cacheKey?: string): Promise<M[]>;
    crud<M extends Record<string, any>>(modalName: string, method: 'findOne', options: CRUD.FineOneOption<M>, cacheKey?: string): Promise<M | undefined>;
    crud<M extends Record<string, any>>(modalName: string, method: 'count', options: CRUD.CountOption<M>, cacheKey?: string): Promise<number>;
    crud<M extends Record<string, any>>(modalName: string, method: 'del', options: CRUD.DelOption<M>): Promise<M[]>;
    crud<M extends Record<string, any>>(modalName: string, method: 'update', options: CRUD.UpdateOption<M>): Promise<M[]>;
    crud<M extends Record<string, any>>(modalName: string, method: 'update', options: CRUD.UpdateWithIdOption<M>): Promise<M[]>;
    crud<M extends Record<string, any>>(modalName: string, method: 'create', options: CRUD.CreateOption<M>): Promise<M>;
    crud<M extends Record<string, any>>(modalName: string, method: 'create', options: CRUD.BatchCreateOption<M>): Promise<M[]>;
    clearCrudCache(cacheKey: string): void;
    uploadFile(file: File, options?: EasyCoderHttp.UploadOptions): Promise<FileInRecord | undefined>;
    getFilePath(fileId: number): string;
    get<T extends any = any>(url: string, params?: Record<string, any>, options?: EasyCoderHttp.UseHeaderOption): Promise<EasyCoderData.ResStruct<T> | undefined>;
    post<T extends any = any>(url: string, data?: Record<string, any>, options?: EasyCoderHttp.UseHeaderOption): Promise<EasyCoderData.ResStruct<T> | undefined>;
    put<T extends any = any>(url: string, data?: Record<string, any>, options?: EasyCoderHttp.UseHeaderOption): Promise<EasyCoderData.ResStruct<T> | undefined>;
    del<T extends any = any>(url: string, data?: Record<string, any>, options?: Omit<EasyCoderHttp.UseHeaderOption, 'cache'>): Promise<EasyCoderData.ResStruct<T> | undefined>;
    clearRequestCache(url: string, method: 'GET' | 'POST'): void;
    private requestWithCache;
    private _modalList;
    private _enumGroupList;
    private triggerError;
    request<T extends any = any>(options: EasyCoderHttp.RequestOptions): Promise<EasyCoderHttp.Response<T>>;
    setRequest(fn: (options: EasyCoderHttp.RequestOptions) => Promise<EasyCoderHttp.Response>): void;
    generateHeader(options?: EasyCoderHttp.UseHeaderOption): EasyCoderHttp.UseHeaderReturn;
    useHeader(fn: EasyCoderHttp.UseHeader): void;
}
declare const _default: Data;
export default _default;
