import type { Root } from 'mdast'; /** * 重要度レベル */ export type Severity = 'error' | 'warning' | 'info'; /** * 位置情報 */ export interface Location { line?: number; endLine?: number; column?: number; endColumn?: number; } /** * コンテキスト情報(検出値と期待値) */ export interface LintContext { found?: string; expected?: string; codeSnippet?: string; } /** * 参照情報 */ export interface LintReference { ruleUrl?: string; relatedRules?: string[]; } /** * リント結果 */ export interface LintResult { // 識別情報 ruleId: string; ruleName: string; // 重要度 severity: Severity; // メッセージ message: string; detail?: string; suggestion?: string; // 位置情報 location?: Location; // コンテキスト情報 context?: LintContext; // 参照情報 reference?: LintReference; } /** * ドキュメントメタデータ */ export interface DocumentMetadata { filePath: string; title?: string; frontmatter: Record; documentType?: string; documentTypeName?: string; } /** * バリデーション実行時のコンテキスト */ export interface ValidationContext { tree: Root; content: string; metadata: DocumentMetadata; } /** * バリデーターインターフェース */ export interface Validator { readonly id: string; readonly name: string; validate(context: ValidationContext): LintResult[]; } /** * ドキュメントタイプインターフェース */ export interface DocumentType { readonly id: string; readonly name: string; readonly validators: Validator[]; }