doctool
Version:
AI-powered documentation validation and management system
44 lines (43 loc) • 1.31 kB
TypeScript
export interface DiffLine {
type: 'add' | 'remove' | 'context';
content: string;
lineNumber?: number;
}
export interface FileDiff {
filePath: string;
oldContent: string;
newContent: string;
lines: DiffLine[];
hasChanges: boolean;
}
/**
* Generates a unified diff between two text contents
*/
export declare function generateDiff(oldContent: string, newContent: string, filePath?: string): FileDiff;
/**
* Formats a diff for console display
*/
export declare function formatDiffForConsole(diff: FileDiff, contextLines?: number): string;
/**
* Prompts user for approval with interactive CLI
*/
export declare function promptUserApproval(message?: string): Promise<boolean>;
/**
* Prompts user with multiple options
*/
export declare function promptUserChoice(message: string, choices: string[]): Promise<string>;
/**
* Splits content into sections based on markdown headings
*/
export interface ContentSection {
heading: string;
content: string;
startLine: number;
endLine: number;
level: number;
}
export declare function parseMarkdownSections(content: string): ContentSection[];
/**
* Merges two sets of markdown sections intelligently
*/
export declare function mergeSections(oldSections: ContentSection[], newSections: ContentSection[]): string;