@regele/devtools
Version:
A collection of developer utilities for code processing and text analysis
71 lines (70 loc) • 2.01 kB
TypeScript
import { CommentRemovalOptions, FileType } from './utils';
import { FileOptions, FileResult } from './cli/fileUtils';
/**
* Comment Remover class for removing comments from code
*/
export declare class CommentRemover {
private options;
/**
* Create a new CommentRemover instance
*
* @param options - Options for comment removal
*/
constructor(options?: Partial<CommentRemovalOptions>);
/**
* Remove comments from code
*
* @param code - The code to process
* @param fileType - The file type or language
* @returns The code with comments removed
*/
removeComments(code: string, fileType?: FileType | string): string;
/**
* Remove JavaScript/TypeScript comments
*
* @param code - The code to process
* @returns The code with comments removed
*/
private removeJavaScriptComments;
/**
* Remove HTML comments
*
* @param code - The code to process
* @returns The code with comments removed
*/
private removeHTMLComments;
/**
* Remove CSS comments
*
* @param code - The code to process
* @returns The code with comments removed
*/
private removeCSSComments;
/**
* Remove empty lines from code
*
* @param code - The code to process
* @returns The code with empty lines removed
*/
private removeEmptyLines;
/**
* Update comment removal options
*
* @param options - New options to apply
*/
updateOptions(options: Partial<CommentRemovalOptions>): void;
/**
* Get current comment removal options
*
* @returns The current options
*/
getOptions(): CommentRemovalOptions;
/**
* Remove comments from multiple files
*
* @param patterns - Glob patterns to match files
* @param options - File options
* @returns Results of the operations
*/
cleanFiles(patterns: string | string[], options?: FileOptions): Promise<FileResult[]>;
}