@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
35 lines (34 loc) • 1.42 kB
TypeScript
/**
* @fileoverview Utilities for parsing structured review output.
*
* This module provides functions for parsing and processing structured review output
* in interactive mode. It handles JSON parsing, validation, and extraction of review
* information from the AI's response.
*/
import { ReviewSchema, ReviewIssue } from '../../types/reviewSchema';
/**
* Parse a JSON string into a ReviewSchema object
* @param jsonString The JSON string to parse
* @returns The parsed ReviewSchema object or null if parsing fails
*/
export declare function parseReviewJson(jsonString: string): ReviewSchema | null;
/**
* Extract the review content from a string that might contain JSON
* @param content The content to extract from
* @returns The extracted review content
*/
export declare function extractReviewContent(content: string): string;
/**
* Format an issue for display in the console
* @param issue The issue to format
* @param filePath Path to the file containing the issue
* @param fileIndex Index of the file
* @param issueIndex Index of the issue
* @returns Formatted issue string
*/
export declare function formatIssueForDisplay(issue: ReviewIssue, filePath: string, fileIndex: number, issueIndex: number): string;
/**
* Display a structured review in the console
* @param parsedReview The parsed review object
*/
export declare function displayStructuredReview(parsedReview: ReviewSchema): void;