/**
 * Helper utilities for OTEL components.
 *
 * @module otel/utils
 */
import type { OtelSpan } from './types';
/** Parse an ISO timestamp or nanosecond/microsecond epoch to milliseconds. */
export declare function toMs(ts: string | number): number;
/** Format a duration in ms to a human-readable string. */
export declare function formatDuration(ms: number | undefined | null): string;
/** Format an ISO timestamp or nanosecond epoch to local time string. */
export declare function formatTime(ts: string | number | undefined | null): string;
/** Return a deterministic color for a service name (via simple hash). */
export declare function serviceColor(serviceName: string): string;
/** Kind-based color for the span kind indicator dot. */
export declare function kindColor(kind: string): string;
/** Severity-based color for log severity labels. */
export declare function severityColor(severity: string): string;
/**
 * Map severity text to a Primer `Label` variant string.
 * Used by OtelLogsList for severity badges.
 */
export declare function severityVariant(severity: string): 'danger' | 'attention' | 'accent' | 'secondary' | 'primary';
/**
 * Build a span tree from a flat list of spans.
 * Returns root spans (those without a parent or whose parent is not in the list)
 * with `children` populated recursively and `depth` set.
 */
export declare function buildSpanTree(spans: OtelSpan[]): OtelSpan[];
/**
 * Flatten a span tree back to a flat list (depth-first) preserving depth info.
 */
export declare function flattenSpanTree(roots: OtelSpan[]): OtelSpan[];
