import ERNIEBot from './index';
import { APIError } from './error';
import type { HTTPSearchParams, APIRequestInit, APIResponseProps, APIRequestOptions, APIHeaders, MaybePromise } from './interfaces';
export type APIBackendModuleInfo = {
    moduleId: string;
};
export type APIBackendResourceInfo = {
    resourceId: string;
    models: {
        [model: string]: APIBackendModuleInfo;
    };
};
export type APIBackendResources = {
    [resource: string]: APIBackendResourceInfo;
};
export declare abstract class APIBackend {
    client: ERNIEBot;
    abstract apiType: string;
    abstract baseURL: string;
    abstract resources: APIBackendResources;
    setup(client: ERNIEBot): void;
    /**
     * 覆盖当前请求路径
     *
     * @param path - 当前路径
     * @param model - 请求模型
     * @returns 返回空值将使用预设的路径
     */
    overrideResourcePath(path: string, model: string): string | undefined;
    /**
     * 返回默认请求参数
     */
    defaultQuery(): MaybePromise<HTTPSearchParams>;
    /**
     * 添加授权请求头
     */
    authHeaders(options: APIRequestOptions): APIHeaders;
    /**
     * 预处理请求
     */
    prepareRequest(req: APIRequestInit, init: {
        url: string;
        options: APIRequestOptions;
    }): MaybePromise<void>;
    transformResponse(type: 'json', data: any): any;
    parseResponse({ response, options, controller }: APIResponseProps): Promise<any>;
    protected makeStatusError(ecode: number | undefined, error: Error, message: string, headers: Headers): APIError;
}
