import { type EditorUnpublishedState } from "../controller/deriveEditorUnpublishedState";
import { type AutosaveState } from "./stores/autosaveStore";
import { type ArrayKeysState } from "./stores/arrayKeysStore";
import { type ViewportState } from "./stores/viewportStore";
import { type AiOverlaysState } from "./stores/aiOverlaysSlice";
import { type EditorValueSnapshot, type EditorBlockItem, type EditorBlockId, type NormalizedEditorBlockItem, type DraftBlockBaselineInput, type DraftBlockBaselineUpdateMetaInput, type DraftBlockInitMetaInput, type EditorCommand, type EditorContentValues, type EditorDraftSnapshot, type EditorEffect, type EditorHistorySnapshot, type EditorMetadataValues, type BlockPublishedBaselineInput } from "./editorHistory";
import { type HistoryState } from "./editorHistory";
import type { FocusRequest } from "./stores/types";
import { type BlockDraftSaveability, type BlockDraftValidationIssue, type ResolveBlockManifest } from "./blockValidationView";
export type { AutosaveStatusValue, AutosaveStatus, AutosaveHandle, AutosaveType, FocusRequest, ViewportMode, ViewportWidth, ZoomLevel, } from "./stores/types";
export type { AutosaveState } from "./stores/autosaveStore";
export type { ArrayKeysState } from "./stores/arrayKeysStore";
export type { ViewportState } from "./stores/viewportStore";
export type { EditorCommand, EditorBlockItem, EditorDraftSnapshot, EditorHistorySnapshot, EditorEffect, } from "./editorHistory";
export type MetadataSnapshot = EditorValueSnapshot<EditorMetadataValues | null>;
export type ContentSnapshot = EditorValueSnapshot<EditorContentValues | null>;
export type PreviewSidebarTab = "editor" | "assistant";
export type ActivePreviewField = Readonly<{
    blockId: EditorBlockId;
    fieldPath: string;
}> | null;
/**
 * Version of the local draft snapshot that a completed autosave request persisted.
 * The reducer uses this to accept the saved baseline without treating older
 * in-flight saves as acknowledgements of newer local edits.
 */
export type AutosaveAcknowledgement = Readonly<{
    acknowledgedVersion: number;
}>;
/**
 * Form-facing metadata facade. Consumers pass plain records for ergonomics;
 * the reducer core normalizes and brands values at this boundary.
 */
export type MetadataState = {
    getSnapshot: () => MetadataSnapshot;
    getCurrentValues: () => Record<string, unknown> | null;
    hydrate: (baseline: Record<string, unknown> | null, current?: Record<string, unknown> | null, published?: Record<string, unknown> | null) => void;
    setPublishedBaseline: (published: Record<string, unknown> | null) => void;
    hasUnpublishedChanges: () => boolean;
    setBaseline: (baseline: Record<string, unknown> | null) => void;
    setCurrentValues: (values: Record<string, unknown> | null) => void;
    setAtPath: (path: string, value: unknown) => void;
    getAtPath: <R = unknown>(path: string) => R | undefined;
    autosaveSucceeded: (savedValues: Record<string, unknown> | null, acknowledgement?: AutosaveAcknowledgement) => void;
    autosaveFailed: (message?: string) => void;
    clearError: () => void;
};
export type ContentState = Omit<MetadataState, "getSnapshot"> & {
    getSnapshot: () => ContentSnapshot;
};
export type EditorHistoryState = HistoryState<EditorHistorySnapshot>;
export type BlockValidationState = {
    markPathEdited: (blockId: EditorBlockId, path: string) => void;
    markMeaningfulEdit: (blockId: EditorBlockId) => void;
    isPathEdited: (blockId: EditorBlockId, path: string) => boolean;
    hasMeaningfulEdit: (blockId: EditorBlockId) => boolean;
    showAllValidation: (blockId: EditorBlockId) => boolean;
    setShowAllValidation: (blockId: EditorBlockId, visible: boolean) => void;
    clearBlock: (blockId: EditorBlockId) => void;
    clearAll: () => void;
    getTouchedPaths: (blockId: EditorBlockId) => ReadonlySet<string>;
    getIncompleteSummary: () => string | null;
    getIncompleteCount: () => number;
    getFirstIncompleteBlock: () => {
        blockId: EditorBlockId;
        kind: string;
        issues: readonly BlockDraftValidationIssue[];
    } | null;
    getBlockSaveability: (blockId: EditorBlockId) => BlockDraftSaveability;
};
export type DraftsState = {
    getBlockSnapshot: (blockId: EditorBlockId) => EditorDraftSnapshot | null;
    getCurrentValues: (blockId: EditorBlockId) => Record<string, unknown> | null;
    inspect: () => EditorDraftSnapshot[];
    /**
     * Form-facing drafts facade. Baseline inputs stay unbranded so editor consumers
     * can pass raw form values; the reducer core normalizes and brands them here.
     */
    initNewBlock: (blockId: EditorBlockId, baseline: DraftBlockBaselineInput, meta: DraftBlockInitMetaInput) => void;
    updateBlockBaseline: (blockId: EditorBlockId, baseline: DraftBlockBaselineInput, meta?: DraftBlockBaselineUpdateMetaInput) => void;
    setBlockPublishedBaselinesFromBlocks: (blocks: readonly BlockPublishedBaselineInput[]) => void;
    edit: (blockId: EditorBlockId, content: Record<string, unknown> | null) => void;
    remove: (blockId: EditorBlockId) => void;
    clearError: (blockId: EditorBlockId) => void;
    setPending: (blockId: EditorBlockId) => void;
    clearPending: (blockId: EditorBlockId) => void;
    setFailed: (blockId: EditorBlockId, message?: string) => void;
    autosaveSucceeded: (blockId: EditorBlockId, content: Record<string, unknown> | null, acknowledgement?: AutosaveAcknowledgement) => void;
    autosaveFailed: (blockId: EditorBlockId, message?: string) => void;
    setAtPath: (blockId: EditorBlockId, path: string, value: unknown) => void;
    getAtPath: <T = unknown>(blockId: EditorBlockId, path: string) => T | undefined;
    updateBlockOrder: (blockIds: EditorBlockId[]) => void;
    hasUnpublishedBlockChanges: () => boolean;
    getFirstUnpublishedBlockChange: () => {
        blockId: EditorBlockId;
        kind: string;
        reason: "missing_published" | "missing_current" | "different";
        currentContent: Record<string, unknown> | null;
        publishedContent: Record<string, unknown> | null;
    } | null;
    markAllBlocksAsPublished: () => void;
    onChange: (listener: (blockId: EditorBlockId) => void) => () => void;
};
export type CreateEditorUiStoreOptions = Readonly<{
    resolveBlockManifest?: ResolveBlockManifest;
}>;
type RestoreListener = (transition: {
    previous: EditorHistorySnapshot;
    next: EditorHistorySnapshot;
    effects: readonly EditorEffect[];
}) => void;
export type EditorUiState = {
    drawerOpen: boolean;
    previewSidebarTab: PreviewSidebarTab;
    activePreviewField: ActivePreviewField;
    focusRequest: FocusRequest;
    activeBlockId: EditorBlockId | null;
    setDrawerOpen: (open: boolean) => void;
    setPreviewSidebarTab: (tab: PreviewSidebarTab) => void;
    setActivePreviewField: (field: ActivePreviewField) => void;
    requestFocus: (payload: Omit<NonNullable<FocusRequest>, "requestId">) => void;
    clearFocus: () => void;
    setActiveBlockId: (id: EditorBlockId | null) => void;
    getDraftSyncState: () => "baseline" | "pending" | "failed";
    getUnpublishedState: () => EditorUnpublishedState;
    hasAnyUnpublishedChanges: () => boolean;
    history: {
        getState: () => EditorHistoryState;
        canUndo: () => boolean;
        canRedo: () => boolean;
        applyCommand: (command: EditorCommand) => void;
        restorePresent: (snapshot: EditorHistorySnapshot) => void;
        remapBlockId: (fromBlockId: EditorBlockId, toBlockId: EditorBlockId) => void;
        endCoalescing: () => void;
        clearForVersionRestore: () => void;
        undo: () => void;
        redo: () => void;
        clear: () => void;
        onRestore: (listener: RestoreListener) => () => void;
    };
    blockValidation: BlockValidationState;
    structure: {
        getList: () => readonly NormalizedEditorBlockItem[];
        replaceList: (next: readonly EditorBlockItem[]) => void;
    };
    drafts: DraftsState;
    metadata: MetadataState;
    content: ContentState;
    autosave: AutosaveState;
    arrayKeys: ArrayKeysState;
    viewport: ViewportState;
    aiOverlays: AiOverlaysState;
};
export declare function createEditorUiStore(options?: CreateEditorUiStoreOptions): import("zustand").StoreApi<EditorUiState>;
export type EditorUiStoreInstance = ReturnType<typeof createEditorUiStore>;
export declare const EditorUiStoreProvider: import("react").Provider<import("zustand").StoreApi<EditorUiState> | null>;
export declare function useEditorUiStore<T>(selector: (state: EditorUiState) => T): T;
export declare function useEditorUiStoreInstance(): EditorUiStoreInstance;
export declare function useOptionalEditorUiStoreInstance(): EditorUiStoreInstance | null;
