UNPKG

tsc-path-fix

Version:

Zero-runtime TypeScript path resolver - converts aliases to relative paths at compile time. Fast, lightweight, with native watch mode.

22 lines (21 loc) 1.14 kB
import { StringReplacer } from '../interfaces'; declare class ImportPathResolver { source: string; readonly sourcePath: string; constructor(source: string, sourcePath: string); get sourceDir(): string; replaceSourceImportPaths(replacer: StringReplacer): this; resolveFullImportPaths(ext?: string): this; private resolveFullPath; static newStringRegex(): RegExp; static newImportStatementRegex(flags?: string): RegExp; static resolveFullImportPaths(code: string, path: string, ext?: string): string; static replaceSourceImportPaths(code: string, path: string, replacer: StringReplacer): string; static clearCache(): void; } export declare const resolveFullImportPaths: typeof ImportPathResolver.resolveFullImportPaths; export declare const newImportStatementRegex: typeof ImportPathResolver.newImportStatementRegex; export declare const replaceSourceImportPaths: typeof ImportPathResolver.replaceSourceImportPaths; export declare const newStringRegex: typeof ImportPathResolver.newStringRegex; export declare const clearPathResolutionCache: typeof ImportPathResolver.clearCache; export {};