import { type CaseReducer, type PayloadAction } from "@reduxjs/toolkit";
import { type IDashboardFilterReference, type IDashboardLayout, type IDashboardLayoutContainerDirection, type IDashboardLayoutSectionHeader, type IDrillDownIntersectionIgnoredAttributes, type IDrillDownReference, type IDrillToLegacyDashboard, type IInsightWidget, type IInsightWidgetConfiguration, type IKpiComparisonDirection, type IKpiComparisonTypeComparison, type IKpiWidgetConfiguration, type InsightDrillDefinition, type ObjRef, type ScreenSize, type VisualizationProperties } from "@gooddata/sdk-model";
import { type IVisualizationSizeInfo } from "@gooddata/sdk-ui-ext";
import { type IdentityMapping } from "../../../../_staging/dashboard/dashboardLayout.js";
import { type ObjRefMap } from "../../../../_staging/metadata/objRefMap.js";
import { type ILayoutItemPath, type ILayoutSectionPath } from "../../../../types.js";
import { type ExtendedDashboardItem, type ExtendedDashboardLayoutSection, type ExtendedDashboardWidget, type IItemWithHeight, type IItemWithWidth, type StashedDashboardItemsId } from "../../../types/layoutTypes.js";
import { type IWidgetDescription, type IWidgetHeader } from "../../../types/widgetTypes.js";
import { type ITabsState } from "../tabsState.js";
type LayoutReducer<A> = CaseReducer<ITabsState, PayloadAction<A>>;
type AdaptedLayoutReducer<P> = CaseReducer<ITabsState, PayloadAction<P>>;
/**
 * Payload for updating widget identities for a specific tab.
 */
type UpdateWidgetIdentitiesForTabPayload = {
    tabId: string;
    mapping: ObjRefMap<IdentityMapping>;
};
type AddSectionActionPayload = {
    section: ExtendedDashboardLayoutSection;
    index: ILayoutSectionPath;
    usedStashes: StashedDashboardItemsId[];
};
type RemoveSectionActionPayload = {
    index: ILayoutSectionPath;
    stashIdentifier?: StashedDashboardItemsId;
};
type ChangeSectionActionPayload = {
    index: ILayoutSectionPath;
    header: IDashboardLayoutSectionHeader;
};
type ToggleLayoutSectionHeadersPayload = {
    layoutPath: ILayoutItemPath | undefined;
    enableSectionHeaders: boolean;
};
type ToggleLayoutDirectionPayload = {
    layoutPath: ILayoutItemPath | undefined;
    direction: IDashboardLayoutContainerDirection;
};
type changeItemsHeightActionPayload = {
    sectionIndex: ILayoutSectionPath;
    itemIndexes: number[];
    height: number;
};
type updateHeightOfMultipleItemsActionPayload = {
    itemsWithSizes: IItemWithHeight[];
};
type updateWidthOfMultipleItemsActionPayload = {
    itemsWithSizes: IItemWithWidth[];
};
type changeItemWidthActionPayload = {
    layoutPath: ILayoutItemPath;
    width: number;
};
type MoveSectionActionPayload = {
    sectionIndex: ILayoutSectionPath;
    toIndex: ILayoutSectionPath;
};
type AddSectionItemsActionPayload = {
    layoutPath: ILayoutItemPath;
    items: ExtendedDashboardItem[];
    usedStashes: StashedDashboardItemsId[];
};
type MoveSectionItemActionPayload = {
    itemIndex: ILayoutItemPath;
    toItemIndex: ILayoutItemPath;
};
type RemoveSectionItemActionPayload = {
    itemIndex: ILayoutItemPath;
    stashIdentifier?: StashedDashboardItemsId;
};
type ReplaceSectionItemActionPayload = {
    layoutPath: ILayoutItemPath;
    newItems: ExtendedDashboardItem[];
    stashIdentifier?: StashedDashboardItemsId;
    usedStashes: StashedDashboardItemsId[];
};
type ReplaceWidgetHeader = {
    ref: ObjRef;
    header: IWidgetHeader;
};
type ReplaceWidgetDescription = {
    ref: ObjRef;
    description: IWidgetDescription;
};
type ReplaceWidgetDrillDefinitions = {
    ref: ObjRef;
    drillDefinitions: InsightDrillDefinition[];
};
type ReplaceWidgetBlacklistHierarchies = {
    ref: ObjRef;
    blacklistHierarchies: IDrillDownReference[];
};
type ReplaceWidgetBlacklistAttributes = {
    ref: ObjRef;
    blacklistAttributes: ObjRef[];
};
type ReplaceWidgetDrillDownIntersectionIgnoredAttributes = {
    ref: ObjRef;
    ignoredDrillDownIntersectionIgnoredAttributes: IDrillDownIntersectionIgnoredAttributes[];
};
type ReplaceWidgetVisProperties = {
    ref: ObjRef;
    properties: VisualizationProperties | undefined;
};
type ReplaceWidgetVisConfiguration = {
    ref: ObjRef;
    config: IInsightWidgetConfiguration | undefined;
};
type ReplaceWidgetInsight = {
    ref: ObjRef;
    insightRef: ObjRef;
    properties: VisualizationProperties | undefined;
    header: IWidgetHeader | undefined;
    newSize?: IVisualizationSizeInfo;
};
type ReplaceWidgetFilterSettings = {
    ref: ObjRef;
    ignoreDashboardFilters?: IDashboardFilterReference[];
    dateDataSet?: ObjRef;
};
type RemoveIgnoredAttributeFilter = {
    displayFormRefs: ObjRef[];
};
type ReplaceWidgetDateDataset = {
    ref: ObjRef;
    dateDataSet?: ObjRef;
};
type RemoveIgnoredDateFilter = {
    dateDataSets: ObjRef[];
};
type ReplaceKpiWidgetMeasure = {
    ref: ObjRef;
    measureRef: ObjRef;
};
type ReplaceKpiWidgetComparison = {
    ref: ObjRef;
    comparisonType: IKpiComparisonTypeComparison;
    comparisonDirection?: IKpiComparisonDirection;
};
type ReplaceKpiWidgetDrill = {
    ref: ObjRef;
    drill: IDrillToLegacyDashboard | undefined;
};
type ReplaceKpiWidgetConfiguration = {
    ref: ObjRef;
    config: IKpiWidgetConfiguration | undefined;
};
type ReplaceRichTextWidgetContent = {
    ref: ObjRef;
    content: string;
};
type ChangeWidgetIgnoreCrossFiltering = {
    ref: ObjRef;
    ignoreCrossFiltering?: boolean;
};
type AddVisualizationSwitcherWidgetVisualization = {
    ref: ObjRef;
    visualization: IInsightWidget;
    newSize?: IVisualizationSizeInfo;
};
type UpdateVisualizationSwitcherWidgetVisualizations = {
    ref: ObjRef;
    visualizations: IInsightWidget[];
};
type ResizeVisualizationSwitcherOnInsightChanged = {
    ref: ObjRef;
    newSize?: IVisualizationSizeInfo;
};
type SetScreenActionPayload = {
    screen: ScreenSize;
};
export declare const layoutReducers: {
    setLayout: LayoutReducer<IDashboardLayout<ExtendedDashboardWidget>>;
    setScreen: LayoutReducer<SetScreenActionPayload>;
    updateWidgetIdentities: LayoutReducer<ObjRefMap<IdentityMapping>>;
    updateWidgetIdentitiesForTab: LayoutReducer<UpdateWidgetIdentitiesForTabPayload>;
    removeIgnoredAttributeFilter: LayoutReducer<RemoveIgnoredAttributeFilter>;
    removeIgnoredDateFilter: LayoutReducer<RemoveIgnoredDateFilter>;
    addSection: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & AddSectionActionPayload>;
    removeSection: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & RemoveSectionActionPayload>;
    moveSection: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & MoveSectionActionPayload>;
    changeSectionHeader: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ChangeSectionActionPayload>;
    addSectionItems: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & AddSectionItemsActionPayload>;
    moveSectionItem: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & MoveSectionItemActionPayload>;
    removeSectionItem: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & RemoveSectionItemActionPayload>;
    replaceSectionItem: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceSectionItemActionPayload>;
    replaceWidgetHeader: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetHeader>;
    replaceWidgetDescription: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetDescription>;
    replaceWidgetDrillWithoutUndo: LayoutReducer<ReplaceWidgetDrillDefinitions>;
    replaceWidgetDrills: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetDrillDefinitions>;
    replaceWidgetBlacklistHierarchies: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetBlacklistHierarchies>;
    replaceWidgetBlacklistAttributes: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetBlacklistAttributes>;
    replaceWidgetDrillDownIntersectionIgnoredAttributes: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetDrillDownIntersectionIgnoredAttributes>;
    replaceInsightWidgetVisProperties: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetVisProperties>;
    replaceInsightWidgetVisConfiguration: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetVisConfiguration>;
    replaceInsightWidgetInsight: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetInsight>;
    replaceWidgetFilterSettings: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetFilterSettings>;
    replaceWidgetDateDataset: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceWidgetDateDataset>;
    replaceKpiWidgetMeasure: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceKpiWidgetMeasure>;
    replaceKpiWidgetComparison: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceKpiWidgetComparison>;
    replaceKpiWidgetDrillWithoutUndo: LayoutReducer<ReplaceWidgetDrillDefinitions>;
    replaceKpiWidgetDrill: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceKpiWidgetDrill>;
    replaceKpiWidgetConfiguration: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceKpiWidgetConfiguration>;
    replaceRichTextWidgetContent: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ReplaceRichTextWidgetContent>;
    addVisualizationSwitcherWidgetVisualization: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & AddVisualizationSwitcherWidgetVisualization>;
    updateVisualizationSwitcherWidgetVisualizations: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & UpdateVisualizationSwitcherWidgetVisualizations>;
    undoLayout: <TState extends import("../../_infra/undoEnhancer.js").IUndoEnhancedState<import("../../../commands/base.js").IDashboardCommand>>(state: import("immer").WritableDraft<ITabsState>, action: {
        payload: {
            undoDownTo: number;
        };
        type: string;
    }) => void | ITabsState | import("immer").WritableDraft<ITabsState>;
    clearLayoutHistory: AdaptedLayoutReducer<void>;
    changeItemsHeight: LayoutReducer<changeItemsHeightActionPayload>;
    changeItemWidth: LayoutReducer<changeItemWidthActionPayload>;
    changeWidgetIgnoreCrossFiltering: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ChangeWidgetIgnoreCrossFiltering>;
    resizeVisualizationSwitcherOnInsightChanged: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ResizeVisualizationSwitcherOnInsightChanged>;
    toggleLayoutSectionHeaders: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ToggleLayoutSectionHeadersPayload>;
    toggleLayoutDirection: AdaptedLayoutReducer<import("../../_infra/undoEnhancer.js").IUndoPayload<import("../../../commands/base.js").IDashboardCommand> & ToggleLayoutDirectionPayload>;
    updateHeightOfMultipleItems: LayoutReducer<updateHeightOfMultipleItemsActionPayload>;
    updateWidthOfMultipleItems: LayoutReducer<updateWidthOfMultipleItemsActionPayload>;
};
export {};
//# sourceMappingURL=layoutReducers.d.ts.map