import type { ChartDatapoint } from '../../../core/types/chart-data.js'; type BuildFlameIndexAccessors = { idAccessor: string; parentIdAccessor: string; }; /** * Precomputed lookups over the caller's raw span data. All three views share * the same cloned datum references so downstream code can round-trip a span * across them without paying for another clone. * @internal */ export type FlameIndex = { /** * Clones of the input spans with `FLAME_ORIGINAL_IDX` attached so tooltips can round-trip to the caller's array. */ indexedData: TData[]; /** * Span id → indexed datum. `O(1)` lookup for the isolation root. */ byId: Map; /** * Parent id → indexed children. Populated only for spans whose parent id is defined. */ childrenByParentId: Map; }; /** * Walks `data` exactly once and materializes every lookup FlameChart / * FlameGraph need to render or isolate a subtree. Consolidates work that used * to happen across the `dataWithIndex` map, `getDescendants`'s internal * parent-map build, and the ad-hoc `.find(...)` used to locate the isolation * root — three separate `O(n)` passes fused into one. * * At one-million-span scale this single pass replaces three, and callers * downstream (`collectSubtree`) reuse the maps instead of rebuilding them. * @internal */ export declare function buildFlameIndex(data: readonly TData[], { idAccessor, parentIdAccessor }: BuildFlameIndexAccessors): FlameIndex; export {}; //# sourceMappingURL=build-flame-index.d.ts.map