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.

40 lines (39 loc) 1.4 kB
import * as plugins from '../plugins.js'; export declare class ProjectContext { static fromDir(dirArg: string): Promise<void>; projectDir: string; private tokenCount; private contextString; constructor(projectDirArg: string); gatherFiles(): Promise<{ smartfilePackageJSON: plugins.smartfile.SmartFile; smartfilesReadme: plugins.smartfile.SmartFile; smartfilesReadmeHints: plugins.smartfile.SmartFile; smartfilesNpmextraJSON: plugins.smartfile.SmartFile; smartfilesMod: plugins.smartfile.SmartFile[]; smartfilesTest: plugins.smartfile.SmartFile[]; }>; convertFilesToContext(filesArg: plugins.smartfile.SmartFile[]): Promise<string>; /** * Estimate token count for a string * Uses a rough estimate of 4 characters per token * @param text The text to estimate tokens for * @returns Estimated number of tokens */ countTokens(text: string): number; private buildContext; /** * Get the token count for the current context * @returns The number of tokens in the context */ getTokenCount(): number; /** * Get both the context string and its token count * @returns An object containing the context string and token count */ getContextWithTokenCount(): { context: string; tokenCount: number; }; update(): Promise<string>; }