import type { AnyColumn, ChartDataOptions, PivotTableDataOptions } from '../../../domains/visualizations/core/chart-data-options/types'; import type { DataOptionLocation } from '../../../types'; /** * Retrieves a data option from the dataOptions structure at the specified location. * * This function is the inverse of {@link getDataOptionLocation} - it takes a location * and returns the data option at that location. * * The function handles both array-based locations (e.g., `category`, `rows`, `values`) * and single-value locations (e.g., `x`, `y`, `date`). For array-based locations, * the `dataOptionIndex` specifies which item to retrieve (defaults to 0 if not provided). * * @param dataOptions - The data options structure to search within (e.g., from various chart types or pivot table) * @param location - The location of the data option to retrieve * @returns The data option at the specified location, or `undefined` if the location doesn't exist * * @example * ```typescript * const dataOptions = { * category: [DM.Commerce.Date, DM.Category.Category], * value: [DM.Commerce.Revenue], * breakBy: [], * }; * * // Get first category * const firstCategory = getDataOptionByLocation(dataOptions, { * dataOptionName: 'category', * dataOptionIndex: 0, * }); * // Result: DM.Commerce.Date * * // Get single value (index defaults to 0) * const scatterDataOptions = { * x: DM.Commerce.Date, * y: DM.Commerce.Revenue, * }; * const xValue = getDataOptionByLocation(scatterDataOptions, { * dataOptionName: 'x', * }); * // Result: DM.Commerce.Date * ``` */ export declare function getDataOptionByLocation(dataOptions: ChartDataOptions | PivotTableDataOptions, location: DataOptionLocation): T | undefined;