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.48 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>; /** * Calculate the token count for a string using the GPT tokenizer * @param text The text to count tokens for * @param model The model to use for token counting (default: gpt-3.5-turbo) * @returns The number of tokens in the text */ countTokens(text: string, model?: 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>; }