import { type IDashboardExportParameter, type IDashboardParameter, type IDashboardTab, type IInsight, type IInsightDefinition, type IInsightParameterValue, type IParameterMetadataObject, type IdentifierRef } from "@gooddata/sdk-model";
import { type ObjRefMap } from "../../../../_staging/metadata/objRefMap.js";
import { type IInsightWidgetTabContext } from "../layout/layoutSelectors.js";
import { type ITabState } from "../tabsState.js";
import { type IDashboardParameterEntry } from "./parametersState.js";
/**
 * @internal
 */
export declare const EMPTY_EXPORT_PARAMETERS_BY_TAB: Record<string, IDashboardExportParameter[]>;
/**
 * Walks the insight's metric buckets and returns the parameter refs they reference,
 * deduped by ref string. The order matches the first occurrence in the measure traversal.
 *
 * @internal
 */
export declare function collectReferencedParameterRefs(insight: IInsightDefinition, measureParameters: Record<string, IdentifierRef[]>): IdentifierRef[];
/**
 * Effective execution parameters, limited to `referencedRefs`. Precedence per ref: the dashboard
 * `runtimeOverride`, else the insight's own parameter value, else nothing (backend uses the workspace default).
 *
 * @internal
 */
export declare function resolveEffectiveParameterValuesForRefs(entries: IDashboardParameterEntry[], referencedRefs: IdentifierRef[], insightParameterValues: IInsightParameterValue[]): IInsightParameterValue[];
interface IParameterResolutionContext {
    entries: IDashboardParameterEntry[];
    measureParameters: Record<string, IdentifierRef[]>;
}
/**
 * Effective execution parameters for `insight` given a widget's parameter context: resolves the refs
 * the insight references, then applies {@link resolveEffectiveParameterValuesForRefs}.
 *
 * @internal
 */
export declare function resolveEffectiveParameterValuesForInsight(context: IParameterResolutionContext | undefined, insight: IInsightDefinition): IInsightParameterValue[];
/**
 * Returns the entries whose `runtimeOverride` deviates from the hydrated baseline
 * ({@link computeHydratedRuntimeOverride}). Entries still at their default are dropped, so callers never
 * propagate a value the user did not explicitly set.
 *
 * @internal
 */
export declare function collectChangedParameterValues(entries: IDashboardParameterEntry[], workspaceParameters: IParameterMetadataObject[]): IInsightParameterValue[];
/**
 * The value hydration seeds into `runtimeOverride`: the persisted dashboard `value`, else the
 * workspace number default, else `undefined`. Single source of truth for the hydrated baseline so
 * override detection here and in `hydrateParameterEntries` cannot drift apart.
 *
 * @internal
 */
export declare function computeHydratedRuntimeOverride(parameter: IDashboardParameter, workspaceParameter: IParameterMetadataObject | undefined): number | undefined;
/**
 * Indexes the workspace parameter catalog by ref string for O(1) lookup.
 *
 * @internal
 */
export declare function workspaceParametersByRef(workspaceParameters: IParameterMetadataObject[]): Map<string, IParameterMetadataObject>;
/**
 * Folds an entry's ephemeral `runtimeOverride` into the persisted parameter shape's `value`.
 *
 * @internal
 */
export declare function applyRuntimeOverride(entry: IDashboardParameterEntry): IDashboardParameter;
/**
 * Resolves a single parameter entry to the export wire shape. Returns `undefined` for entries with
 * no `runtimeOverride` — the dashboard's persisted parameter state and the workspace default are
 * applied by the backend on its own, and insight-level `insight.parameters` are applied per-insight
 * by the backend; sending a row in those cases would override the backend's resolution with a stale
 * FE snapshot (matches the live-render path in `selectEffectiveParameterValuesForWidget`).
 *
 * Title precedence (when a row is emitted): `parameter.label` → workspace title → `ref.identifier`.
 *
 * @internal
 */
export declare function formatDashboardParameter(entry: IDashboardParameterEntry, workspaceParameter: IParameterMetadataObject | undefined): IDashboardExportParameter | undefined;
/**
 * Resolves the persisted shape of a parameter entry against its workspace catalog parameter.
 * Drops `value` when it equals the workspace default; drops `label` when it equals the workspace title.
 *
 * @internal
 */
export declare function smartPersistResolvedEntry(entry: IDashboardParameterEntry, workspaceParameter: IParameterMetadataObject): IDashboardParameter;
/**
 * Builds the persisted-parameter lookup keyed by tab and then by ref string. Honors V1 → per-tab
 * migration: when no tab in the persisted dashboard carries `parameters`, the persisted root
 * `parameters` is used as fallback for every tab.
 *
 * @internal
 */
export declare function buildPersistedByTabAndRef(persistedTabs: ReadonlyArray<IDashboardTab>, rootPersistedParameters: IDashboardParameter[]): Map<string, Map<string, IDashboardParameter>>;
/**
 * Returns `undefined` when reset would be a no-op: missing/non-number workspace parameter, or
 * in edit mode when `parameter.value` is unset / already equals the workspace default.
 *
 * @internal
 */
export declare function computeParameterResetValue(entry: IDashboardParameterEntry, workspaceParameter: IParameterMetadataObject | undefined, isInEditMode: boolean): number | undefined;
/**
 * Only `mode: "active"` entries with a defined `runtimeOverride` are considered resettable;
 * HIDDEN and READONLY entries are skipped, and entries with `runtimeOverride === undefined`
 * (chip hidden, execution falls back to `insight.parameters`) are preserved as-is — symmetric
 * with per-chip behavior in `DashboardParameterFilter`.
 *
 * @internal
 */
export declare function computeParameterResetTargets(entries: IDashboardParameterEntry[], workspaceParameters: IParameterMetadataObject[], isInEditMode: boolean): {
    ref: IDashboardParameterEntry["parameter"]["ref"];
    value: number | undefined;
}[];
/**
 * Folds per-tab ref selections into the wire shape, dropping entries without a
 * `runtimeOverride`. Each selection pairs a tab with an optional ref restriction:
 * `allowedRefs === undefined` selects all refs (whole-dashboard scope); a defined set restricts
 * entries to those refs (widget scope). Tabs that yield no rows are omitted from the result.
 *
 * @internal
 */
export declare function collectExportOverrides(tabRefSelections: ReadonlyArray<{
    tab: ITabState;
    allowedRefs?: Set<string>;
}>, workspaceByRef: Map<string, IParameterMetadataObject>): Record<string, IDashboardExportParameter[]>;
/**
 * Builds per-tab ref selections for a widget-scope export: each widget's owning tab is restricted
 * to refs referenced by the widget's insight metrics. Multiple widgets on the same tab union their
 * refs.
 *
 * @internal
 */
export declare function buildWidgetScopeTabRefSelections(widgetContexts: ReadonlyArray<IInsightWidgetTabContext>, widgetIds: ReadonlyArray<string>, insights: ObjRefMap<IInsight>, measureParameters: Record<string, IdentifierRef[]>): {
    tab: ITabState;
    allowedRefs: Set<string>;
}[];
export {};
//# sourceMappingURL=parametersHelpers.d.ts.map