import type { LoadingState } from 'robodux'; import type { QueryState } from './slice'; declare type ActionFn
= (p: P) => { toString: () => string; }; declare type ActionFnSimple = () => { toString: () => string; }; interface SagaAction
{ type: string; payload: { key: string; options: P; }; } export interface UseApiProps
extends LoadingState { trigger: (p: P) => void; action: ActionFn
;
}
export interface UseApiSimpleProps extends LoadingState {
trigger: () => void;
action: ActionFn;
}
export interface UseApiAction extends LoadingState {
trigger: () => void;
action: A;
}
export declare type UseApiResult = UseApiProps | UseApiSimpleProps | UseApiAction;
interface UseCacheResult >(action: A): UseApiAction;
export declare function useApi >(action: ActionFn ): UseApiProps(action: SagaAction | ActionFn): LoadingState