import { RootState, WalletAdapter } from '../types'; import type { Action } from '../useReducer'; import GatekeeperClient from '../utils/gatekeeperClient'; import { ChainConfig, NetworkConfig } from '../networkConfig'; export type UseRefreshAction = { type: 'refresh_start'; } | { type: 'refresh_in_progress'; } | { type: 'refresh_with_powo'; } | { type: 'refresh_with_powo_in_progress'; } | { type: 'refresh_complete'; } | { type: 'refresh_clear_timeout'; } | { type: 'refresh_set_timeout'; refreshTimeoutId: number | undefined; } | { type: 'refresh_token_success'; }; export declare const reducer: (state: RootState, action: Action) => RootState; declare const useRefresh: ({ stage, gatekeeperClient, networkConfig, chainConfig, }: { stage: string; gatekeeperClient: GatekeeperClient | undefined; networkConfig: NetworkConfig; chainConfig: ChainConfig; }, state: Partial, dispatch: React.Dispatch) => { checkForRefreshWithTimeout: () => void; waitForUnexpiredGatewayToken: () => Promise; refreshToken: (useWallet: WalletAdapter) => ({ proof, payload }: { proof?: string | undefined; payload?: unknown; }) => Promise; }; export default useRefresh;