25 lines
1.8 KiB
Plaintext
25 lines
1.8 KiB
Plaintext
import type { MultiMap, SymlinkedDirectory } from "../5_0/symlinkCache";
|
|
import type { ModeAwareCache, Path, ResolutionMode, ResolvedModuleWithFailedLookupLocations, ResolvedTypeReferenceDirectiveWithFailedLookupLocations } from "typescript/lib/tsserverlibrary";
|
|
export interface SymlinkCache {
|
|
/** Gets a map from symlink to realpath. Keys have trailing directory separators. */
|
|
getSymlinkedDirectories(): ReadonlyMap<Path, SymlinkedDirectory | false> | undefined;
|
|
/** Gets a map from realpath to symlinks. Keys have trailing directory separators. */
|
|
getSymlinkedDirectoriesByRealpath(): MultiMap<Path, string> | undefined;
|
|
/** Gets a map from symlink to realpath */
|
|
getSymlinkedFiles(): ReadonlyMap<Path, string> | undefined;
|
|
setSymlinkedDirectory(symlink: string, real: SymlinkedDirectory | false): void;
|
|
setSymlinkedFile(symlinkPath: Path, real: string): void;
|
|
/**
|
|
* @internal
|
|
* Uses resolvedTypeReferenceDirectives from program instead of from files, since files
|
|
* don't include automatic type reference directives. Must be called only when
|
|
* `hasProcessedResolutions` returns false (once per cache instance).
|
|
*/
|
|
setSymlinksFromResolutions(forEachResolvedModule: (callback: (resolution: ResolvedModuleWithFailedLookupLocations, moduleName: string, mode: ResolutionMode, filePath: Path) => void) => void, forEachResolvedTypeReferenceDirective: (callback: (resolution: ResolvedTypeReferenceDirectiveWithFailedLookupLocations, moduleName: string, mode: ResolutionMode, filePath: Path) => void) => void, typeReferenceDirectives: ModeAwareCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>): void;
|
|
/**
|
|
* @internal
|
|
* Whether `setSymlinksFromResolutions` has already been called.
|
|
*/
|
|
hasProcessedResolutions(): boolean;
|
|
}
|