/** * Read the effective `compilerOptions.paths` of a tsconfig, following its * `extends` chain, and absolutize every mapping target. * * TypeScript merges `compilerOptions` per option key, so the effective `paths` * is the whole object from the nearest config in the chain that declares one * (own config first, then `extends` entries in reverse priority order). * Relative targets are anchored at the directory of the config that declares * them. TypeScript-Go resolves inherited relative `paths` against the declaring * file, not the extending one. * * The generated transform tsconfig replaces `paths` wholesale (standard * `extends` semantics), so the alias overlay must re-state these base mappings * or every tsconfig-only alias silently stops resolving. Absolutizing is * required because the generated config lives in a system temp directory and * TypeScript-Go rejects non-relative targets (TS5090) while accepting absolute * ones. * * Best-effort by design: a missing or unparsable config in the chain yields * `{}` here and a real config error from the compiler, which owns config * diagnostics. */ export declare function readEffectiveTsconfigPaths(tsconfig: string): Record; /** Scalar compiler paths TypeScript substitutes from the final config owner. */ export declare const CONFIG_DIR_TEMPLATE_SCALAR_OPTIONS: readonly ["baseUrl", "declarationDir", "generateCpuProfile", "generateTrace", "outDir", "outFile", "rootDir", "tsBuildInfoFile"]; /** List compiler paths TypeScript substitutes from the final config owner. */ export declare const CONFIG_DIR_TEMPLATE_LIST_OPTIONS: readonly ["rootDirs", "typeRoots"]; /** One config-chain input captured for generation-state comparison. */ export interface ITsconfigSourceSnapshotEntry { /** Exact bytes decoded as UTF-8, or `null` when a probed config is absent. */ contents: string | null; /** Canonical absolute spelling when the input exists. */ path: string; } /** * Capture the leaf config and its complete `extends` graph in one deterministic * list. * * Transform wrappers derive configuration before the compiler reads it again. * Comparing this snapshot across the compile prevents a wrapper derived from * one config state from being paired with membership and output from another. */ export declare function readTsconfigSourceSnapshot(tsconfig: string): ITsconfigSourceSnapshotEntry[]; /** * What the resolved configuration says can and cannot enter the program. * * The project walk exists to notice files entering and leaving the _program_, * so both halves of that question belong to configuration rather than to a * guess. Before this the walk answered both from one hardcoded list of * directory names, which was wrong in both directions at once: a bundler * writing to any directory the list did not name changed project membership * with its own output, and a source directory whose name the list did name was * dropped from the walk entirely (samchon/ttsc#1307). */ export interface ITtscProjectMembershipPolicy { /** Absolute root-file specifications; absent means conservative discovery. */ rootFileSpecs?: Readonly<{ files: readonly string[]; include: readonly string[]; /** * The requested root and its regular/native realpath spellings, without * following child links. Native realpath expands Windows short names. */ root?: Readonly<{ path: string; realpath: string; nativepath?: string; }>; }>; /** * Absolute directory exclusions separated by the configuration entry that * contributed them. * * Optional for compatibility with hosts that constructed this public policy * before exclusion provenance was exposed. Without it, an overlay preserves * every entry in `excludedDirectories` as an explicit exclusion because * silently admitting a directory is the unsafe fallback. */ directoryExclusionOrigins?: Readonly<{ declarationDir?: string; exclude: readonly string[]; outDir?: string; /** Whether output options supply TypeScript's implicit default exclude. */ useImplicitOutputExclusions?: boolean; }>; /** Absolute directories the resolved configuration keeps out of the program. */ excludedDirectories: readonly string[]; /** Lowercased extensions a file needs to be a possible program input. */ inputExtensions: readonly string[]; /** * Every config file consulted to produce this policy, the leaf and its whole * `extends` ancestry. * * A caller that memoizes a policy has to know when to stop trusting it, and * the leaf alone cannot tell it: adding `exclude` to a shared * `tsconfig.base.json` leaves the leaf untouched while changing every answer * this policy gives. */ sources: readonly string[]; } /** * The policy every project falls back to when no configuration is available. * * Deliberately the widest one: admitting a file that cannot enter the program * costs a compile, while refusing one that can costs correctness, and only the * second is a defect the user cannot see. */ export declare const PERMISSIVE_PROJECT_MEMBERSHIP_POLICY: ITtscProjectMembershipPolicy; /** * Read the membership policy the resolved tsconfig implies, following its * `extends` chain for every option the answer depends on. * * `allowJs` and `resolveJsonModule` decide which extensions can enter the * program at all, so a `bundle.a1b2c3.js` emitted beside the sources is not a * membership change for a project that admits no JavaScript. `outDir`, * `declarationDir`, and the plain entries of `exclude` name the directories the * program does not contain. TypeScript supplies the two output directories as * implicit exclusions only when no top-level `exclude` replaces that default. * * A glob in `exclude` is skipped rather than approximated. Failing to exclude * costs a walk; excluding the wrong tree hides real sources, and this function * refuses to guess in the direction that loses correctness. */ export declare function readProjectMembershipPolicy(tsconfig: string): ITtscProjectMembershipPolicy; /** * Apply the caller's compiler-options overlay on top of a policy read from the * project config. * * The overlay wins for the compile, so it wins here too. A caller that turns * `allowJs` on gets a program that admits JavaScript, and a membership rule * that still refused it would miss files entering that program; a caller that * turns it off gets the narrower rule for the same reason. */ export declare function mergeMembershipPolicyOverlay(policy: ITtscProjectMembershipPolicy, compilerOptions: Record, baseDir: string): ITtscProjectMembershipPolicy; /** * Materialize inherited compiler paths whose `${configDir}` owner would move * when a generated wrapper becomes the final config in the chain. * * Only template-bearing options are returned. Ordinary inherited paths are * already made absolute while TypeScript parses their declaring config, while * template paths deliberately survive until the final consumer is known. */ export declare function readEffectiveTsconfigTemplateCompilerOptions(tsconfig: string): Record; /** * Materialize inherited file specifications whose `${configDir}` owner would * otherwise move to a generated wrapper's scratch directory. */ export declare function readEffectiveTsconfigTemplateFileSpecs(tsconfig: string): Record; /** * Anchor a single `paths` target at `baseDir` unless it is already absolute, * normalizing to forward slashes. The `*` wildcard survives `path.resolve` as a * literal segment, so patterns like `./src/*` stay patterns. */ export declare function absolutizePathsTarget(baseDir: string, target: string, configDir?: string): string; /** Resolve one config path with TypeScript's leading `${configDir}` template. */ export declare function resolveConfigDirTemplatePath(baseDir: string, target: string, configDir?: string): string;