import { TargetName } from './target-name.js'; import { Username } from './username.js'; type FindingLevel = 'error' | 'warning'; /** The closed vocabulary of finding codes. Adding one here is required to emit it. */ type FindingCode = 'YAML' | 'EMPTY_FILE' | 'SCHEMA' | 'EMPTY_LIST' | 'DUP_TARGET' | 'EMPTY_USER' | 'NO_FILES' | 'USER_NOT_FOUND' | 'USER_INACTIVE' | 'TARGET_NOT_FOUND' | 'TARGET_AMBIGUOUS'; export type Finding = { level: FindingLevel; code: FindingCode; message: string; file?: string; line?: number; }; /** Invalid YAML: the parser rejected the document. */ export declare function yamlError(message: string, file: string, line?: number): Finding; /** The document parsed to nothing. */ export declare function emptyFileWarning(file: string): Finding; /** The file violates the schema at `path`. */ export declare function schemaError(path: string, message: string, file: string): Finding; /** A scope key is present but its list is empty. */ export declare function emptyListWarning(username: Username, scopeKey: string, file: string): Finding; /** A target appears more than once under one scope for one user. */ export declare function dupTargetWarning(username: Username, target: TargetName, scopeKey: string, file: string): Finding; /** A user declares no scopes at all. */ export declare function emptyUserWarning(username: Username, file: string): Finding; /** No file on disk matched the given glob patterns. */ export declare function noFilesError(patterns: string[]): Finding; /** A declared user does not exist in the org. */ export declare function userNotFoundError(username: Username): Finding; /** A declared user exists but is inactive. */ export declare function userInactiveError(username: Username): Finding; /** A declared target does not exist in the org. `label` is the kind's human name. */ export declare function targetNotFoundError(target: TargetName, label: string): Finding; /** A declared target resolves to more than one record in the org. */ export declare function targetAmbiguousError(target: TargetName, label: string): Finding; /** * Everything a run has to say about the files and the org, and every question asked of * it. Findings are not only displayed: an error aborts the run and sets the exit code, * so the counting, merging, and rendering rules live here rather than at each call site * that would otherwise have to remember them. */ export declare class Findings { private readonly items; private constructor(); static empty(): Findings; static of(items: Finding[]): Findings; /** How many findings are error-level. */ errors(): number; /** How many findings are warning-level. */ warnings(): number; /** Whether the run has to abort: an error is fatal whatever the mode. */ hasErrors(): boolean; /** Whether anything was flagged short of an error, which `--strict` promotes to a failure. */ hasWarnings(): boolean; /** * Whether these findings stop the run. An error always does. A warning does only under * `--strict`, which is why the flag's value is the caller's to pass rather than a * verdict one command inherits from another. */ blocks(strict: boolean): boolean; /** Both sets in order, so file findings still read before the org's answers. */ concat(other: Findings): Findings; /** Render as human-readable lines. Shared by check, validate, plan, and apply. */ format(): string[]; /** Keeps `--json` payloads the plain array of findings they have always been. */ toJSON(): Finding[]; private countOf; } export {}; //# sourceMappingURL=finding.d.ts.map