/** * @fileoverview Core type definitions for fitness checks * * Check interface is the return type of defineCheck. * CheckConfig represents the internal configuration structure. * CheckResult carries Signal[]. */ import type { CheckScope, ResolvedScope } from './check-config.js'; import type { ExecutionContext, RunOptions } from './execution-context.js'; import type { PathMatcher } from './path-matcher.js'; import type { CheckResult, ItemType } from '../types/findings.js'; /** * Check configuration options. */ export interface CheckConfig { readonly id: string; readonly slug: string; readonly tags: readonly string[]; readonly description: string; readonly longDescription?: string | undefined; readonly analysisMode: 'analyze' | 'analyzeAll' | 'command'; readonly scope: ResolvedScope; readonly itemType: ItemType; readonly unit?: string | undefined; readonly additionalExcludes?: readonly string[] | undefined; readonly docs?: string | undefined; readonly disabled?: boolean | undefined; readonly confidence?: 'high' | 'medium' | 'low' | undefined; readonly timeout?: number | undefined; readonly scansFiles?: boolean | undefined; readonly fileTypes?: readonly string[] | undefined; /** Portable scope declaration for marketplace-ready target matching. */ readonly checkScope?: CheckScope | undefined; /** * Display icon (an emoji) for CLI/dashboard output. Travels WITH the check * (ยง5.3 separate-domains fold) โ€” there is no separate per-process display * sidecar map. Absent โ†’ consumers fall back to a default icon. */ readonly icon?: string | undefined; /** * Human-readable display name for CLI/dashboard output. Absent โ†’ consumers * fall back to kebab-to-title-case of the slug. */ readonly displayName?: string | undefined; readonly execute: (ctx: ExecutionContext) => Promise; } /** * A defined check, ready to run. */ export interface Check { readonly config: CheckConfig; readonly run: (cwd: string, options?: RunOptions) => Promise; readonly getScope: () => ResolvedScope; readonly getMatcher: (cwd: string) => PathMatcher; } /** * Type guard: is this value a Check object? * * Checks for the shape of a Check object: * - Has a `config` property that is an object * - config has an `id` property that is a string * - config has a `slug` property that is a string * - config has an `execute` property that is a function * - Has a `run` property that is a function */ export declare function isCheck(value: unknown): value is Check; /** * Walk a barrel-export object and collect every Check it contains, * deduplicated by `config.id`. Recurses into nested object exports; * arrays are not traversed (they are typically the `checks` re-export * the loader handles separately). * * Pack authors call this in their package's `index.ts`: * * import * as allChecks from './checks/index.js' * export const checks = collectCheckObjects(allChecks) * * `seen` is exposed for callers that need to merge multiple barrels. */ export declare function collectCheckObjects(obj: Record, seen?: Set): Check[]; export { type ResolvedScope } from './check-config.js'; //# sourceMappingURL=check-types.d.ts.map