UNPKG

@re-shell/cli

Version:

Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja

180 lines (179 loc) 4.8 kB
import { EventEmitter } from 'events'; export interface DocumentationConfig { projectName: string; projectPath: string; description?: string; author?: string; license?: string; repository?: string; homepage?: string; outputFormat?: 'markdown' | 'html' | 'pdf' | 'all'; includeApi?: boolean; includeExamples?: boolean; includeChangelog?: boolean; includeContributing?: boolean; includeLicense?: boolean; includeArchitecture?: boolean; customSections?: CustomSection[]; theme?: 'default' | 'minimal' | 'technical' | 'modern'; } export interface CustomSection { title: string; content: string; order?: number; } export interface ProjectInfo { name: string; version?: string; description?: string; keywords?: string[]; author?: string | { name: string; email?: string; url?: string; }; license?: string; repository?: string | { type: string; url: string; }; homepage?: string; dependencies?: Record<string, string>; devDependencies?: Record<string, string>; scripts?: Record<string, string>; engines?: Record<string, string>; bin?: string | Record<string, string>; } export interface GeneratedDocument { type: string; path: string; content: string; format: 'markdown' | 'html' | 'pdf'; } export interface DocumentationResult { success: boolean; documents: GeneratedDocument[]; errors?: string[]; warnings?: string[]; } export interface ApiDocumentation { modules: ModuleDoc[]; classes: ClassDoc[]; functions: FunctionDoc[]; interfaces: InterfaceDoc[]; types: TypeDoc[]; } export interface ModuleDoc { name: string; description?: string; exports: string[]; imports: string[]; path: string; } export interface ClassDoc { name: string; description?: string; extends?: string; implements?: string[]; constructors: MethodDoc[]; properties: PropertyDoc[]; methods: MethodDoc[]; module: string; } export interface FunctionDoc { name: string; description?: string; parameters: ParameterDoc[]; returns?: ReturnDoc; examples?: string[]; module: string; } export interface InterfaceDoc { name: string; description?: string; extends?: string[]; properties: PropertyDoc[]; methods: MethodDoc[]; module: string; } export interface TypeDoc { name: string; description?: string; type: string; module: string; } export interface MethodDoc { name: string; description?: string; visibility?: 'public' | 'private' | 'protected'; static?: boolean; async?: boolean; parameters: ParameterDoc[]; returns?: ReturnDoc; examples?: string[]; } export interface PropertyDoc { name: string; description?: string; type: string; visibility?: 'public' | 'private' | 'protected'; static?: boolean; readonly?: boolean; optional?: boolean; defaultValue?: string; } export interface ParameterDoc { name: string; description?: string; type: string; optional?: boolean; defaultValue?: string; } export interface ReturnDoc { type: string; description?: string; } export declare class DocumentationGenerator extends EventEmitter { private projectInfo?; private apiDocs?; constructor(); generate(config: DocumentationConfig): Promise<DocumentationResult>; private loadProjectInfo; private generateDocuments; private generateReadme; private generateBadges; private generateFeaturesList; private generatePrerequisites; private getInstallCommand; private generateUsageSection; private generateDevelopmentSection; private describeScript; private generateProjectStructure; private generateTestingSection; private generateApiDoc; private formatMethod; private formatFunction; private generateExamplesDoc; private generateChangelog; private generateContributing; private generateArchitectureDoc; private generateLicense; private generateApiDocumentation; private findSourceFiles; private extractExports; private extractImports; private convertFormat; private markdownToHtml; private toCamelCase; private toPascalCase; writeDocuments(documents: GeneratedDocument[]): Promise<{ written: string[]; errors: string[]; }>; } export declare function generateDocumentation(projectPath: string, options?: Partial<DocumentationConfig>): Promise<DocumentationResult>; export declare function generateAndWriteDocumentation(projectPath: string, options?: Partial<DocumentationConfig>): Promise<{ result: DocumentationResult; written: string[]; errors: string[]; }>;