ts-transformer-minify-privates
Version:
A TypeScript custom transformer which minify names of private class members
25 lines (24 loc) • 819 B
TypeScript
import * as ts from 'typescript';
export declare const enum GenerateNameStrategy {
PrependPrefixOnly = "prependPrefixOnly",
Random = "random",
RandomStable = "randomStable"
}
export interface PropertyMinifierOptions {
/**
* Prefix of generated names (e.g. '__private__')
*/
prefix: string;
}
export declare class PropertiesMinifier {
private readonly context;
private readonly options;
constructor(context: ts.TransformationContext, options?: Partial<PropertyMinifierOptions>);
visitSourceFile(node: ts.SourceFile, program: ts.Program, context: ts.TransformationContext): ts.SourceFile;
private visitNodeAndChildren;
private visitNode;
private createNewAccessExpression;
private createNewBindingElement;
private createNewNode;
private getNewName;
}