/** * TsUnpacker handles flattening of nested TypeScript output directories. * * When TypeScript compiles files that import from sibling directories, * it creates a nested structure like: * dist_ts_core/ts_core/index.js * dist_ts_core/ts_shared/helper.js * * This class flattens it to: * dist_ts_core/index.js */ export declare class TsUnpacker { private sourceFolderName; private destDir; private cwd; private config; constructor(sourceFolderName: string, destDir: string, cwd?: string); /** * Create an unpacker from a glob pattern * './ts_core/**\/*.ts' → sourceFolderName = 'ts_core' */ static fromGlobPattern(sourcePattern: string, destDir: string, cwd?: string): TsUnpacker | null; /** * Get the source folder name */ getSourceFolderName(): string; /** * Get the destination directory */ getDestDir(): string; /** * Check if unpacking should be performed based on tspublish.json config * Default is true if not specified */ shouldUnpack(): Promise; /** * Check if nested structure exists in the destination directory */ detectNesting(): Promise; /** * Get the path to the nested directory */ getNestedPath(): string; /** * Perform the unpack operation - flatten nested output directories. * * When TypeScript compiles files that import from sibling directories, * it creates a nested structure like dist_ts/ts/ with siblings like * dist_ts/ts_interfaces/. This method flattens by: * 1. Removing sibling directories (non-source folders) * 2. Moving contents of the nested source folder up to the dest dir * 3. Removing the now-empty nested source folder * * Uses synchronous fs operations for reliability. * Called after all compilations are complete (not between compilations) * to avoid filesystem metadata issues on XFS. * * Returns true if unpacking was performed, false if skipped. */ unpack(): Promise; } /** * Convenience function to perform unpack operation * Can be used directly without instantiating the class */ export declare function performUnpack(sourcePattern: string, destDir: string, cwd?: string): Promise;