ctx-gen
Version:
AI-Enhanced Documentation Generator for Code Understanding
116 lines (115 loc) • 2.79 kB
TypeScript
/**
* Options for CtxGen
*/
export interface CtxGenOptions {
/** Output directory for documentation */
docsDir: string;
/** Path to the cache file */
cacheFile: string;
/** Comma-separated list of paths to exclude */
exclude: string;
/** Comma-separated list of languages to analyze */
languages: string;
/** Comma-separated list of diagram types to generate */
diagrams: string;
/** Generate JSON/XML outputs for AI consumption */
machineFormats: boolean;
/** Include usage examples in documentation */
includeExamples: boolean;
/** Whether to use AI-powered features */
ai: boolean;
/** OpenAI API key for AI features */
openaiKey?: string;
/** Auto-add docsDir to .gitignore */
autoIgnore: boolean;
/** Whether to respect .gitignore patterns */
respectGitignore: boolean;
/** Maximum concurrent AI analyses */
concurrentAiAnalyses?: number;
}
/**
* File cache entry
*/
export interface FileCacheEntry {
/** Modification time */
modTime: number;
/** File path */
path: string;
}
/**
* File cache mapping file paths to cache entries
*/
export interface FileCache {
[filePath: string]: FileCacheEntry;
}
/**
* Code module metadata
*/
export interface ModuleMetadata {
/** Module name */
name: string;
/** Module path */
path: string;
/** Module type (class, function, etc.) */
type: string;
/** Module description */
description: string;
/** Module dependencies */
dependencies: string[];
/** Module exports */
exports: string[];
}
/**
* Function metadata
*/
export interface FunctionMetadata {
/** Function name */
name: string;
/** Function description */
description: string;
/** Function parameters */
parameters: ParameterMetadata[];
/** Function return type */
returnType: string;
/** Function return description */
returnDescription: string;
}
/**
* Parameter metadata
*/
export interface ParameterMetadata {
/** Parameter name */
name: string;
/** Parameter type */
type: string;
/** Parameter description */
description: string;
/** Whether parameter is optional */
optional: boolean;
}
/**
* Class metadata
*/
export interface ClassMetadata {
/** Class name */
name: string;
/** Class description */
description: string;
/** Class methods */
methods: FunctionMetadata[];
/** Class properties */
properties: PropertyMetadata[];
}
/**
* Property metadata
*/
export interface PropertyMetadata {
/** Property name */
name: string;
/** Property type */
type: string;
/** Property description */
description: string;
/** Whether property is optional */
optional: boolean;
}