/** Minimal trace shape required by groupTracesByThread */
export type GroupableTrace = {
    threadId?: string | null;
    createdAt: Date | string;
};
export type ThreadGroup<T extends GroupableTrace = GroupableTrace> = {
    threadId: string;
    traces: T[];
};
export type GroupedTraces<T extends GroupableTrace = GroupableTrace> = {
    groups: ThreadGroup<T>[];
    ungrouped: T[];
};
/**
 * Groups traces by their threadId field.
 * Traces without a threadId are placed in the `ungrouped` bucket.
 * Groups are ordered by the most recent trace's createdAt (descending).
 * Within each group, traces maintain their original order.
 */
export declare function groupTracesByThread<T extends GroupableTrace>(traces: T[]): GroupedTraces<T>;
