/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import { Options, Result } from 'ahooks/es/useRequest/src/types';
import { SetState } from 'ahooks/lib/useSetState';
import { AxiosRequestConfig } from 'axios';
type FunctionService = (...args: any[]) => Promise<any>;
export type ReturnTypeOfUseRequest<TData = any> = ReturnType<typeof useRequest<TData>>;
export type ResourceActionOptions<P = any> = {
    resource?: string;
    resourceOf?: any;
    action?: string;
    params?: P;
    url?: string;
    skipNotify?: boolean | ((error: any) => boolean);
    skipAuth?: boolean;
};
export type UseRequestService<P> = AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService;
export type UseRequestOptions = Options<any, any> & {
    uid?: string;
};
export interface UseRequestResult<P> extends Result<P, any> {
    state: any;
    setState: SetState<{}>;
}
export declare function useRequest<P>(service: UseRequestService<P>, options?: UseRequestOptions): UseRequestResult<P>;
export {};
