export declare const useAsync: (fn: () => Promise, { onSuccess, onError, }?: { onSuccess?: (result: T) => void; onError?: (error: unknown) => void; }) => { execute: () => void; state: State; }; export declare enum StateType { Base = 0, Running = 1, Error = 2, Complete = 3 } declare const State: { Base: () => { type: StateType.Base; }; Complete: (result: T) => { result: T; type: StateType.Complete; }; ErrorState: (error: unknown) => { error: unknown; type: StateType.Error; }; Running: () => { type: StateType.Running; }; }; type Base = ReturnType; type Running = ReturnType; type Complete = ReturnType>; type ErrorState = ReturnType; type State = Base | Running | Complete | ErrorState; export {};