import { type DrillDefinition, type IDashboardLayout, type IDrillDownReference, type IDrillToLegacyDashboard, type IInsightWidget, type IKpiWidget, type IWidget, type InsightDrillDefinition, type ObjRef, type ScreenSize } from "@gooddata/sdk-model"; import { type ObjRefMap } from "../../../../_staging/metadata/objRefMap.js"; import { type IDashboardFilter, type ILayoutCoordinates, type ILayoutItemPath } from "../../../../types.js"; import { type DashboardLayoutCommands } from "../../../commands/layout.js"; import { type ExtendedDashboardWidget, type ICustomWidget } from "../../../types/layoutTypes.js"; import { type IUndoableCommand } from "../../_infra/undoEnhancer.js"; import { type DashboardSelector } from "../../types.js"; import { type ITabState } from "../tabsState.js"; import { type LayoutStash } from "./layoutState.js"; /** * Returns layout keyed by tab identifier. * * @internal */ export declare const selectLayoutByTab: DashboardSelector | undefined>>; /** * Returns basic layout keyed by tab identifier that does not contain any client-side extensions. * * This selector exists because analytical backend impls are not yet ready to handle persistence of custom * widgets (that may have arbitrary payloads). The selector is used in dirty checking to compare layouts * without any custom widgets. Note that this intentionally removes empty sections. * * @internal */ export declare const selectBasicLayoutByTab: DashboardSelector | undefined>>; /** * This selector returns current layout's stash. This stash can contain items that were removed from the layout with the * intent of further using the item elsewhere on the layout. The stash is a mapping of stashIdentifier to an array * of stashed items. The stash identifiers and stash usage is fully under control of the user. * * @internal */ export declare const selectStash: DashboardSelector; /** * This selector returns commands that impacted the layout and can now be undone. * * @internal */ export declare const selectUndoableLayoutCommands: DashboardSelector[]>; /** * This selector returns dashboard's layout. It is expected that the selector is called only after the layout state * is correctly initialized. Invocations before initialization lead to invariant errors. * * @public */ export declare const selectLayout: DashboardSelector>; /** * This selector returns dashboard's current layout screen size. Valid screen size is provided after first render. * * @public */ export declare const selectScreen: DashboardSelector; /** * Filters out custom widgets from a dashboard layout. * * This function removes all custom widgets (client-side extensions) from a layout, * keeping only analytical widgets (KPI, Insight, etc.). It also removes empty sections * that may result from filtering. * * This is used during save operations because analytical backend implementations are not yet * ready to handle persistence of custom widgets that may have arbitrary payloads. * * @param layout - The layout to filter * @returns A layout containing only analytical widgets * * @internal */ export declare const filterOutCustomWidgets: (layout: IDashboardLayout) => IDashboardLayout; /** * This selector returns the basic dashboard layout that does not contain any client-side extensions. * * * @internal */ export declare const selectBasicLayout: DashboardSelector>; /** * Selects dashboard widgets in an obj ref an array. This map will include both analytical and custom * widgets that are placed on the dashboard and also all widgets from visualization switchers * * @internal */ export declare const selectWidgets: DashboardSelector; /** * Selects dashboard widgets in an obj ref to widget map. This map will include both analytical and custom * widgets that are placed on the dashboard. * * @internal */ export declare const selectWidgetsMap: DashboardSelector>; /** * Selects widget by its ref (including custom widgets). * * @remarks * To limit the scope only to analytical widgets, use {@link selectAnalyticalWidgetByRef}. * * @alpha */ export declare const selectWidgetByRef: (ref: ObjRef | undefined) => DashboardSelector; /** * Selects filterable widget by its ref (including custom widgets). * This selector will return undefined if the provided ref to non-filterable widget. * * @remarks * To limit the scope only to analytical widgets, use {@link selectAnalyticalWidgetByRef}. * * @alpha */ export declare const selectFilterableWidgetByRef: (ref: ObjRef | undefined) => DashboardSelector; /** * Selects analytical widget by its ref. This selector will return undefined if the provided * widget ref is not analytical widget, eg. custom widget or nested layout. * * @remarks * To include custom widgets as well, use {@link selectWidgetByRef}. * * @alpha */ export declare const selectAnalyticalWidgetByRef: (ref: ObjRef | undefined) => DashboardSelector; /** * @alpha */ export declare const selectIgnoredDrillDownHierarchiesByWidgetRef: (ref: ObjRef) => DashboardSelector; /** * @alpha */ export declare const selectIgnoredDrillToUrlAttributesByWidgetRef: (ref: ObjRef) => DashboardSelector; /** * Selects widget drills by the widget ref. * * @alpha */ export declare const selectWidgetDrills: (ref: ObjRef | undefined) => DashboardSelector; /** * Selects all filters from filter context converted to filters specific for a widget specified by a ref. * * @remarks * This does NOT resolve things like ignored filters for a widget, etc. * * @internal */ export declare const selectAllFiltersForWidgetByRef: (ref: ObjRef) => DashboardSelector<[IDashboardFilter[], IDashboardFilter[]]>; /** * Selects a boolean indicating if the dashboard is empty. * * @alpha */ export declare const selectIsLayoutEmpty: DashboardSelector; /** * Selects all KPI widgets in the layout. * * @alpha */ export declare const selectAllKpiWidgets: DashboardSelector; /** * Selects all insight widgets in the layout. * * @alpha */ export declare const selectAllInsightWidgets: DashboardSelector; /** * Selects all custom widgets in the layout. * * @alpha */ export declare const selectAllCustomWidgets: DashboardSelector; /** * Selects all non-custom widgets in the layout. * * @alpha */ export declare const selectAllAnalyticalWidgets: DashboardSelector; /** * Selects a boolean indicating if the dashboard contains at least one non-custom widget. * * @alpha */ export declare const selectLayoutHasAnalyticalWidgets: DashboardSelector; /** * Selects layout path for a given widget. * * @alpha */ export declare const selectWidgetPathByRef: (ref: ObjRef) => DashboardSelector; /** * Selects layout coordinates for a given widget. * * @alpha * * @deprecated The selector returns coordinates in its parent layout. The information is not useful on its * own when dashboard uses nested layout. For this case use {@link selectWidgetPathByRef} instead. * * TODO LX-648: remove this selector, exported only for backward compatible reasons. */ export declare const selectWidgetCoordinatesByRef: (ref: ObjRef) => DashboardSelector; /** * @internal */ export declare const selectWidgetPlaceholder: DashboardSelector; /** * @internal */ export declare const selectWidgetPlaceholderPath: DashboardSelector; /** * @internal * * @deprecated The selector returns coordinates in its parent layout. The information is not useful on its * own when dashboard uses nested layout. For this case use {@link selectWidgetPlaceholderPath} instead. * * TODO LX-648: remove this selector, exported only for backward compatible reasons. */ export declare const selectWidgetPlaceholderCoordinates: DashboardSelector; /** * @internal */ export declare const selectInsightWidgetPlaceholder: DashboardSelector; /** * @internal */ export declare const selectInsightWidgetPlaceholderPath: DashboardSelector; /** * @internal * * @deprecated The selector returns coordinates in its parent layout. The information is not useful on its * own when dashboard uses nested layout. For this case use {@link selectInsightWidgetPlaceholderPath} instead. * * TODO LX-648: remove this selector, exported only for backward compatible reasons. */ export declare const selectInsightWidgetPlaceholderCoordinates: DashboardSelector; /** * @internal */ export declare const selectKpiWidgetPlaceholder: DashboardSelector; /** * @internal */ export declare const selectKpiWidgetPlaceholderPath: DashboardSelector; /** * @internal * * @deprecated The selector returns coordinates in its parent layout. The information is not useful on its * own when dashboard uses nested layout. For this case use {@link selectKpiWidgetPlaceholderPath} instead. * * TODO LX-648: remove this selector, exported only for backward compatible reasons. */ export declare const selectKpiWidgetPlaceholderCoordinates: DashboardSelector; /** * Selects whether widget should ignore cross-filtering filters * * @alpha */ export declare const selectWidgetIgnoreCrossFiltering: (ref: ObjRef) => DashboardSelector; /** * Per-tab widget contexts. Each entry pairs a widget with its owning tab; nested layout widgets * and visualization switcher children are flattened in. Used by cross-tab widget lookups. * * @internal */ export interface IWidgetTabContext { tab: ITabState; widget: ExtendedDashboardWidget; } /** * `IWidgetTabContext` narrowed to its insight-widget shape. * * @internal */ export interface IInsightWidgetTabContext extends IWidgetTabContext { widget: IInsightWidget; } /** * Cross-tab widget contexts. Walks every tab's layout (including nested layouts and visualization * switcher children) once and pairs each widget with its owning tab. Consumers needing to resolve * a widget's owning tab by ref or identifier should `.find()` against this array. * * @internal */ export declare const selectAllTabsWidgetContexts: DashboardSelector; /** * `selectAllTabsWidgetContexts` pre-filtered to insight-widget contexts so consumers can `.find()` * against an already-narrowed array. * * @internal */ export declare const selectAllTabsInsightWidgetContexts: DashboardSelector; /** * Type guard for narrowing an `IWidgetTabContext` to `IInsightWidgetTabContext`. * * @internal */ export declare function isInsightWidgetTabContext(context: IWidgetTabContext): context is IInsightWidgetTabContext; /** * Selects the local identifier of the tab that contains the specified widget. * Returns undefined if the widget is not found in any tab. * * @param ref - widget reference to search for * @returns local identifier of the tab containing the widget, or undefined if not found * * @alpha */ export declare const selectTabLocalIdentifierByWidgetRef: (ref: ObjRef | undefined) => DashboardSelector; /** * Maps widget local identifiers to the tab that contains them. * * @alpha */ export declare const selectWidgetLocalIdToTabIdMap: DashboardSelector>; //# sourceMappingURL=layoutSelectors.d.ts.map