@devlander/collect-exports-for-bundle
Version:
Generate comprehensive export files for TypeScript/JavaScript projects with Rollup compatibility
62 lines (61 loc) • 2.78 kB
TypeScript
import { toCamelCase } from './conversions/to-camel-case';
import { createExtensions } from './extensions/create-extensions';
declare class AdvancedExportGenerator {
private config;
private cache;
private exportCache;
constructor(config: any);
generateAdvancedExports(files: string[], config: any): {
exports: string[];
defaultExport: string | null;
bundleObject: string[] | null;
header: string[];
metadata: any;
};
generateHeader(config: any): string[];
generateMainExports(files: string[], config: any): string[];
generateExportStatement(cleanPath: string, file: string, config: any): string;
generateSelectiveExport(cleanPath: string, file: string, config: any): string;
analyzeFileExports(content: string): {
default: boolean;
named: string[];
};
generateDefaultExport(defaultExportPath: string, config: any): string;
generateBundleObject(files: string[], config: any): string[];
generateMetadata(files: string[], config: any): {
totalFiles: number;
exportStyle: any;
exportStrategy: any;
hasDefaultExport: boolean;
hasBundleObject: any;
generatedAt: string;
};
sortFiles(files: string[], strategy: string): string[];
hasCircularDependency(file: string, config: any): boolean;
validatePath(file: string, config: any): boolean;
getCachedResult(key: string): any;
setCachedResult(key: string, result: any): void;
processFilesInParallel(files: string[], config: any, batchSize?: number): Promise<any[]>;
processFile(file: string, config: any): any;
}
declare function generateESMExports(files: string[], config: any): {
exports: string[];
};
declare function generateCJSExports(files: string[], config: any): {
requires: string[];
};
declare function generateMixedExports(files: string[], config: any): {
exports: string[];
};
declare function formatESMOutput(exportOutput: any): string;
declare function formatCJSOutput(exportOutput: any): string;
declare function formatMixedOutput(exportOutput: any): string;
declare function formatAdvancedOutput(exportOutput: any, config: any): string;
declare function collectPathsFromDirectories(rootDir: string, options?: any): Promise<string[]>;
declare function collectExportsForBundle(config: any): Promise<{
files: never[];
exports: {};
formatted: string;
}>;
declare function autoExporterWrapper(config: any): Promise<void>;
export { AdvancedExportGenerator, generateESMExports, generateCJSExports, generateMixedExports, formatESMOutput, formatCJSOutput, formatMixedOutput, formatAdvancedOutput, createExtensions, collectExportsForBundle, collectPathsFromDirectories, toCamelCase, autoExporterWrapper as default };