/** * Per-span and subtree USD cost. Pure and total — missing/non-numeric costs * collapse to 0 (never NaN) so `∑` badges stay honest. */ import type { TraceSpan } from "./types.js"; /** * A single span's own USD cost: the promoted `costUsd` field, else the first * parseable cost attribute. Total: missing/non-numeric → 0 (never NaN); * negative costs floor to 0. */ export declare function spanCostUsd(span: TraceSpan): number; /** * A single span's own USD cost for PER-SPAN DISPLAY: the promoted `costUsd` field, else the first * parseable cost attribute — but returns `undefined` when the span has no individually-computed * cost (absent / non-numeric / ≤ 0). Distinct from `spanCostUsd` (which collapses to 0 for honest * `∑` badges): a per-span cost is "exists or doesn't", not a sum, so the absent case renders `—` * (em-dash) downstream instead of a fabricated `$0.0000` (M52 / theo-lens#71 Finding 3). */ export declare function spanOwnCostUsd(span: TraceSpan): number | undefined; /** * Sum a span's own cost + all descendants' (`∑`). Total: missing cost counts as 0, never NaN. * Cycle-safe: a repeated/self-referential child is counted at most once (no stack overflow). */ export declare function aggregateCost(span: TraceSpan): number;