UNPKG

@mnrendra/obtain-tsconfig-paths

Version:

Obtain a valid baseUrl and paths from the compilerOptions in the tsconfig.json file

51 lines (46 loc) 1.61 kB
import { BaseURL, Paths, CompilerOptions } from '@mnrendra/read-tsconfig'; export { BaseURL, CompilerOptions, Paths, TSConfig } from '@mnrendra/read-tsconfig'; /** * A valid `baseUrl` and `paths` values. * * @see https://github.com/mnrendra/obtain-tsconfig-paths#readme */ interface TSConfigPaths { /** * Specify the base directory to resolve non-relative module names. * * @see https://www.typescriptlang.org/tsconfig#baseUrl */ baseUrl: BaseURL; /** * Specify a set of entries that re-map imports to additional lookup * locations. * * @see https://www.typescriptlang.org/tsconfig#paths */ paths: Paths; } /** * Obtain a valid `baseUrl` and `paths` from the `compilerOptions` in the * `tsconfig.json` file asynchronously. * * @param {CompilerOptions} options - A `compilerOptions` object. * * @returns {Promise<TSConfigPaths>} A valid `baseUrl` and `paths` values. * * @see https://github.com/mnrendra/obtain-tsconfig-paths#readme */ declare const main$1: (options?: CompilerOptions) => Promise<TSConfigPaths>; /** * Obtain a valid `baseUrl` and `paths` from the `compilerOptions` in the * `tsconfig.json` file synchronously. * * @param {CompilerOptions} options - A `compilerOptions` object. * * @returns {TSConfigPaths} A valid `baseUrl` and `paths` values. * * @see https://github.com/mnrendra/obtain-tsconfig-paths#readme */ declare const main: (options?: CompilerOptions) => TSConfigPaths; export { type TSConfigPaths, main$1 as obtainTSConfigPaths, main as obtainTSConfigPathsSync }; //# sourceMappingURL=index.d.ts.map