import type { RangeData } from '../common/range'; import type { PromptString } from './prompt-string'; /** * Truncates text to the given number of tokens, keeping the start of the text. */ export declare function truncateText(text: string, maxTokens: number): string; export declare function truncatePromptString(text: PromptString, maxTokens: number): PromptString; /** * If text was truncated, return the truncated text and range to which it was truncated. * If the text is shorter than maxBytes, then return the text as-is with an undefined * range. * Note: the truncated text and range may be empty (e.g., for single-line files, * which should be ignored anyway). */ export declare function truncateTextNearestLine(text: string, maxBytes: number): { truncated: string; range?: RangeData; }; /** * Truncates text to the given number of tokens, keeping the end of the text. */ export declare function truncateTextStart(text: string, maxTokens: number): string; export declare function truncatePromptStringStart(text: PromptString, maxTokens: number): PromptString; //# sourceMappingURL=truncation.d.ts.map