import { type ContentEntrySnapshot, type RoutingHelpers } from "@riverbankcms/content-model";
import type { EditorUiStoreInstance } from "../ui/editorUiStore";
import type { PublishEntryResult } from "../services/contentEntryServices";
/** Services interface for entry operations */
export type EntryServices = {
    deleteEntry: () => Promise<void>;
};
export type PublishOptions = {
    mode?: "default" | "now";
};
/** Definition with services */
export type EntryDefinition = {
    services: EntryServices;
    publish?: {
        buildPayload?: (values: Record<string, unknown>, entry: ContentEntrySnapshot) => unknown;
    };
};
/**
 * Options for resetting from snapshot.
 */
export type ResetFromSnapshotOptions = {
    /**
     * When true, preserves current form values after reset.
     * Useful after publish to keep the UI showing the just-published values.
     */
    keepValues?: boolean;
};
export type EntryActionsOptions<TEntry extends ContentEntrySnapshot> = {
    /** Current entry snapshot */
    entry: TEntry;
    /** UI store instance (to read latest metadata values at call time) */
    uiStore: EditorUiStoreInstance;
    /** Whether this entry has a route (pages vs content) */
    hasRoute: boolean;
    /** Routing helpers (for routable published baseline derivations). */
    routing?: RoutingHelpers;
    /** Publish mutation from react-query */
    publishMutation: {
        mutateAsync: (payload?: unknown) => Promise<PublishEntryResult<TEntry>>;
    };
    /** Discard draft mutation from react-query */
    discardMutation: {
        mutateAsync: () => Promise<TEntry>;
    };
    /** Entry definition with services */
    definition: EntryDefinition;
    /** Function to sync entry and create snapshot */
    syncEntry: (nextEntry: TEntry, opts?: {
        clearError?: boolean;
    }) => {
        baseline: Record<string, unknown>;
        values: Record<string, unknown>;
    };
    /** Function to reset form from snapshot */
    resetFromSnapshot: (snapshot: {
        baseline: Record<string, unknown>;
        values: Record<string, unknown>;
    }, resetOptions?: ResetFromSnapshotOptions) => void;
    /** Function to set error message */
    setErrorMessage: (message: string | null) => void;
};
/**
 * Hook to handle entry actions (publish, discard, delete).
 * Extracts action handler logic from the provider for better separation of concerns.
 */
export declare function useEntryActions<TEntry extends ContentEntrySnapshot>({ entry, uiStore, hasRoute, routing, publishMutation, discardMutation, definition, syncEntry, resetFromSnapshot, setErrorMessage, }: EntryActionsOptions<TEntry>): {
    saveDraft: () => Promise<void>;
    publish: (options?: PublishOptions) => Promise<void>;
    discardDraft: () => Promise<void>;
    deleteEntry: () => Promise<void>;
};
