import { SourceFile } from './source-file.js'; import { JsonSourceFile } from './json-source-file.js'; import { JsonTextSourceFile } from './json-text-source-file.js'; import { PathResolver, ResolveResult } from './paths.js'; type Module = 'none' | 'commonjs' | 'amd' | 'system' | 'es6' | 'es2015' | 'es2020' | 'es2022' | 'esnext' | 'node16' | 'nodenext' | 'preserve'; type ModuleResolution = 'classic' | 'node10' | 'node' | 'node16' | 'nodenext' | 'bundler'; type Paths = Record>; interface CompilerOptions { module?: Module; moduleResolution?: ModuleResolution; baseUrl?: string; paths?: Paths; /** * If set, .js files will be emitted into this directory. * * If not set, .js files are placed right next to .ts files in the same * folder. * * @see https://www.typescriptlang.org/tsconfig/#outDir */ outDir?: string; /** * If not set, rootDir is inferred to be the longest common path of all * non-declaration input files, unless `composite: true`, in which case * the inferred root is the directory containing the tsconfig.json file. * * @see https://www.typescriptlang.org/tsconfig/#rootDir */ rootDir?: string; /** * Allow multiple directions to act as a single root. Source files will be * able to refer to files in other roots as if they were present in the same * root. * * @see https://www.typescriptlang.org/tsconfig/#rootDirs */ rootDirs?: string[]; /** * If true, the default rootDir is the directory containing the * tsconfig.json file. * * @see https://www.typescriptlang.org/tsconfig/#composite */ composite?: boolean; } export interface Schema { /** * Path(s) to one or more configuration files this config inherits from. May * be a single specifier or, since TypeScript 5.0, an array. Later array * entries override earlier ones and this config overrides all of them. * * @see https://www.typescriptlang.org/tsconfig/#extends */ extends?: string | string[]; compilerOptions?: CompilerOptions; } /** * A configuration file reached through another config's `extends` property. * * `bundle` indicates whether the config is a local project file that must be * included in the deployment bundle (a relative/absolute path or a * workspace-member package) as opposed to an external `node_modules` package * that the runner restores from `package.json` and therefore does not need to * be bundled. */ export type ExtendedConfig = { jsonFile: JsonSourceFile; bundle: boolean; }; /** * Resolves a config referenced by another config's `extends` property. The * resolver supplies this so that config loading can pull in the chain of * extended configs without the file-loading machinery leaking into this module. */ export type ResolveExtends = (specifier: string, fromDir: string) => Promise; /** * One link in a flattened `extends` chain, ordered from lowest to highest * precedence. `bundle` carries whether the link's source file must be bundled. */ export type ChainLink = { jsonFile: JsonSourceFile; bundle: boolean; }; export declare class TSConfigFile { #private; static FILENAME: string; readonly id: number; jsonFile: JsonSourceFile; basePath: string; moduleResolution: string; baseUrl: string; pathResolver: PathResolver; /** * Source files of the configs reached through `extends` that must be bundled * alongside this config (relative/absolute paths and workspace-member * packages). External `node_modules` configs are excluded — they only * contribute their compiler options, not a bundled file. */ bundledExtendsSourceFiles: SourceFile[]; relatedSourceFiles: SourceFile[]; protected constructor(jsonFile: JsonSourceFile, chain: ChainLink[]); get meta(): import("./source-file.js").FileMeta; static loadFromJsonTextSourceFile(jsonFile: JsonTextSourceFile, resolveExtends: ResolveExtends): Promise; static filePath(dirPath: string): string; /** * Depth-first expands the `extends` chain into links ordered from lowest to * highest precedence (this config last). A config that `extends` an array * inherits later entries with higher precedence than earlier ones. Cycles are * terminated by tracking visited config paths. */ protected static buildChain(jsonFile: JsonSourceFile, bundle: boolean, resolveExtends: ResolveExtends, visited: Set): Promise; resolvePath(importPath: string): ResolveResult; collectLookupPaths(filePath: string): string[]; registerRelatedSourceFile(file: SourceFile): void; } export {};