/** * Comprehensive API Documentation Auto-Generation System * Extracts documentation from tool classes, types, and WordPress mappings */ export interface DocumentationConfig { outputDir: string; includeExamples: boolean; includeWordPressMapping: boolean; generateOpenAPI: boolean; generateInteractiveHtml: boolean; validateExamples: boolean; } export interface ToolDocumentation { name: string; category: string; description: string; parameters: ParameterDocumentation[]; examples: ExampleUsage[]; wordpressEndpoint: string | undefined; requiredPermissions: string[] | undefined; returnType: string; errorCodes: ErrorDocumentation[]; relatedTools: string[]; } export interface ParameterDocumentation { name: string; type: string; required: boolean; description: string; defaultValue: unknown; allowedValues: string[] | undefined; examples: string[]; } export interface ExampleUsage { title: string; description: string; command: string; parameters: Record; expectedResponse: unknown; errorExample?: { scenario: string; error: unknown; }; } export interface ErrorDocumentation { code: string; message: string; description: string; resolution: string; } export interface DocumentationOutput { tools: ToolDocumentation[]; categories: CategoryDocumentation[]; types: TypeDocumentation[]; openApiSpec: OpenAPISpecification | undefined; summary: DocumentationSummary; } export interface CategoryDocumentation { name: string; description: string; toolCount: number; tools: string[]; usagePatterns: string[]; } export interface TypeDocumentation { name: string; description: string; properties: PropertyDocumentation[]; examples: unknown[]; wordpressSource?: string; } export interface PropertyDocumentation { name: string; type: string; required: boolean; description: string; format?: string; } export interface OpenAPISpecification { openapi: string; info: Record; paths: Record; components: Record; } export interface DocumentationSummary { totalTools: number; totalCategories: number; totalTypes: number; lastUpdated: string; version: string; coverage: { toolsWithExamples: number; toolsWithWordPressMapping: number; typesDocumented: number; }; } /** * Main Documentation Generator */ export declare class DocumentationGenerator { private config; private toolCategories; private wordpressEndpoints; private logger; constructor(config?: Partial); /** * Generate complete documentation for all tools and types */ generateFullDocumentation(): Promise; /** * Extract documentation from all tool classes */ private extractAllToolDocumentation; /** * Returns a tool's parameters in the legacy array shape. * * Tool definitions declare arguments one of two ways: a `parameters` array (only * PerformanceTools still does) or an `inputSchema` JSON Schema (every other tool file). * Reading `parameters` alone documented 65 of 71 tools as taking no arguments and * emitted empty OpenAPI request schemas, so flatten `inputSchema.properties` when no * array is present. */ private resolveParameters; /** * Extract documentation for a single tool */ private extractToolDocumentation; /** * Extract parameter documentation */ private extractParameterDocumentation; /** * Generate usage examples for tools */ private generateToolExamples; /** * Generate basic usage example */ private generateBasicExample; /** * Generate multi-site example */ private generateMultiSiteExample; /** * Generate advanced example with all parameters */ private generateAdvancedExample; /** * Generate category documentation */ private generateCategoryDocumentation; /** * Extract type documentation from TypeScript definitions */ private extractTypeDocumentation; /** * Generate OpenAPI specification */ private generateOpenAPISpecification; /** * Write all documentation files */ private writeDocumentationFiles; private extractCategoryFromClassName; private initializeWordPressMapping; private initializeToolCategories; private generateDocumentationSummary; /** * Helper methods for documentation generation */ private getDefaultValue; private getAllowedValues; private generateParameterExamples; private supportsMultiSite; private generateExampleValue; private generateExpectedResponse; private getExampleParameters; private getCategoryDescription; private generateUsagePatterns; private generateWordPressPostExample; private generateParameterSchema; private convertTypeToJsonSchema; private inferReturnType; private generateErrorDocumentation; private findRelatedTools; private getRequiredPermissions; /** * File writing implementations */ private writeApiOverview; private writeToolDocumentation; private writeCategoryDocumentation; private writeTypeDocumentation; } //# sourceMappingURL=DocumentationGenerator.d.ts.map