/** * Token Counter and Validator * * Provides token counting functionality for templates with estimation * and limit validation capabilities. */ import type { TokenCountResult } from './types.js'; /** * Approximate token count for text * Uses character-based estimation when tokenizer is not available * * Approximation: ~4 characters per token for English text * This is a rough estimate - actual token count depends on the tokenizer used */ export declare function countTokens(text: string): number; /** * More accurate token count for code * Code typically has more tokens per character due to punctuation */ export declare function countCodeTokens(code: string): number; /** * Count tokens in an array of strings */ export declare function countTokensArray(strings: string[]): number; /** * Validate token count against limit */ export declare function validateTokenLimit(tokenCount: number, limit: number, tolerance?: number): { withinLimit: boolean; warnings: string[]; }; /** * Detailed token count result with metadata */ export declare function getTokenCountDetails(text: string, isCode?: boolean): TokenCountResult; /** * Check if a file is within token limits */ export declare function checkFileTokenLimit(content: string, filePath: string, limits: Record): { withinLimit: boolean; warnings: string[]; }; /** * Suggest content reduction strategies */ export declare function suggestReduction(tokenCount: number, limit: number): string[]; /** * Format token count for display */ export declare function formatTokenCount(tokenCount: number): string; //# sourceMappingURL=token-validator.d.ts.map