import { AnyAction, AsyncThunkPayloadCreatorReturnValue, ThunkDispatch } from '@reduxjs/toolkit'; import { BaseThunkAPI } from '@reduxjs/toolkit/dist/createAsyncThunk'; import { FallbackIfUnknown } from '@reduxjs/toolkit/dist/tsHelpers'; import { Web3ProviderExtras } from '@aut-protocol/abi-types'; export declare type AppDispatch = ThunkDispatch; export interface BaseThunkArgs { provider: (addressOrName: string, extras?: Partial>) => Promise; updateTransactionStateAction?: (state: string, dispatch: AppDispatch) => void; updateErrorStateAction?: (error: string, dispatch: AppDispatch) => void; } export interface ProviderEvent { type?: string; event: EventType; } export interface ProviderThunkType { type: string; } export declare type ThunkArgs = ProviderEvent | ProviderThunkType; export interface AsyncThunkConfig { state?: any; dispatch?: AppDispatch; extra?: any; rejectValue?: any; serializedErrorType?: any; pendingMeta?: any; fulfilledMeta?: any; rejectedMeta?: any; } declare type GetState = ThunkApiConfig extends { state: infer State; } ? State : any; declare type GetExtra = ThunkApiConfig extends { extra: infer Extra; } ? Extra : any; declare type GetDispatch = ThunkApiConfig extends { dispatch: AppDispatch; } ? FallbackIfUnknown, GetExtra, AnyAction>> : ThunkDispatch, GetExtra, AnyAction>; export declare type GetThunkAPI = BaseThunkAPI, GetExtra, GetDispatch, GetRejectValue, GetRejectedMeta, GetFulfilledMeta>; declare type GetRejectValue = ThunkApiConfig extends { rejectValue: infer RejectValue; } ? RejectValue : any; declare type GetFulfilledMeta = ThunkApiConfig extends { fulfilledMeta: infer FulfilledMeta; } ? FulfilledMeta : any; declare type GetRejectedMeta = ThunkApiConfig extends { rejectedMeta: infer RejectedMeta; } ? RejectedMeta : any; export declare type AsyncThunkPayloadCreator = (contract: ContractFunction, arg?: ThunkArg, thunkAPI?: GetThunkAPI) => Promise>; export {};