UNPKG

@bobmatnyc/ai-code-review

Version:

A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter

45 lines (44 loc) 1.67 kB
/** * Template Loader Utility * * This utility loads and compiles Handlebars templates from the promptText directory. * It supports variable substitution, partials, and conditional logic. */ /** * Render a template with provided variables * * @param templatePath Path to the template file (relative to TEMPLATES_DIR) * @param customVars Optional custom variables to merge with default variables * @returns Rendered template string or null if rendering fails */ export declare function renderTemplate(templatePath: string, customVars?: Record<string, unknown>): string | null; /** * Load a template for a specific framework or language * * @param reviewType Type of review (e.g., 'best-practices', 'security') * @param language Language (e.g., 'typescript', 'python') * @param framework Optional framework (e.g., 'react', 'angular') * @returns Rendered template string or null if not found */ export declare function loadPromptTemplate(reviewType: string, language?: string, framework?: string): string | null; /** * List all available templates * * @returns Map of available templates by category */ export declare function listAvailableTemplates(): Record<string, string[]>; /** * Clear the template cache to force reloading of templates * This is useful when the configuration changes */ export declare function clearTemplateCache(): void; /** * Export loadPromptTemplate as default */ declare const _default: { renderTemplate: typeof renderTemplate; loadPromptTemplate: typeof loadPromptTemplate; listAvailableTemplates: typeof listAvailableTemplates; clearTemplateCache: typeof clearTemplateCache; }; export default _default;