UNPKG

@paulohenriquevn/m2js

Version:

Transform TypeScript/JavaScript code into LLM-friendly Markdown summaries + Smart Dead Code Detection + Graph-Deep Diff Analysis. Extract exported functions, classes, and JSDoc comments for better AI context with 60%+ token reduction. Intelligent dead cod

96 lines (95 loc) 2.63 kB
/** * M2JS Template Generator Engine * Generates LLM-friendly specification documents for code implementation */ import { TemplateOptions } from './template-types'; /** * Main template generator class */ export declare class TemplateGenerator { /** * Generates a specification template for a component */ generateTemplate(options: TemplateOptions): string; /** * Lists available domains and their descriptions */ listDomains(): string; /** * Creates component specification based on options and domain template */ private createComponentSpec; /** * Creates generic component spec when no domain entity match */ private createGenericComponentSpec; /** * Creates component spec based on domain entity */ private createEntityBasedComponentSpec; /** * Generates the final markdown template */ private generateMarkdownTemplate; /** * Generates business context section */ private generateBusinessContextSection; /** * Generates component overview section */ private generateComponentOverviewSection; /** * Generates exports section with detailed specifications */ private generateExportsSection; /** * Generates function specification */ private generateFunctionSpec; /** * Generates class specification */ private generateClassSpec; /** * Generates interface specification */ private generateInterfaceSpec; /** * Generates implementation guide section */ private generateImplementationSection; /** * Generates usage examples section */ private generateUsageExamplesSection; /** * Generates testing section */ private generateTestingSection; private capitalizeFirst; private inferComponentType; private inferLayer; private inferPattern; private inferDirectory; private inferDependencies; private extractEntityDependencies; private createGenericExports; private createEntityExports; private generateEntityClassSignature; private generateCreateDataInterface; private generateExampleData; private generateExampleValue; private inferMethodReturnType; private inferMethodParameters; private createImplementationGuide; private createEntityImplementationGuide; } /** * Convenience function to generate template */ export declare function generateTemplate(options: TemplateOptions): string; /** * Convenience function to list domains */ export declare function listAvailableDomains(): string;