import { HttpMethod } from './generated.js'; import { ReactNode } from 'react'; import { Node } from '@lattice-php/core/types'; import { Effect } from './effects/types.js'; type ActionNode = Node<"action" | "action.bulk">; export type ClickBehavior = { kind: "navigate"; href: string; method: HttpMethod; } | { kind: "action"; action: ActionNode; } | { kind: "modal"; onClick: () => void; } | { kind: "effects"; onClick: () => void; } | { kind: "none"; }; export type TriggerState = { onClick: () => void; processing: boolean; }; export type ActionSubmitOptions = { /** Evaluated fresh at submit time, e.g. a bulk action's current selection. */ extraData?: () => Record; onBefore?: () => void; onError?: () => void; onSuccess?: () => void; }; export type ActionTriggerRenderer = (props: { action: ActionNode; children: (trigger: TriggerState) => ReactNode; options?: ActionSubmitOptions; }) => ReactNode; export declare function ActionTriggerProvider({ children, render, }: { children: ReactNode; render: ActionTriggerRenderer; }): import("react").JSX.Element; export declare function useActionTrigger(): ActionTriggerRenderer | null; export declare function ActionTrigger({ action, children, options, }: { action: ActionNode; children: (trigger: TriggerState) => ReactNode; options?: ActionSubmitOptions; }): import("react").JSX.Element; export type ActionNodeOptionsResolver = (node: Node) => ActionSubmitOptions | undefined; export declare function ActionNodeOptionsProvider({ children, resolve, }: { children: ReactNode; resolve: ActionNodeOptionsResolver; }): import("react").JSX.Element; export declare function useActionNodeOptions(node: Node): ActionSubmitOptions | undefined; export declare function useClickBehavior(props: { href?: string | null; method?: HttpMethod | null; action?: Node | null; effects?: Effect[] | null; modal?: Node<"modal"> | null; }): ClickBehavior; export {};