/** * Drill-down helper — builds a new query from a clicked row. * * Usage: * const dq = drillDown({ * sourceQuery: revenueBySegment, * metric: 'total_revenue', * dimension: 'order_date', * row: clickedRow, * }); * // Pass dq to useLightdash() to execute */ import { QueryBuilder } from './query'; import type { Row } from './types'; export type DrillDownOptions = { /** The original query builder that produced the data */ sourceQuery: QueryBuilder; /** The metric to drill into */ metric: string; /** The dimension to drill by */ dimension: string; /** The clicked row — its dimension values become equality filters */ row: Row; /** Optional label for the drill query (shown in query inspector) */ label?: string; }; /** * Build a drill-down query from a clicked row. * * Takes the source query's dimension values from the clicked row and turns * them into equality filters, then queries the same metric grouped by the * chosen drill-by dimension. * * Returns a new QueryBuilder that can be passed to useLightdash(). */ export declare function drillDown(options: DrillDownOptions): QueryBuilder;