UNPKG

ts-add-js-extension

Version:

Add .js extension to each relative ESM import and export statement in JavaScript file

37 lines (36 loc) 1.01 kB
import type { PartialConfig } from './cli-command-parser'; import type { ParsedConfig } from './config'; import { parseConfig } from './config'; declare const tsAddJsExtension: (props: Readonly<{ config: PartialConfig; /** * @deprecated since version 1.4.0 * Will be removed in version 2.0 * To pass configurations to `tsAddJsExtension` * Just pass the configurations directly * ``` * tsAddJsExtension({ * config:{ * dir:'dist' * } * }) * ``` * Instead of passing with this function * ``` * tsAddJsExtension({ * parsedConfigFunction: () => parseConfig(argv) * }) * ``` * As it will be ignroed */ parsedConfigFunction?: () => ParsedConfig; }>) => Promise<{ readonly type: "done"; readonly error?: never; } | { readonly type: "error"; readonly error: unknown; }>; declare const main: (args: string) => void | Promise<void>; export { parseConfig, tsAddJsExtension }; export default main;