import type { ChartDatapoint } from '../../../core/types/chart-data.js'; import { type FlameIndex } from '../utils/build-flame-index.js'; type UseFlameDataArgs = { data: readonly TData[]; idAccessor: string; parentIdAccessor: string; /** * Currently isolated span id, or `undefined` when the full dataset is displayed. */ isolatedId: unknown; /** * Gates the isolation branch. When `false`, `isolatedRoot` is always `null` * and `effectiveData` returns the full indexed dataset, letting the same * hook power both the isolate-enabled and isolate-disabled configurations * of a flame component. */ isolationEnabled: boolean; }; type UseFlameDataResult = FlameIndex & { /** * The indexed datum matching `isolatedId`, or `null` when isolation is off or the id is not found. */ isolatedRoot: TData | null; /** * `[isolatedRoot, ...descendants]` when isolated; the full indexed dataset otherwise. */ effectiveData: TData[]; /** * Id of the sole root of the currently visible chart, or `undefined` when no * such unambiguous root exists (multiple orphan roots visible). Equals * `isolatedId` when isolated; otherwise the id of the single raw-data root * if there is exactly one. Consumers use this to gate no-op actions — e.g. * disabling "isolate" on a span that already occupies the entire chart. */ visibleRootId: unknown; }; /** * Shared data hook for FlameChart / FlameGraph. Wraps `buildFlameIndex` * (single `O(n)` pass over raw data) and `collectSubtree` (walk from the * isolation root) in memos keyed on the inputs that actually matter, so * the expensive index build only reruns when `data` or the id accessors * change — never on a re-render triggered by isolation navigation alone. * @internal */ export declare function useFlameData({ data, idAccessor, parentIdAccessor, isolatedId, isolationEnabled, }: UseFlameDataArgs): UseFlameDataResult; export {}; //# sourceMappingURL=use-flame-data.d.ts.map