UNPKG

@git.zone/tsdoc

Version:

A comprehensive TypeScript documentation tool that leverages AI to generate and enhance project documentation, including dynamic README creation, API docs via TypeDoc, and smart commit message generation.

95 lines (89 loc) 2.62 kB
/** * Context processing mode to control how context is built */ export type ContextMode = 'full' | 'trimmed' | 'summarized'; /** * Configuration for context trimming */ export interface ITrimConfig { /** Whether to remove function implementations */ removeImplementations?: boolean; /** Whether to preserve interface definitions */ preserveInterfaces?: boolean; /** Whether to preserve type definitions */ preserveTypeDefs?: boolean; /** Whether to preserve JSDoc comments */ preserveJSDoc?: boolean; /** Maximum lines to keep for function bodies (if not removing completely) */ maxFunctionLines?: number; /** Whether to remove normal comments (non-JSDoc) */ removeComments?: boolean; /** Whether to remove blank lines */ removeBlankLines?: boolean; } /** * Task types that require different context optimization */ export type TaskType = 'readme' | 'commit' | 'description'; /** * Configuration for different tasks */ export interface ITaskConfig { /** The context mode to use for this task */ mode?: ContextMode; /** File paths to include for this task */ includePaths?: string[]; /** File paths to exclude for this task */ excludePaths?: string[]; /** For commit tasks, whether to focus on changed files */ focusOnChangedFiles?: boolean; /** For description tasks, whether to include package info */ includePackageInfo?: boolean; } /** * Complete context configuration */ export interface IContextConfig { /** Maximum tokens to use for context */ maxTokens?: number; /** Default context mode */ defaultMode?: ContextMode; /** Task-specific settings */ taskSpecificSettings?: { [key in TaskType]?: ITaskConfig; }; /** Trimming configuration */ trimming?: ITrimConfig; } /** * Basic file information interface */ export interface IFileInfo { /** The file path */ path: string; /** The file contents */ contents: string; /** The file's relative path from the project root */ relativePath: string; /** The estimated token count of the file */ tokenCount?: number; /** The file's importance score (higher is more important) */ importanceScore?: number; } /** * Result of context building */ export interface IContextResult { /** The generated context string */ context: string; /** The total token count of the context */ tokenCount: number; /** Files included in the context */ includedFiles: IFileInfo[]; /** Files that were trimmed */ trimmedFiles: IFileInfo[]; /** Files that were excluded */ excludedFiles: IFileInfo[]; /** Token savings from trimming */ tokenSavings: number; }