import type { Hex } from "viem"; import type { CallType, TraceFrame } from "../types.js"; export interface FlamegraphBar { frame: TraceFrame; depth: number; /** Left offset as a percentage of total gas (0-100). */ startGas: number; /** Bar width as a percentage of total gas (0-100). */ width: number; /** Display label — typically the function name (or selector fallback). */ label: string; /** Hex color (e.g. "rgb(99, 102, 241)") for this bar. */ color: string; } /** * Lighten or darken a `#rrggbb` hex string by `amount` per channel (0-255). * Returns an `rgb(...)` string. Caller is responsible for passing a valid * 7-char hex; bad inputs produce NaN channels and are clamped to 0/255. */ export declare function adjustBrightness(hex: string, amount: number): string; export declare function getBarColor(type: CallType, depth: number): string; export interface LayoutOptions { /** Resolve a 4-byte selector to a readable label (e.g. "transfer"). */ resolveSelector?: (selector: Hex) => string | undefined; } /** * Compute flamegraph bars from a TraceFrame tree. Pure function — no I/O, * no React, no DOM. The output is an ordered list of bars with depth, left * offset, and width as percentages of the root's `gasUsed`. * * Uses the SDK's `walkCallTree` (explicit stack) for safe traversal of deep * trees. */ export declare function buildFlamegraphLayout(root: TraceFrame, options?: LayoutOptions): FlamegraphBar[]; //# sourceMappingURL=flamegraphLayout.d.ts.map