import * as react_jsx_runtime from 'react/jsx-runtime'; import { Hex } from '@ecp.eth/sdk/core/schemas'; type PendingWalletConnectionAction = { type: "like"; commentId: Hex; } | { type: "unlike"; commentId: Hex; } | { type: "react"; commentId: Hex; reactionType: string; } | { type: "unreact"; commentId: Hex; reactionType: string; } | { type: "prepareReply"; commentId: Hex; }; type PendingWalletConnectionActionHandler = { like: () => Promise | void; unlike: () => Promise | void; react?: (reactionType: string) => Promise | void; unreact?: (reactionType: string) => Promise | void; prepareReply: () => Promise | void; }; type PendingWalletConnectionActionsContextType = { onAfterConnect?: () => Promise; onAfterConnectResultPromise?: Promise; addAction: (action: PendingWalletConnectionAction) => void; addHandler: (commentId: Hex, handler: PendingWalletConnectionActionHandler) => void; deleteHandler: (commentId: Hex) => void; }; declare const PendingWalletConnectionActionsProvider: ({ children, }: { children: React.ReactNode; }) => react_jsx_runtime.JSX.Element; declare const usePendingWalletConnectionActionsContext: () => PendingWalletConnectionActionsContextType; /** * Setup handlers for the specified comment and consume the corresponding pending actions when wallet is connected. * @returns */ declare const useConsumePendingWalletConnectionActions: ({ commentId, onLikeAction, onUnlikeAction, onReactAction, onUnreactAction, onPrepareReplyAction, }: { commentId: Hex; onLikeAction: (commentId: Hex) => Promise | void; onUnlikeAction: (commentId: Hex) => Promise | void; onReactAction?: (commentId: Hex, reactionType: string) => Promise | void; onUnreactAction?: (commentId: Hex, reactionType: string) => Promise | void; onPrepareReplyAction: (commentId: Hex) => Promise | void; }) => void; /** * The hook returns a function that ensures wallet is connected before calling into the callback, * then it executes the action returned from the callback. */ declare const useConnectBeforeAction: () => (getAction: (...args: TParams) => Promise | PendingWalletConnectionAction | void) => (...args: TParams) => Promise; export { PendingWalletConnectionActionsProvider, useConnectBeforeAction, useConsumePendingWalletConnectionActions, usePendingWalletConnectionActionsContext };