ts-morph-structures

Home > ts-morph-structures > ExportManager

ExportManager class

This manages export declarations and specifiers, for including in a source file.

Signature:

export default class ExportManager 

Example

publicExports.addExports({
  pathToExportedModule: path.join(distDir, "source/toolbox/ExportManager.ts"),
  exportNames: ["ExportManager"],
  isDefaultExport: true,
  isType: false,
});
// ...
sourceFile.statements.push(...publicExports.getDeclarations());

Constructors

Constructor Modifiers Description
(constructor)(absolutePathToExportFile)   Constructs a new instance of the ExportManager class

Properties

Property Modifiers Type Description
absolutePathToExportFile readonly string Where the file will live on the file system.

Methods

Method Modifiers Description
addExports(context)    
getDeclarations()   Get the export declarations, sorted by path to file, then internally by specified export values.