These are all the main components of primp. If you wish to include anything in your own program, you can mostly do it with these classes.
You can easily import the ImportSorter, ImportSeparator and ImportIntegrator, as well as the FileManager to load in your typescript files and work with them in your code.
// maybe something like thisimport { FileManager, ImportSorter, ImportIntegrator} from "pretty-ts-imports";let fileManager = new FileManager(yourTSConfigPath, someOfYourFiles);let sorter = new ImportSorter(yourGeneratedRules, []);let integrator = new ImportIntegrator({});for (let imported of fileManager.imports.values()) { let integrated = integrator.integrate(imported.imports); // write your integrated content somewhere}
If you create custom functions for your primp config, you may use the function interfaces ImportCompareFunction, ImportElementCompareFunction and SeparateByFunction. They help you make sure you are designing a correct comparator function.
For examples check this. Especially the example compare function.
Generated using TypeDoc
These are all the main components of primp. If you wish to include anything in your own program, you can mostly do it with these classes.
You can easily import the ImportSorter, ImportSeparator and ImportIntegrator, as well as the FileManager to load in your typescript files and work with them in your code.
If you create custom functions for your primp config, you may use the function interfaces ImportCompareFunction, ImportElementCompareFunction and SeparateByFunction. They help you make sure you are designing a correct comparator function.
For examples check this. Especially the example compare function.