/** * @fileoverview ResultBuilder - Builder pattern for check results * * Provides a fluent API for constructing check results with signals, * metadata, and display information. */ import type { CheckResult, ItemType } from '../types/findings.js'; import type { Signal } from '@opensip-cli/core'; /** * Options for building results. */ export interface ResultBuilderOptions { /** Check ID */ readonly checkId: string; /** Item type for display (files, modules, etc.) */ readonly itemType: ItemType; /** Custom unit label (overrides itemType) */ readonly unit?: string | undefined; } /** * Builder for constructing check results. * * @example * ```typescript * const result = ResultBuilder.create({ checkId: 'my-check', itemType: 'files' }) * .totalItems(100) * .addSignal(signal1) * .build(); * ``` */ export declare class ResultBuilder { private readonly options; private _totalItems; private readonly _signals; private _ignoredCount; private _durationMs?; private _filesScanned?; private _extra?; private constructor(); static create(options: ResultBuilderOptions): ResultBuilder; totalItems(count: number): this; filesScanned(count: number): this; addSignal(signal: Signal): this; addSignals(signals: readonly Signal[]): this; ignoredCount(count: number): this; incrementIgnored(by?: number): this; duration(ms: number): this; extra(data: Record): this; build(): CheckResult; buildError(message: string, error?: Error): CheckResult; private buildInfo; private getUniqueFileCount; get signalCount(): number; get errorCount(): number; get warningCount(): number; get hasSignals(): boolean; get willPass(): boolean; } /** * Extract a code snippet with context lines around a target line. */ export declare function extractSnippet(content: string, line: number, contextLines?: number): { snippet: string; contextLines: number; }; /** * Get line number from content string and character index. */ export declare function getLineNumber(content: string, index: number): number; /** * Check if a file path matches API file patterns. */ export declare function isAPIFile(filePath: string): boolean; //# sourceMappingURL=result-builder.d.ts.map