import { type Coverage } from '../analyzers/tools/coverage';
import type { CoverageResult, SeverityCounts } from './capabilities/types';
import type { LanguageSupport, LintSeverity } from './types';
/**
 * Capture Ruby require / require_relative / autoload specifiers from source
 * text. Three forms recognised:
 *
 *   require 'json'                  → 'json'
 *   require_relative '../foo/bar'   → '../foo/bar'
 *   autoload :Sym, 'foo/bar'        → 'foo/bar'
 *
 * Ruby's metaprogramming (`__send__`, `Object.const_missing`, Rails'
 * Zeitwerk autoloader) makes static import analysis fundamentally
 * best-effort — many "imports" in idiomatic Ruby never appear as
 * literal `require` calls. This parser extracts the literal-string
 * cases only; downstream consumers should treat the output as a lower
 * bound. Future v4 candidate: explicit best-effort contract on the
 * imports envelope so consumers can distinguish "exhaustive" (TS, Go)
 * from "best-effort" (Ruby, kotlin/Java reflection paths).
 *
 * Comments are stripped (single-line `#`) before matching so a
 * commented-out `# require 'foo'` does not false-match. Multi-line
 * `=begin ... =end` blocks containing requires are not extracted
 * (acceptable: comment-out-import is intentional non-use).
 *
 * Both single and double quotes are accepted; dynamic `require x` (no
 * literal string) is skipped — there is no specifier to capture.
 *
 * Exported for unit tests; consumed by `gatherRubyImportsResult`.
 */
export declare function extractRubyImportsRaw(content: string): string[];
/**
 * Map RuboCop's severity strings to dxkit's four-tier scheme. RuboCop
 * canonically emits 5 severities (see `RuboCop::Cop::Severity::CODES`
 * in the upstream source — `lib/rubocop/cop/severity.rb`):
 *
 *   - `convention` → low      (style + naming — the bulk of findings)
 *   - `refactor`   → low      (complexity hints; Metrics/* cops)
 *   - `warning`    → medium   (Lint/* cops — actual code-quality risk)
 *   - `error`      → high     (real defects; rare in default config)
 *   - `fatal`      → critical (rubocop-internal failure or syntax error)
 *
 * Defensive `'low'` default for unknown severities — matches the
 * mapDetektSeverity / mapRuffSeverity contract: never silently drop a
 * finding, even if rubocop adds a new tier we don't recognize yet.
 *
 * Exported for unit tests.
 */
export declare function mapRubocopSeverity(severity: string | null | undefined): LintSeverity;
/**
 * Pure parser for RuboCop's JSON output (rubocop --format json). The
 * shape is fixed per the upstream `RuboCop::Formatter::JSONFormatter`
 * contract — `metadata` + `files[*].offenses[*]` + `summary`. We only
 * need the offenses; metadata + summary are surface for future
 * enrichment (per-file attribution, top-N rules) but not needed for
 * the dxkit lint envelope which carries SeverityCounts only.
 *
 * Returns zero counts on malformed input rather than throwing —
 * matches mapDetektSeverity / parseEslintFinal conventions. The
 * gather function distinguishes "rubocop ran fine, found nothing"
 * from "rubocop missing / parse error" via LintGatherOutcome's
 * kind field.
 *
 * Exported for unit tests; consumed by `gatherRubyLintResult`.
 */
export declare function parseRubocopOutput(raw: string): SeverityCounts;
/**
 * Pure parser for SimpleCov `.resultset.json`. Returns null when the
 * input has no parseable suites (empty file, missing `coverage` key,
 * or malformed JSON) — distinct from "0% coverage" (where suites
 * exist with zero hits).
 *
 * Exported for unit tests; consumed by `gatherSimpleCovCoverageResult`.
 */
export declare function parseSimpleCovResultset(raw: string, sourceFile: string, cwd: string): Coverage | null;
/**
 * Discriminated outcome of a SimpleCov coverage probe (Recipe v4 G_v4_3).
 *
 * Pre-G_v4_3, `gatherSimpleCovCoverageResult` returned `CoverageResult |
 * null` and the `null` branch silently merged two genuinely different
 * states: "SimpleCov never ran" and "SimpleCov ran but only produced
 * HTML output." The second is a legitimate user state (vanilla
 * SimpleCov ships HTML by default; JSON requires either the binary-
 * intermediate `.resultset.json` — produced by default but undocumented
 * as stable — or the third-party `simplecov-json` gem). Users in that
 * state need actionable guidance, not a silent "no coverage data."
 *
 * The capability dispatcher contract (`CoverageResult | null`) is
 * unchanged — the adapter still returns null for both unavailable and
 * html-only states so existing consumers keep working. Consumers that
 * want the richer signal (coverage CLI under D021, dashboard renderer)
 * call `gatherSimpleCovOutcome` directly.
 */
export type SimpleCovOutcome = {
    kind: 'unavailable';
} | {
    kind: 'html-only';
    hint: string;
} | {
    kind: 'success';
    envelope: CoverageResult;
};
/**
 * Probe SimpleCov state and produce the discriminated outcome. Three
 * paths, all distinguishable downstream:
 *   1. `success`     — parseable JSON found at `.resultset.json` or
 *                      `coverage.json`; envelope ready to ship.
 *   2. `html-only`   — `coverage/index.html` exists but no JSON;
 *                      SimpleCov ran, but in a format we can't parse.
 *                      Includes a hint string for the user.
 *   3. `unavailable` — neither JSON nor HTML; tool didn't run.
 */
export declare function gatherSimpleCovOutcome(cwd: string): SimpleCovOutcome;
export declare const ruby: LanguageSupport;
//# sourceMappingURL=ruby.d.ts.map