import type { Hook, WorkflowRunStatus } from '@workflow/world'; export interface HookActionCallbacks { /** Called after a successful action */ onSuccess?: () => void; } export interface UseHookActionsOptions { onResolve: (hook: Hook, payload: unknown) => Promise; callbacks?: HookActionCallbacks; } export interface UseHookActionsReturn { /** Whether the hook is currently being resolved */ isResolving: boolean; /** The hook currently selected for resolution (null if none) */ selectedHook: Hook | null; /** Open the resolve modal for a specific hook */ openResolveModal: (hook: Hook) => void; /** Close the resolve modal */ closeResolveModal: () => void; /** Handle submitting the resolve payload */ handleResolve: (payload: unknown) => Promise; } /** * React hook for managing hook action state. * Use this to coordinate the resolve modal across components. */ export declare function useHookActions({ onResolve, callbacks, }: UseHookActionsOptions): UseHookActionsReturn; export interface HookActionsDropdownItemProps { /** The hook to act on */ hook: Hook; /** The current run status (used to determine if actions are available) */ runStatus?: WorkflowRunStatus; /** Stop click event propagation (useful in table rows) */ stopPropagation?: boolean; /** Called when the resolve action is triggered */ onResolveClick: (hook: Hook) => void; /** Custom DropdownMenuItem component (allows using the consumer's UI library) */ DropdownMenuItem: React.ComponentType<{ onClick?: (e: React.MouseEvent) => void; disabled?: boolean; children: React.ReactNode; }>; } /** * Dropdown menu item for resolving a hook. * This is a single menu item component that can be composed into dropdown menus. */ export declare function ResolveHookDropdownItem({ hook, stopPropagation, onResolveClick, DropdownMenuItem, }: HookActionsDropdownItemProps): React.JSX.Element; export interface HookResolveModalProps { /** The hook actions state from useHookActions */ hookActions: UseHookActionsReturn; } /** * Convenience wrapper that renders the ResolveHookModal using useHookActions state. * Place this at the top level of your component (outside any iteration). */ export declare function HookResolveModalWrapper({ hookActions, }: HookResolveModalProps): React.JSX.Element | null; export { ResolveHookModal } from './sidebar/resolve-hook-modal'; //# sourceMappingURL=hook-actions.d.ts.map