tsconfig-loader.d.ts 1.0 KB

12345678910111213141516171819202122232425262728
  1. /**
  2. * Typing for the parts of tsconfig that we care about
  3. */
  4. export interface Tsconfig {
  5. extends?: string;
  6. compilerOptions?: {
  7. baseUrl?: string;
  8. paths?: {
  9. [key: string]: Array<string>;
  10. };
  11. strict?: boolean;
  12. };
  13. }
  14. export interface TsConfigLoaderResult {
  15. tsConfigPath: string | undefined;
  16. baseUrl: string | undefined;
  17. paths: {
  18. [key: string]: Array<string>;
  19. } | undefined;
  20. }
  21. export interface TsConfigLoaderParams {
  22. getEnv: (key: string) => string | undefined;
  23. cwd: string;
  24. loadSync?(cwd: string, filename?: string, baseUrl?: string): TsConfigLoaderResult;
  25. }
  26. export declare function tsConfigLoader({ getEnv, cwd, loadSync, }: TsConfigLoaderParams): TsConfigLoaderResult;
  27. export declare function walkForTsConfig(directory: string, existsSync?: (path: string) => boolean): string | undefined;
  28. export declare function loadTsconfig(configFilePath: string, existsSync?: (path: string) => boolean, readFileSync?: (filename: string) => string): Tsconfig | undefined;