import type { StackTrail } from '../context/StackTrail.js'; import type { ResultsItem, ResultType } from '../types/Results.js'; /** * Records one result per stack trail and builds the `manifest.results` tree. * * When several results are captured at the same trail, the most severe one * wins (see `resultRankings`). * * @example * ```typescript * const resultsLog = new ResultsLog() * * resultsLog.capture(new StackTrail(['generate', '/pets', 'get']), 'success') * resultsLog.capture(new StackTrail(['generate', '/pets/{id}:archive', 'post']), 'error') * * resultsLog.toTree() * // { generate: { '/pets': { get: 'success' }, '/pets/{id}:archive': { post: 'error' } } } * ``` */ export declare class ResultsLog { #private; constructor(); /** * Captures `result` at `stackTrail`, unless a more severe result is * already recorded there. * * Stores the frames as they are now: `StackTrail.trace` removes its * frame from the trail after its callback returns. */ capture(stackTrail: StackTrail, result: ResultType): void; /** * Nests the captured results by their frames, one object level per frame. * Frames are used as own-property keys verbatim, so a frame such as * `constructor`, `toString` or `0` is a key like any other. A result * captured at the empty trail has no key and is left out. */ toTree(): ResultsItem; }