ts-transform-esm-import
Version:
Rewrite TypeScript import paths to ES Modules import paths
14 lines (13 loc) • 942 B
TypeScript
import * as ts from 'typescript';
export declare function pathWithExt(s: string, ext: string): string;
export declare function jsPath(s: string): string;
export declare function tsPath(s: string): string;
export declare function fileExists(s: string): boolean;
export declare function pathMustExist(s: string): string;
export declare function relativePath(from: string, to: string): string;
export declare function isDynamicImport(node: ts.Node): node is ts.CallExpression;
export declare function changeTSToJS(file: string): string;
export declare function getDestImportFromProjectTS(currentDir: string, targetFile: string, rootDir: string, outDir: string): string;
export declare function getDestImportFromExternalJS(currentDir: string, targetFile: string): string;
export declare function getDestFile(sf: ts.SourceFile, rootDir: string, outDir: string): string;
export declare function getModuleNameFromImport(importPath: string): string;