import { Effect, FileSystem, Option, Path, PlatformError, Schema } from "effect"; //#region src/CompilerOptions.d.ts /** * `compilerOptions.target` — the ECMAScript target. `es5` is deprecated in TS * 6.0; `es3` has no literal (dead per R1.3 — a `target: "es3"` value fails * decode against this schema rather than silently passing through, since * `target` itself is a live, typed field). * * @public */ declare const Target: Schema.decodeTo, Schema.String, never, never>; /** * `compilerOptions.module` — the module output format. `none`, `amd`, `umd` * and `system` are deprecated in TS 6.0. * * @public */ declare const Module: Schema.decodeTo, Schema.String, never, never>; /** * `compilerOptions.moduleResolution`. `node10`, `node` and `classic` are * deprecated in TS 6.0. * * @public */ declare const ModuleResolution: Schema.decodeTo, Schema.String, never, never>; /** * `compilerOptions.jsx`. There is no `none` literal — tsc's option map has * only these five. * * @public */ declare const Jsx: Schema.decodeTo, Schema.String, never, never>; /** `compilerOptions.newLine`. @public */ declare const NewLine: Schema.decodeTo, Schema.String, never, never>; /** `compilerOptions.moduleDetection`. @public */ declare const ModuleDetection: Schema.decodeTo, Schema.String, never, never>; /** * `compilerOptions.lib` member values — the complete TS 6.0.3 set, lowercase * canonical, per R1.2. * * @public */ declare const Lib: Schema.decodeTo, Schema.String, never, never>; /** * `compilerOptions`, decoded as every R1.3-live boolean, R1.4 string/path/ * array/record/number, and R1.2 enum field — each `optionalKey` — intersected * with a passthrough record so unknown and dead (R1.3 dead-list) keys survive * decode and re-encode untouched, per the forward-tolerance constraint. * * @public */ declare const CompilerOptions: Schema.StructWithRest, Schema.String, never, never>>; readonly module: Schema.optionalKey, Schema.String, never, never>>; readonly moduleResolution: Schema.optionalKey, Schema.String, never, never>>; readonly jsx: Schema.optionalKey, Schema.String, never, never>>; readonly newLine: Schema.optionalKey, Schema.String, never, never>>; readonly moduleDetection: Schema.optionalKey, Schema.String, never, never>>; readonly lib: Schema.optionalKey, Schema.String, never, never>>>; readonly ignoreDeprecations: Schema.optionalKey>; readonly strict: Schema.optionalKey; readonly noImplicitAny: Schema.optionalKey; readonly strictNullChecks: Schema.optionalKey; readonly strictFunctionTypes: Schema.optionalKey; readonly strictBindCallApply: Schema.optionalKey; readonly strictPropertyInitialization: Schema.optionalKey; readonly strictBuiltinIteratorReturn: Schema.optionalKey; readonly noImplicitThis: Schema.optionalKey; readonly useUnknownInCatchVariables: Schema.optionalKey; /** @deprecated Deprecated in TypeScript 6.0 when set to `false`. */ readonly alwaysStrict: Schema.optionalKey; readonly noUnusedLocals: Schema.optionalKey; readonly noUnusedParameters: Schema.optionalKey; readonly exactOptionalPropertyTypes: Schema.optionalKey; readonly noImplicitReturns: Schema.optionalKey; readonly noFallthroughCasesInSwitch: Schema.optionalKey; readonly noUncheckedIndexedAccess: Schema.optionalKey; readonly noImplicitOverride: Schema.optionalKey; readonly noPropertyAccessFromIndexSignature: Schema.optionalKey; readonly allowUnusedLabels: Schema.optionalKey; readonly allowUnreachableCode: Schema.optionalKey; readonly noUncheckedSideEffectImports: Schema.optionalKey; readonly allowJs: Schema.optionalKey; readonly checkJs: Schema.optionalKey; readonly resolveJsonModule: Schema.optionalKey; readonly allowArbitraryExtensions: Schema.optionalKey; readonly allowImportingTsExtensions: Schema.optionalKey; readonly rewriteRelativeImportExtensions: Schema.optionalKey; readonly resolvePackageJsonExports: Schema.optionalKey; readonly resolvePackageJsonImports: Schema.optionalKey; /** @deprecated Deprecated in TypeScript 6.0 when set to `false`. */ readonly allowSyntheticDefaultImports: Schema.optionalKey; /** @deprecated Deprecated in TypeScript 6.0 when set to `false`. */ readonly esModuleInterop: Schema.optionalKey; readonly preserveSymlinks: Schema.optionalKey; readonly allowUmdGlobalAccess: Schema.optionalKey; readonly verbatimModuleSyntax: Schema.optionalKey; readonly isolatedModules: Schema.optionalKey; readonly isolatedDeclarations: Schema.optionalKey; readonly erasableSyntaxOnly: Schema.optionalKey; readonly forceConsistentCasingInFileNames: Schema.optionalKey; readonly declaration: Schema.optionalKey; readonly declarationMap: Schema.optionalKey; readonly emitDeclarationOnly: Schema.optionalKey; readonly sourceMap: Schema.optionalKey; readonly inlineSourceMap: Schema.optionalKey; readonly inlineSources: Schema.optionalKey; readonly removeComments: Schema.optionalKey; readonly importHelpers: Schema.optionalKey; /** @deprecated Deprecated in TypeScript 6.0. */ readonly downlevelIteration: Schema.optionalKey; readonly emitBOM: Schema.optionalKey; readonly noEmit: Schema.optionalKey; readonly noEmitHelpers: Schema.optionalKey; readonly noEmitOnError: Schema.optionalKey; readonly preserveConstEnums: Schema.optionalKey; readonly stripInternal: Schema.optionalKey; readonly experimentalDecorators: Schema.optionalKey; readonly emitDecoratorMetadata: Schema.optionalKey; readonly useDefineForClassFields: Schema.optionalKey; readonly noCheck: Schema.optionalKey; readonly composite: Schema.optionalKey; readonly incremental: Schema.optionalKey; readonly disableSourceOfProjectReferenceRedirect: Schema.optionalKey; readonly disableSolutionSearching: Schema.optionalKey; readonly disableReferencedProjectLoad: Schema.optionalKey; readonly assumeChangesOnlyAffectDirectDependencies: Schema.optionalKey; readonly noErrorTruncation: Schema.optionalKey; readonly noLib: Schema.optionalKey; readonly noResolve: Schema.optionalKey; readonly skipDefaultLibCheck: Schema.optionalKey; readonly skipLibCheck: Schema.optionalKey; readonly diagnostics: Schema.optionalKey; readonly extendedDiagnostics: Schema.optionalKey; readonly listFiles: Schema.optionalKey; readonly listFilesOnly: Schema.optionalKey; readonly listEmittedFiles: Schema.optionalKey; readonly explainFiles: Schema.optionalKey; readonly traceResolution: Schema.optionalKey; readonly preserveWatchOutput: Schema.optionalKey; readonly pretty: Schema.optionalKey; readonly disableSizeLimit: Schema.optionalKey; readonly libReplacement: Schema.optionalKey; readonly stableTypeOrdering: Schema.optionalKey; /** @deprecated Deprecated in TypeScript 6.0. */ readonly outFile: Schema.optionalKey; readonly outDir: Schema.optionalKey; readonly rootDir: Schema.optionalKey; readonly declarationDir: Schema.optionalKey; readonly sourceRoot: Schema.optionalKey; readonly mapRoot: Schema.optionalKey; readonly tsBuildInfoFile: Schema.optionalKey; /** @deprecated Deprecated in TypeScript 6.0. */ readonly baseUrl: Schema.optionalKey; readonly generateCpuProfile: Schema.optionalKey; readonly generateTrace: Schema.optionalKey; readonly typeRoots: Schema.optionalKey>; readonly rootDirs: Schema.optionalKey>; readonly jsxFactory: Schema.optionalKey; readonly jsxFragmentFactory: Schema.optionalKey; readonly jsxImportSource: Schema.optionalKey; readonly reactNamespace: Schema.optionalKey; readonly types: Schema.optionalKey>; readonly customConditions: Schema.optionalKey>; readonly moduleSuffixes: Schema.optionalKey>; readonly paths: Schema.optionalKey>>; readonly plugins: Schema.optionalKey, readonly [Schema.$Record]>>>; readonly maxNodeModuleJsDepth: Schema.optionalKey; }>, readonly [Schema.$Record]>; /** * Type-only companion namespace for {@link (CompilerOptions:variable)}, exposing its * decoded and encoded shapes. * * @public */ declare namespace CompilerOptions { /** * The decoded `compilerOptions` shape: every typed field optional, plus passthrough for unknown keys. * * @public */ type Type = typeof CompilerOptions.Type; /** * The encoded (on-disk JSON) `compilerOptions` shape. * * @public */ type Encoded = typeof CompilerOptions.Encoded; } //#endregion //#region src/JsxConfig.d.ts declare const JsxConfig_base: Schema.Class; /** The automatic runtime's import source (`jsxImportSource`, defaulted to `"react"`); absent for classic. */ readonly importSource: Schema.optionalKey; }>, {}>; /** * The JSX transform configuration a `jsx` compiler option implies: which * runtime (`"automatic"` for `react-jsx` / `react-jsxdev`, `"classic"` for * `react`) and, for the automatic runtime, the import source the transform * emits (`jsxImportSource`, defaulting to `"react"` per tsc). * * @public */ declare class JsxConfig extends JsxConfig_base { /** * Project decoded compiler options to their implied JSX transform * configuration. `"react-jsx"` and `"react-jsxdev"` yield the automatic * runtime with `importSource` taken from `jsxImportSource` (defaulting to * `"react"`, tsc's own default); `"react"` yields the classic runtime with * no `importSource`. `"preserve"`, `"react-native"` and an absent `jsx` * yield `Option.none()` — JSX is left untransformed (or absent entirely), * so there is nothing for a bundler to configure. */ static fromCompilerOptions(options: CompilerOptions.Type): Option.Option; } //#endregion //#region src/TsconfigJson.d.ts /** `watchOptions.watchFile`. @public */ declare const WatchFile: Schema.decodeTo, Schema.String, never, never>; /** `watchOptions.watchDirectory`. @public */ declare const WatchDirectory: Schema.decodeTo, Schema.String, never, never>; /** `watchOptions.fallbackPolling`. @public */ declare const FallbackPolling: Schema.decodeTo, Schema.String, never, never>; /** * One `references[]` entry: `path` is required and non-empty; every other key * is preserved verbatim (per R1.5). * * @public */ declare const Reference: Schema.StructWithRest, readonly [Schema.$Record]>; /** * Type-only companion namespace for {@link (Reference:variable)}. * * @public */ declare namespace Reference { /** * The decoded `references[]` entry shape. * * @public */ type Type = typeof Reference.Type; /** * The encoded (on-disk JSON) `references[]` entry shape. * * @public */ type Encoded = typeof Reference.Encoded; } /** * `watchOptions` — the three enum fields (R1.2), the two live booleans/arrays * (R1.5), and a passthrough record (schemastore's `force` is phantom). * * @public */ declare const WatchOptions: Schema.StructWithRest, Schema.String, never, never>>; readonly watchDirectory: Schema.optionalKey, Schema.String, never, never>>; readonly fallbackPolling: Schema.optionalKey, Schema.String, never, never>>; readonly synchronousWatchDirectory: Schema.optionalKey; readonly excludeDirectories: Schema.optionalKey>; readonly excludeFiles: Schema.optionalKey>; }>, readonly [Schema.$Record]>; /** * Type-only companion namespace for {@link (WatchOptions:variable)}. * * @public */ declare namespace WatchOptions { /** * The decoded `watchOptions` shape. * * @public */ type Type = typeof WatchOptions.Type; /** * The encoded (on-disk JSON) `watchOptions` shape. * * @public */ type Encoded = typeof WatchOptions.Encoded; } /** * `typeAcquisition` — per R1.5. * * @public */ declare const TypeAcquisition: Schema.StructWithRest; readonly include: Schema.optionalKey>; readonly exclude: Schema.optionalKey>; readonly disableFilenameBasedTypeAcquisition: Schema.optionalKey; }>, readonly [Schema.$Record]>; /** * Type-only companion namespace for {@link (TypeAcquisition:variable)}. * * @public */ declare namespace TypeAcquisition { /** * The decoded `typeAcquisition` shape. * * @public */ type Type = typeof TypeAcquisition.Type; /** * The encoded (on-disk JSON) `typeAcquisition` shape. * * @public */ type Encoded = typeof TypeAcquisition.Encoded; } /** * The tsconfig.json document: every typed top-level field (R1.1) optional, * plus a passthrough record so unrecognized keys (`buildOptions`, `ts-node`, * …) survive decode and re-encode untouched — tsc itself silently ignores * unknown top-level keys, and this schema follows suit. * * @public */ declare const TsconfigJson: Schema.StructWithRest, Schema.String, never, never>>; readonly module: Schema.optionalKey, Schema.String, never, never>>; readonly moduleResolution: Schema.optionalKey, Schema.String, never, never>>; readonly jsx: Schema.optionalKey, Schema.String, never, never>>; readonly newLine: Schema.optionalKey, Schema.String, never, never>>; readonly moduleDetection: Schema.optionalKey, Schema.String, never, never>>; readonly lib: Schema.optionalKey, Schema.String, never, never>>>; readonly ignoreDeprecations: Schema.optionalKey>; readonly strict: Schema.optionalKey; readonly noImplicitAny: Schema.optionalKey; readonly strictNullChecks: Schema.optionalKey; readonly strictFunctionTypes: Schema.optionalKey; readonly strictBindCallApply: Schema.optionalKey; readonly strictPropertyInitialization: Schema.optionalKey; readonly strictBuiltinIteratorReturn: Schema.optionalKey; readonly noImplicitThis: Schema.optionalKey; readonly useUnknownInCatchVariables: Schema.optionalKey; readonly alwaysStrict: Schema.optionalKey; readonly noUnusedLocals: Schema.optionalKey; readonly noUnusedParameters: Schema.optionalKey; readonly exactOptionalPropertyTypes: Schema.optionalKey; readonly noImplicitReturns: Schema.optionalKey; readonly noFallthroughCasesInSwitch: Schema.optionalKey; readonly noUncheckedIndexedAccess: Schema.optionalKey; readonly noImplicitOverride: Schema.optionalKey; readonly noPropertyAccessFromIndexSignature: Schema.optionalKey; readonly allowUnusedLabels: Schema.optionalKey; readonly allowUnreachableCode: Schema.optionalKey; readonly noUncheckedSideEffectImports: Schema.optionalKey; readonly allowJs: Schema.optionalKey; readonly checkJs: Schema.optionalKey; readonly resolveJsonModule: Schema.optionalKey; readonly allowArbitraryExtensions: Schema.optionalKey; readonly allowImportingTsExtensions: Schema.optionalKey; readonly rewriteRelativeImportExtensions: Schema.optionalKey; readonly resolvePackageJsonExports: Schema.optionalKey; readonly resolvePackageJsonImports: Schema.optionalKey; readonly allowSyntheticDefaultImports: Schema.optionalKey; readonly esModuleInterop: Schema.optionalKey; readonly preserveSymlinks: Schema.optionalKey; readonly allowUmdGlobalAccess: Schema.optionalKey; readonly verbatimModuleSyntax: Schema.optionalKey; readonly isolatedModules: Schema.optionalKey; readonly isolatedDeclarations: Schema.optionalKey; readonly erasableSyntaxOnly: Schema.optionalKey; readonly forceConsistentCasingInFileNames: Schema.optionalKey; readonly declaration: Schema.optionalKey; readonly declarationMap: Schema.optionalKey; readonly emitDeclarationOnly: Schema.optionalKey; readonly sourceMap: Schema.optionalKey; readonly inlineSourceMap: Schema.optionalKey; readonly inlineSources: Schema.optionalKey; readonly removeComments: Schema.optionalKey; readonly importHelpers: Schema.optionalKey; readonly downlevelIteration: Schema.optionalKey; readonly emitBOM: Schema.optionalKey; readonly noEmit: Schema.optionalKey; readonly noEmitHelpers: Schema.optionalKey; readonly noEmitOnError: Schema.optionalKey; readonly preserveConstEnums: Schema.optionalKey; readonly stripInternal: Schema.optionalKey; readonly experimentalDecorators: Schema.optionalKey; readonly emitDecoratorMetadata: Schema.optionalKey; readonly useDefineForClassFields: Schema.optionalKey; readonly noCheck: Schema.optionalKey; readonly composite: Schema.optionalKey; readonly incremental: Schema.optionalKey; readonly disableSourceOfProjectReferenceRedirect: Schema.optionalKey; readonly disableSolutionSearching: Schema.optionalKey; readonly disableReferencedProjectLoad: Schema.optionalKey; readonly assumeChangesOnlyAffectDirectDependencies: Schema.optionalKey; readonly noErrorTruncation: Schema.optionalKey; readonly noLib: Schema.optionalKey; readonly noResolve: Schema.optionalKey; readonly skipDefaultLibCheck: Schema.optionalKey; readonly skipLibCheck: Schema.optionalKey; readonly diagnostics: Schema.optionalKey; readonly extendedDiagnostics: Schema.optionalKey; readonly listFiles: Schema.optionalKey; readonly listFilesOnly: Schema.optionalKey; readonly listEmittedFiles: Schema.optionalKey; readonly explainFiles: Schema.optionalKey; readonly traceResolution: Schema.optionalKey; readonly preserveWatchOutput: Schema.optionalKey; readonly pretty: Schema.optionalKey; readonly disableSizeLimit: Schema.optionalKey; readonly libReplacement: Schema.optionalKey; readonly stableTypeOrdering: Schema.optionalKey; readonly outFile: Schema.optionalKey; readonly outDir: Schema.optionalKey; readonly rootDir: Schema.optionalKey; readonly declarationDir: Schema.optionalKey; readonly sourceRoot: Schema.optionalKey; readonly mapRoot: Schema.optionalKey; readonly tsBuildInfoFile: Schema.optionalKey; readonly baseUrl: Schema.optionalKey; readonly generateCpuProfile: Schema.optionalKey; readonly generateTrace: Schema.optionalKey; readonly typeRoots: Schema.optionalKey>; readonly rootDirs: Schema.optionalKey>; readonly jsxFactory: Schema.optionalKey; readonly jsxFragmentFactory: Schema.optionalKey; readonly jsxImportSource: Schema.optionalKey; readonly reactNamespace: Schema.optionalKey; readonly types: Schema.optionalKey>; readonly customConditions: Schema.optionalKey>; readonly moduleSuffixes: Schema.optionalKey>; readonly paths: Schema.optionalKey>>; readonly plugins: Schema.optionalKey, readonly [Schema.$Record]>>>; readonly maxNodeModuleJsDepth: Schema.optionalKey; }>, readonly [Schema.$Record]>>; readonly extends: Schema.optionalKey]>>; readonly files: Schema.optionalKey>; readonly include: Schema.optionalKey>; readonly exclude: Schema.optionalKey>; readonly references: Schema.optionalKey, readonly [Schema.$Record]>>>; readonly watchOptions: Schema.optionalKey, Schema.String, never, never>>; readonly watchDirectory: Schema.optionalKey, Schema.String, never, never>>; readonly fallbackPolling: Schema.optionalKey, Schema.String, never, never>>; readonly synchronousWatchDirectory: Schema.optionalKey; readonly excludeDirectories: Schema.optionalKey>; readonly excludeFiles: Schema.optionalKey>; }>, readonly [Schema.$Record]>>; readonly typeAcquisition: Schema.optionalKey; readonly include: Schema.optionalKey>; readonly exclude: Schema.optionalKey>; readonly disableFilenameBasedTypeAcquisition: Schema.optionalKey; }>, readonly [Schema.$Record]>>; readonly compileOnSave: Schema.optionalKey; readonly $schema: Schema.optionalKey; }>, readonly [Schema.$Record]>; /** * Type-only companion namespace for {@link (TsconfigJson:variable)}, exposing its decoded * and encoded shapes plus the JSONC codec. * * @public */ declare namespace TsconfigJson { /** * The decoded tsconfig.json shape: every typed field optional, plus passthrough for unknown keys. * * @public */ type Type = typeof TsconfigJson.Type; /** * The encoded (on-disk JSON) tsconfig.json shape. * * @public */ type Encoded = typeof TsconfigJson.Encoded; } /** * Decodes a JSONC-encoded tsconfig.json document straight into * {@link (TsconfigJson:variable)}. Bound once at module top level — * `Jsonc.schema` is schema-producing, and this is the shared instance (the * house `FromString` idiom, R3.3; `TsconfigJson` is a `Schema.StructWithRest` * value rather than a `Schema.Class`, so the codec is a sibling export, not a * static). * * @public */ declare const TsconfigJsonFromString: Schema.Codec; declare const TsconfigParseError_base: Schema.Class, import("effect/Cause").YieldableError>; /** * Raised when a tsconfig.json document fails to parse or decode. `path` is * the file path when the failure is file-bound, and the empty string * otherwise (e.g. decoding an in-memory string). The loader (Task 8) wraps * file-bound decode failures in this error; this module only declares it. * * @public */ declare class TsconfigParseError extends TsconfigParseError_base { get message(): string; } //#endregion //#region src/ResolvedTsconfig.d.ts /** * The result of resolving a tsconfig.json's full `extends` chain: the merged * compiler options and inherited settings, flattened per R2/E4, with enough * provenance for the consumer (`configPath`, `extendedPaths`, and `pathsBase`, * the directory of the config that declared `paths`). Unknown top-level keys * survive as passthrough via the index signature. * * @public */ interface ResolvedTsconfig { /** The own (most-derived) config's path — the last of {@link (ResolvedTsconfig:interface).extendedPaths}. */ readonly configPath: string; /** The full resolution chain, base-most first and own config last. */ readonly extendedPaths: ReadonlyArray; /** The per-key merged compiler options (derived wins; `paths` replaced wholesale). */ readonly compilerOptions: CompilerOptions.Type; /** The resolved `files`, if any config in the chain declared it. */ readonly files?: ReadonlyArray; /** The resolved `include`, if any config in the chain declared it. */ readonly include?: ReadonlyArray; /** The resolved `exclude`, if any config in the chain declared it. */ readonly exclude?: ReadonlyArray; /** The own config's `references` (never inherited). */ readonly references?: ReadonlyArray; /** The per-key merged `watchOptions`. */ readonly watchOptions?: WatchOptions.Type; /** The own config's `typeAcquisition` (never inherited). */ readonly typeAcquisition?: TypeAcquisition.Type; /** `compileOnSave`, inherited only when own is undefined and the inherited value is truthy. */ readonly compileOnSave?: boolean; /** The directory of the config that declared `paths` (E4), against which `paths` values resolve. */ readonly pathsBase?: string; /** Unknown top-level keys, preserved through the merge (forward tolerance). */ readonly [key: string]: unknown; } /** * The pure extends-merge engine: parse-time path absolutization * ({@link (ResolvedTsconfig:class).absolutize}), the per-field merge fold * ({@link (ResolvedTsconfig:class).merge}), and the `${configDir}` final * phase ({@link (ResolvedTsconfig:class).substituteConfigDir}). * * @public */ declare class ResolvedTsconfig { private constructor(); /** * Absolutize a config's path-typed options (E5) against its own * `configDir`, using the injected `join` (`Path.Path.resolve` at the call * site — so an already-absolute value is preserved). `${configDir}`-prefixed * values are exempt (resolved later, in * {@link (ResolvedTsconfig:class).substituteConfigDir}), and `paths` * VALUES stay verbatim. Only `compilerOptions` path surfaces are touched; * `files`/`include`/`exclude` are re-rooted at merge time instead (E4). */ static readonly absolutize: (doc: TsconfigJson.Type, configDir: string, join: (a: string, b: string) => string) => TsconfigJson.Type; /** * Fold one more-derived config onto the accumulated base (E4), derived * winning. The loader (Task 8) applies this across the resolution chain, * own config last. `derivedPath` is the derived config's absolute * normalized path, from which the re-rooting frame and `pathsBase` are * computed. */ static readonly merge: (base: ResolvedTsconfig, derived: TsconfigJson.Type, derivedPath: string) => ResolvedTsconfig; /** * The E5 final phase: replace a leading `${configDir}` token * (case-insensitive, leading position only) with `finalDir` — the * top-level extending config's directory — across every eligible * surface: compilerOptions path options, `paths` values, * `files`/`include`/`exclude`, and `watchOptions`' * `excludeDirectories`/`excludeFiles`. Every other field is left * untouched. */ static readonly substituteConfigDir: (resolved: ResolvedTsconfig, finalDir: string) => ResolvedTsconfig; } //#endregion //#region src/PortableTsconfig.d.ts /** * A portable, JSON-serializable tsconfig.json (compilerOptions-only), for * virtual TypeScript environments that control their own file paths and emit * settings externally. Carries only knowably-portable options: no absolute or * machine-specific paths, and no emit or file-selection surface. * * @public */ interface PortableTsconfig { /** The tsconfig JSON Schema URL, stamped for IDE support. */ readonly $schema: "https://json.schemastore.org/tsconfig"; /** The allow-listed, forced-flag-applied compiler options. */ readonly compilerOptions: Record; } /** * Options for {@link (PortableTsconfig:class).make}. * * @public */ interface PortableTsconfigOptions { /** * Carry `types` (an array of `@types` package NAMES) onto the portable * shape when the source declares it. Defaults to `false`. * * Opt in when the consuming environment can resolve those packages — it * materializes `@types` into its virtual filesystem, or type-checks against * a real `node_modules`. Leaving it off keeps the permissive default, where * TypeScript auto-includes whatever `@types` the environment happens to * have and never errors on a missing one. * * `typeRoots` is NOT carried under this flag: it names filesystem * directories, which are machine-specific and config-location-dependent, * so they are never portable. */ readonly includeTypes?: boolean; } /** * The portable-tsconfig filter: {@link (PortableTsconfig:class).make} * narrows a resolved or bare compiler-options object to the allow-listed, * machine-independent subset described on {@link (PortableTsconfig:interface)}. * * @public */ declare class PortableTsconfig { private constructor(); /** * Project a {@link (ResolvedTsconfig:interface)} or a bare * `CompilerOptions.Type` down to a {@link (PortableTsconfig:interface)}: * copy only the allow-listed type-semantics options, force * `composite: false` and `noEmit: true` regardless of what the source * declared, and stamp `$schema`. Every other key — including every * unknown passthrough key the source preserved for forward tolerance — * is dropped; this is an allow-list, not a deny-list, so an option this * package does not yet classify never leaks onto the portable shape by * accident. * * `types` is the one deliberate exception, and it is opt-in rather than * unclassified: it is portable (package names, not paths) but carrying it * makes TypeScript demand those packages be resolvable, which a virtual * environment with no `node_modules` cannot satisfy. Pass * {@link PortableTsconfigOptions.includeTypes} when the consumer * materializes `@types`; leave it off for the permissive default. Related * `typeRoots` is never carried — machine-specific, * config-location-dependent directories. * * @param input - The resolved config, or a bare compiler-options bag. * @param options - Opt-ins for options that are portable but * resolution-dependent. Omitted means the strict, always-safe subset. */ static readonly make: (input: ResolvedTsconfig | CompilerOptions.Type, options?: PortableTsconfigOptions) => PortableTsconfig; } //#endregion //#region src/TsconfigDiscovery.d.ts /** * Options for {@link TsconfigDiscovery.findNearest}. * * @public */ interface FindNearestOptions { /** The config file name to search for. Defaults to `"tsconfig.json"`. */ readonly filename?: string; /** Stop ascending after this directory, inclusive. */ readonly stopAt?: string; } /** * Nearest-config upward discovery for `tsconfig.json`. * * @public */ declare class TsconfigDiscovery { private constructor(); /** * Find the nearest `tsconfig.json` (or `options.filename`) at or above * `start`, ascending toward the filesystem root. Absence — nowhere on the * chain, or every candidate unreadable — is `Option.none()`, never an * error; discovery is best-effort per `Walker.findUpward`'s absorption * posture, and a permission-denied probe on one directory does not hide a * config file above it. */ static readonly findNearest: (start: string, options?: FindNearestOptions) => Effect.Effect, never, FileSystem.FileSystem | Path.Path>; } //#endregion //#region src/TsconfigLoader.d.ts declare const TsconfigExtendsError_base: Schema.Class; /** The full resolution chain of normalized absolute config paths. */ readonly chain: Schema.$Array; }>, import("effect/Cause").YieldableError>; /** * Raised when a config's `extends` chain cannot be resolved: an unresolvable * target (`"not-found"`), a re-entrant chain (`"cycle"`), a chain deeper than * `MAX_EXTENDS_DEPTH` (`"depth"`), or an empty target string (`"empty"`). * `path` is the config whose `extends` failed, `target` is what it tried to * extend (the offending spec for `"not-found"`/`"empty"`, the re-entered config * path for `"cycle"`, the refused config for `"depth"`), and `chain` is the full * resolution chain of normalized absolute paths. * * @public */ declare class TsconfigExtendsError extends TsconfigExtendsError_base { get message(): string; } /** * The tsconfig.json loader: {@link TsconfigLoader.load} reads and decodes one * config file, {@link TsconfigLoader.resolve} runs the full load -\> extends -\> * merge -\> `${configDir}` pipeline, and {@link TsconfigLoader.compilerOptions} * projects the resolved result down to its merged `compilerOptions`. * * @public */ declare class TsconfigLoader { private constructor(); /** * Read one config file and decode it through {@link TsconfigJsonFromString}. * A decode failure is wrapped in a {@link TsconfigParseError} carrying the * file's absolute path; a `PlatformError` from the read flows through * untranslated. No `extends` resolution — {@link TsconfigLoader.resolve} * drives that. */ static readonly load: (configPath: string) => Effect.Effect<{ readonly [x: string]: unknown; readonly compilerOptions?: { readonly [x: string]: unknown; readonly target?: "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "es5" | "es6" | "esnext"; readonly module?: "amd" | "commonjs" | "es2015" | "es2020" | "es2022" | "es6" | "esnext" | "node16" | "node18" | "node20" | "nodenext" | "none" | "preserve" | "system" | "umd"; readonly moduleResolution?: "bundler" | "classic" | "node" | "node10" | "node16" | "nodenext"; readonly jsx?: "preserve" | "react" | "react-jsx" | "react-jsxdev" | "react-native"; readonly newLine?: "crlf" | "lf"; readonly moduleDetection?: "auto" | "force" | "legacy"; readonly lib?: readonly ("decorators" | "decorators.legacy" | "dom" | "dom.asynciterable" | "dom.iterable" | "es2015" | "es2015.collection" | "es2015.core" | "es2015.generator" | "es2015.iterable" | "es2015.promise" | "es2015.proxy" | "es2015.reflect" | "es2015.symbol" | "es2015.symbol.wellknown" | "es2016" | "es2016.array.include" | "es2016.intl" | "es2017" | "es2017.arraybuffer" | "es2017.date" | "es2017.intl" | "es2017.object" | "es2017.sharedmemory" | "es2017.string" | "es2017.typedarrays" | "es2018" | "es2018.asyncgenerator" | "es2018.asynciterable" | "es2018.intl" | "es2018.promise" | "es2018.regexp" | "es2019" | "es2019.array" | "es2019.intl" | "es2019.object" | "es2019.string" | "es2019.symbol" | "es2020" | "es2020.bigint" | "es2020.date" | "es2020.intl" | "es2020.number" | "es2020.promise" | "es2020.sharedmemory" | "es2020.string" | "es2020.symbol.wellknown" | "es2021" | "es2021.intl" | "es2021.promise" | "es2021.string" | "es2021.weakref" | "es2022" | "es2022.array" | "es2022.error" | "es2022.intl" | "es2022.object" | "es2022.regexp" | "es2022.string" | "es2023" | "es2023.array" | "es2023.collection" | "es2023.intl" | "es2024" | "es2024.arraybuffer" | "es2024.collection" | "es2024.object" | "es2024.promise" | "es2024.regexp" | "es2024.sharedmemory" | "es2024.string" | "es2025" | "es2025.collection" | "es2025.float16" | "es2025.intl" | "es2025.iterator" | "es2025.promise" | "es2025.regexp" | "es5" | "es6" | "es7" | "esnext" | "esnext.array" | "esnext.asynciterable" | "esnext.bigint" | "esnext.collection" | "esnext.date" | "esnext.decorators" | "esnext.disposable" | "esnext.error" | "esnext.float16" | "esnext.intl" | "esnext.iterator" | "esnext.object" | "esnext.promise" | "esnext.regexp" | "esnext.sharedmemory" | "esnext.string" | "esnext.symbol" | "esnext.temporal" | "esnext.typedarrays" | "esnext.weakref" | "scripthost" | "webworker" | "webworker.asynciterable" | "webworker.importscripts" | "webworker.iterable")[]; readonly ignoreDeprecations?: "5.0" | "6.0"; readonly strict?: boolean; readonly noImplicitAny?: boolean; readonly strictNullChecks?: boolean; readonly strictFunctionTypes?: boolean; readonly strictBindCallApply?: boolean; readonly strictPropertyInitialization?: boolean; readonly strictBuiltinIteratorReturn?: boolean; readonly noImplicitThis?: boolean; readonly useUnknownInCatchVariables?: boolean; readonly alwaysStrict?: boolean; readonly noUnusedLocals?: boolean; readonly noUnusedParameters?: boolean; readonly exactOptionalPropertyTypes?: boolean; readonly noImplicitReturns?: boolean; readonly noFallthroughCasesInSwitch?: boolean; readonly noUncheckedIndexedAccess?: boolean; readonly noImplicitOverride?: boolean; readonly noPropertyAccessFromIndexSignature?: boolean; readonly allowUnusedLabels?: boolean; readonly allowUnreachableCode?: boolean; readonly noUncheckedSideEffectImports?: boolean; readonly allowJs?: boolean; readonly checkJs?: boolean; readonly resolveJsonModule?: boolean; readonly allowArbitraryExtensions?: boolean; readonly allowImportingTsExtensions?: boolean; readonly rewriteRelativeImportExtensions?: boolean; readonly resolvePackageJsonExports?: boolean; readonly resolvePackageJsonImports?: boolean; readonly allowSyntheticDefaultImports?: boolean; readonly esModuleInterop?: boolean; readonly preserveSymlinks?: boolean; readonly allowUmdGlobalAccess?: boolean; readonly verbatimModuleSyntax?: boolean; readonly isolatedModules?: boolean; readonly isolatedDeclarations?: boolean; readonly erasableSyntaxOnly?: boolean; readonly forceConsistentCasingInFileNames?: boolean; readonly declaration?: boolean; readonly declarationMap?: boolean; readonly emitDeclarationOnly?: boolean; readonly sourceMap?: boolean; readonly inlineSourceMap?: boolean; readonly inlineSources?: boolean; readonly removeComments?: boolean; readonly importHelpers?: boolean; readonly downlevelIteration?: boolean; readonly emitBOM?: boolean; readonly noEmit?: boolean; readonly noEmitHelpers?: boolean; readonly noEmitOnError?: boolean; readonly preserveConstEnums?: boolean; readonly stripInternal?: boolean; readonly experimentalDecorators?: boolean; readonly emitDecoratorMetadata?: boolean; readonly useDefineForClassFields?: boolean; readonly noCheck?: boolean; readonly composite?: boolean; readonly incremental?: boolean; readonly disableSourceOfProjectReferenceRedirect?: boolean; readonly disableSolutionSearching?: boolean; readonly disableReferencedProjectLoad?: boolean; readonly assumeChangesOnlyAffectDirectDependencies?: boolean; readonly noErrorTruncation?: boolean; readonly noLib?: boolean; readonly noResolve?: boolean; readonly skipDefaultLibCheck?: boolean; readonly skipLibCheck?: boolean; readonly diagnostics?: boolean; readonly extendedDiagnostics?: boolean; readonly listFiles?: boolean; readonly listFilesOnly?: boolean; readonly listEmittedFiles?: boolean; readonly explainFiles?: boolean; readonly traceResolution?: boolean; readonly preserveWatchOutput?: boolean; readonly pretty?: boolean; readonly disableSizeLimit?: boolean; readonly libReplacement?: boolean; readonly stableTypeOrdering?: boolean; readonly outFile?: string; readonly outDir?: string; readonly rootDir?: string; readonly declarationDir?: string; readonly sourceRoot?: string; readonly mapRoot?: string; readonly tsBuildInfoFile?: string; readonly baseUrl?: string; readonly generateCpuProfile?: string; readonly generateTrace?: string; readonly typeRoots?: readonly string[]; readonly rootDirs?: readonly string[]; readonly jsxFactory?: string; readonly jsxFragmentFactory?: string; readonly jsxImportSource?: string; readonly reactNamespace?: string; readonly types?: readonly string[]; readonly customConditions?: readonly string[]; readonly moduleSuffixes?: readonly string[]; readonly paths?: { readonly [x: string]: readonly string[]; }; readonly plugins?: readonly { readonly [x: string]: unknown; readonly name: string; }[]; readonly maxNodeModuleJsDepth?: number; }; readonly extends?: string | readonly string[]; readonly files?: readonly string[]; readonly include?: readonly string[]; readonly exclude?: readonly string[]; readonly references?: readonly { readonly [x: string]: unknown; readonly path: string; }[]; readonly watchOptions?: { readonly [x: string]: unknown; readonly watchFile?: "dynamicprioritypolling" | "fixedchunksizepolling" | "fixedpollinginterval" | "prioritypollinginterval" | "usefsevents" | "usefseventsonparentdirectory"; readonly watchDirectory?: "dynamicprioritypolling" | "fixedchunksizepolling" | "fixedpollinginterval" | "usefsevents"; readonly fallbackPolling?: "dynamicpriority" | "fixedchunksize" | "fixedinterval" | "priorityinterval"; readonly synchronousWatchDirectory?: boolean; readonly excludeDirectories?: readonly string[]; readonly excludeFiles?: readonly string[]; }; readonly typeAcquisition?: { readonly [x: string]: unknown; readonly enable?: boolean; readonly include?: readonly string[]; readonly exclude?: readonly string[]; readonly disableFilenameBasedTypeAcquisition?: boolean; }; readonly compileOnSave?: boolean; readonly $schema?: string; }, PlatformError.PlatformError | TsconfigParseError, FileSystem.FileSystem | Path.Path>; /** * Resolve a tsconfig.json and its full `extends` chain into a * {@link (ResolvedTsconfig:interface)}: load and decode each config, * absolutize its path options (E5), resolve `extends` depth-first with * per-branch cycle and depth guards (E1-E3, E6), fold the chain * own-config-last (E4), then substitute a leading `${configDir}` once * against the top config's directory (E5 final phase). `configPath` + * `extendedPaths` come back base-most first, own config last. Every * failure is a typed error — `TsconfigParseError` (a malformed file, * carrying that file's path), `TsconfigExtendsError` (a broken chain), or * a `PlatformError` from IO — never a defect. */ static readonly resolve: (configPath: string) => Effect.Effect; /** * Resolve a tsconfig.json's full `extends` chain and project out the * merged `compilerOptions` — a thin projection of * {@link TsconfigLoader.resolve} for the common "just give me the * effective options" query. Same pipeline, same typed failures. */ static readonly compilerOptions: (configPath: string) => Effect.Effect<{ readonly [x: string]: unknown; readonly target?: "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "es5" | "es6" | "esnext"; readonly module?: "amd" | "commonjs" | "es2015" | "es2020" | "es2022" | "es6" | "esnext" | "node16" | "node18" | "node20" | "nodenext" | "none" | "preserve" | "system" | "umd"; readonly moduleResolution?: "bundler" | "classic" | "node" | "node10" | "node16" | "nodenext"; readonly jsx?: "preserve" | "react" | "react-jsx" | "react-jsxdev" | "react-native"; readonly newLine?: "crlf" | "lf"; readonly moduleDetection?: "auto" | "force" | "legacy"; readonly lib?: readonly ("decorators" | "decorators.legacy" | "dom" | "dom.asynciterable" | "dom.iterable" | "es2015" | "es2015.collection" | "es2015.core" | "es2015.generator" | "es2015.iterable" | "es2015.promise" | "es2015.proxy" | "es2015.reflect" | "es2015.symbol" | "es2015.symbol.wellknown" | "es2016" | "es2016.array.include" | "es2016.intl" | "es2017" | "es2017.arraybuffer" | "es2017.date" | "es2017.intl" | "es2017.object" | "es2017.sharedmemory" | "es2017.string" | "es2017.typedarrays" | "es2018" | "es2018.asyncgenerator" | "es2018.asynciterable" | "es2018.intl" | "es2018.promise" | "es2018.regexp" | "es2019" | "es2019.array" | "es2019.intl" | "es2019.object" | "es2019.string" | "es2019.symbol" | "es2020" | "es2020.bigint" | "es2020.date" | "es2020.intl" | "es2020.number" | "es2020.promise" | "es2020.sharedmemory" | "es2020.string" | "es2020.symbol.wellknown" | "es2021" | "es2021.intl" | "es2021.promise" | "es2021.string" | "es2021.weakref" | "es2022" | "es2022.array" | "es2022.error" | "es2022.intl" | "es2022.object" | "es2022.regexp" | "es2022.string" | "es2023" | "es2023.array" | "es2023.collection" | "es2023.intl" | "es2024" | "es2024.arraybuffer" | "es2024.collection" | "es2024.object" | "es2024.promise" | "es2024.regexp" | "es2024.sharedmemory" | "es2024.string" | "es2025" | "es2025.collection" | "es2025.float16" | "es2025.intl" | "es2025.iterator" | "es2025.promise" | "es2025.regexp" | "es5" | "es6" | "es7" | "esnext" | "esnext.array" | "esnext.asynciterable" | "esnext.bigint" | "esnext.collection" | "esnext.date" | "esnext.decorators" | "esnext.disposable" | "esnext.error" | "esnext.float16" | "esnext.intl" | "esnext.iterator" | "esnext.object" | "esnext.promise" | "esnext.regexp" | "esnext.sharedmemory" | "esnext.string" | "esnext.symbol" | "esnext.temporal" | "esnext.typedarrays" | "esnext.weakref" | "scripthost" | "webworker" | "webworker.asynciterable" | "webworker.importscripts" | "webworker.iterable")[]; readonly ignoreDeprecations?: "5.0" | "6.0"; readonly strict?: boolean; readonly noImplicitAny?: boolean; readonly strictNullChecks?: boolean; readonly strictFunctionTypes?: boolean; readonly strictBindCallApply?: boolean; readonly strictPropertyInitialization?: boolean; readonly strictBuiltinIteratorReturn?: boolean; readonly noImplicitThis?: boolean; readonly useUnknownInCatchVariables?: boolean; readonly alwaysStrict?: boolean; readonly noUnusedLocals?: boolean; readonly noUnusedParameters?: boolean; readonly exactOptionalPropertyTypes?: boolean; readonly noImplicitReturns?: boolean; readonly noFallthroughCasesInSwitch?: boolean; readonly noUncheckedIndexedAccess?: boolean; readonly noImplicitOverride?: boolean; readonly noPropertyAccessFromIndexSignature?: boolean; readonly allowUnusedLabels?: boolean; readonly allowUnreachableCode?: boolean; readonly noUncheckedSideEffectImports?: boolean; readonly allowJs?: boolean; readonly checkJs?: boolean; readonly resolveJsonModule?: boolean; readonly allowArbitraryExtensions?: boolean; readonly allowImportingTsExtensions?: boolean; readonly rewriteRelativeImportExtensions?: boolean; readonly resolvePackageJsonExports?: boolean; readonly resolvePackageJsonImports?: boolean; readonly allowSyntheticDefaultImports?: boolean; readonly esModuleInterop?: boolean; readonly preserveSymlinks?: boolean; readonly allowUmdGlobalAccess?: boolean; readonly verbatimModuleSyntax?: boolean; readonly isolatedModules?: boolean; readonly isolatedDeclarations?: boolean; readonly erasableSyntaxOnly?: boolean; readonly forceConsistentCasingInFileNames?: boolean; readonly declaration?: boolean; readonly declarationMap?: boolean; readonly emitDeclarationOnly?: boolean; readonly sourceMap?: boolean; readonly inlineSourceMap?: boolean; readonly inlineSources?: boolean; readonly removeComments?: boolean; readonly importHelpers?: boolean; readonly downlevelIteration?: boolean; readonly emitBOM?: boolean; readonly noEmit?: boolean; readonly noEmitHelpers?: boolean; readonly noEmitOnError?: boolean; readonly preserveConstEnums?: boolean; readonly stripInternal?: boolean; readonly experimentalDecorators?: boolean; readonly emitDecoratorMetadata?: boolean; readonly useDefineForClassFields?: boolean; readonly noCheck?: boolean; readonly composite?: boolean; readonly incremental?: boolean; readonly disableSourceOfProjectReferenceRedirect?: boolean; readonly disableSolutionSearching?: boolean; readonly disableReferencedProjectLoad?: boolean; readonly assumeChangesOnlyAffectDirectDependencies?: boolean; readonly noErrorTruncation?: boolean; readonly noLib?: boolean; readonly noResolve?: boolean; readonly skipDefaultLibCheck?: boolean; readonly skipLibCheck?: boolean; readonly diagnostics?: boolean; readonly extendedDiagnostics?: boolean; readonly listFiles?: boolean; readonly listFilesOnly?: boolean; readonly listEmittedFiles?: boolean; readonly explainFiles?: boolean; readonly traceResolution?: boolean; readonly preserveWatchOutput?: boolean; readonly pretty?: boolean; readonly disableSizeLimit?: boolean; readonly libReplacement?: boolean; readonly stableTypeOrdering?: boolean; readonly outFile?: string; readonly outDir?: string; readonly rootDir?: string; readonly declarationDir?: string; readonly sourceRoot?: string; readonly mapRoot?: string; readonly tsBuildInfoFile?: string; readonly baseUrl?: string; readonly generateCpuProfile?: string; readonly generateTrace?: string; readonly typeRoots?: readonly string[]; readonly rootDirs?: readonly string[]; readonly jsxFactory?: string; readonly jsxFragmentFactory?: string; readonly jsxImportSource?: string; readonly reactNamespace?: string; readonly types?: readonly string[]; readonly customConditions?: readonly string[]; readonly moduleSuffixes?: readonly string[]; readonly paths?: { readonly [x: string]: readonly string[]; }; readonly plugins?: readonly { readonly [x: string]: unknown; readonly name: string; }[]; readonly maxNodeModuleJsDepth?: number; }, PlatformError.PlatformError | TsconfigExtendsError | TsconfigParseError, FileSystem.FileSystem | Path.Path>; } //#endregion //#region src/TsconfigLoaderSync.d.ts /** * The synchronous file operations {@link TsconfigLoaderSync} needs, supplied * by the consumer. Node's built-ins satisfy it directly: * * ```ts * import { existsSync, readFileSync } from "node:fs"; * * const fileSystem: SyncFileSystem = { * exists: existsSync, * readFile: (p) => readFileSync(p, "utf8"), * }; * ``` * * `readFile` returns the file's text and may throw on failure (a missing * file, a permission error); the throw is wrapped in a `PlatformError` and * rethrown through the loader's typed channel. * * @public */ interface SyncFileSystem { /** Whether a file exists at `path`. Directory hits follow the loader's documented file-only contract. */ readonly exists: (path: string) => boolean; /** Read the file at `path` as text. May throw; the throw surfaces as a `PlatformError`. */ readonly readFile: (path: string) => string; } /** * The synchronous path operations {@link TsconfigLoaderSync} needs, supplied * by the consumer. Deliberately a structural subset of `node:path`, so the * built-in module (and its `win32` / `posix` variants, or a Bun / Deno * equivalent) satisfies it verbatim: * * ```ts * import * as path from "node:path"; * * const options: TsconfigLoaderSyncOptions = { * fileSystem: { exists: existsSync, readFile: (p) => readFileSync(p, "utf8") }, * path, // node:path IS a SyncPath * }; * ``` * * The loader passes these through untouched — Windows correctness comes from * supplying a win32-appropriate implementation, not from anything here. * * @public */ interface SyncPath { /** Resolve segments to an absolute path (rightmost-wins, like `path.resolve`). */ readonly resolve: (...segments: ReadonlyArray) => string; /** The directory portion of `p` (like `path.dirname`). */ readonly dirname: (p: string) => string; /** Join segments with the implementation's separator (like `path.join`). */ readonly join: (...segments: ReadonlyArray) => string; /** Whether `p` is absolute under this implementation's convention. */ readonly isAbsolute: (p: string) => boolean; /** The final segment of `p` (like `path.basename`). */ readonly basename: (p: string) => string; } /** * The consumer-supplied operations backing one {@link TsconfigLoaderSync} * call: the file operations and the path implementation. Both are required — * this package never imports `node:*` and never assumes posix, so the * platform binding is entirely the caller's. * * @public */ interface TsconfigLoaderSyncOptions { /** The synchronous file operations (Node: `existsSync` / `readFileSync`). */ readonly fileSystem: SyncFileSystem; /** The synchronous path implementation (Node: the `node:path` module itself). */ readonly path: SyncPath; } /** * The synchronous tsconfig.json loader facade: the {@link TsconfigLoader} * pipeline run under `Effect.runSyncExit` against consumer-supplied * {@link SyncFileSystem} and {@link SyncPath} operations. For sync-only host * APIs (bundler plugin hooks, config factories); everything else should use * {@link TsconfigLoader} with real platform layers. * * @remarks * The two adapters treat unsupported members asymmetrically: a `Path` member * the loader pipeline never calls throws a named defect on contact, while a * `FileSystem` member outside the two overridden here (`exists`, * `readFileString`) inherits `FileSystem.makeNoop`'s typed `NotFound` * failure. A loader change that starts using a new filesystem operation * therefore surfaces as a `NotFound` rather than a defect — extend the * adapter when that happens. * * ```ts * import { existsSync, readFileSync } from "node:fs"; * import * as path from "node:path"; * import { TsconfigLoaderSync } from "@effected/tsconfig-json"; * * const resolved = TsconfigLoaderSync.resolve("./tsconfig.json", { * fileSystem: { exists: existsSync, readFile: (p) => readFileSync(p, "utf8") }, * path, * }); * ``` * * @public */ declare class TsconfigLoaderSync { private constructor(); /** * {@link TsconfigLoader.load}, synchronously: read and decode one config * file through the consumer-supplied operations. Throws * `TsconfigParseError` or a `PlatformError` — the async pipeline's exact * typed failures. */ static readonly load: (configPath: string, options: TsconfigLoaderSyncOptions) => TsconfigJson.Type; /** * {@link TsconfigLoader.resolve}, synchronously: the full load -\> * extends -\> merge -\> `${configDir}` pipeline through the * consumer-supplied operations. Throws `TsconfigParseError`, * `TsconfigExtendsError` or a `PlatformError` — the async pipeline's exact * typed failures. */ static readonly resolve: (configPath: string, options: TsconfigLoaderSyncOptions) => ResolvedTsconfig; /** * {@link TsconfigLoader.compilerOptions}, synchronously: resolve the full * `extends` chain and project out the merged `compilerOptions`. Throws * the same typed failures as {@link TsconfigLoaderSync.resolve}. */ static readonly compilerOptions: (configPath: string, options: TsconfigLoaderSyncOptions) => CompilerOptions.Type; } //#endregion //#region src/TsEnumCodec.d.ts /** * The nine `compilerOptions` / `watchOptions` enum families this codec knows, * per R1.6. * * @public */ type EnumFamily = "target" | "module" | "moduleResolution" | "jsx" | "newLine" | "moduleDetection" | "watchFile" | "watchDirectory" | "fallbackPolling"; /** * A single value a programmatic `compilerOptions` entry can hold — a * structural transcription of TypeScript's own `CompilerOptionsValue`, * transcribed (not imported) to honor this package's zero-`typescript` rule. * * Transcribed verbatim from `typescript@6.0.3`'s * `node_modules/typescript/lib/typescript.d.ts` (the version `@typescript/vfs@1.6.4`, * the encode target's consumer, pins): * * ```ts * type CompilerOptionsValue = string | number | boolean | (string | number)[] * | string[] | MapLike | PluginImport[] | ProjectReference[] * | null | undefined; * interface MapLike { [index: string]: T } * interface PluginImport { name: string } * interface ProjectReference { path: string; originalPath?: string; prepend?: boolean; circular?: boolean } * ``` * * The one member deliberately omitted is `TsConfigSourceFile` (present only in * the interface's index signature, not `CompilerOptionsValue` itself): it is a * full parsed-AST node the compiler synthesizes, never a value reachable from * JSON, so it cannot appear in options this codec builds. Omitting it keeps the * union a strict structural subset of the compiler's own index-signature value * type, which is what assignability to `ts.CompilerOptions` requires. Arrays * are intentionally mutable (`string[]`, not `readonly string[]`): TypeScript's * mutable array members are not assignable from a `readonly` array, and the one * narrowing below reconciles this with the codec's actual `readonly`-array * outputs. * * @public */ type ProgrammaticCompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | { readonly [index: string]: string[]; } | { readonly name: string; }[] | { readonly path: string; readonly originalPath?: string; readonly prepend?: boolean; readonly circular?: boolean; }[] | null | undefined; /** * The shape {@link TsEnumCodec.encodeCompilerOptions} returns: the * numeric-enum-encoded `compilerOptions` a virtual-TS environment and the * TypeScript compiler API consume programmatically. * * It is deliberately shaped to be assignable to TypeScript's `ts.CompilerOptions` * without naming it (the zero-`typescript` rule), so a consumer handing the * result to `@typescript/vfs`'s `createVirtualTypeScriptEnvironment` / * `createDefaultMapFromNodeModules` or to `ts.createProgram` no longer ends the * pipeline with a cast. Verified assignable to the real `ts.CompilerOptions` * (`typescript@6.0.3`, `@typescript/vfs@1.6.4`) by a compile-time test * (`__test__/TsEnumCodec.assignability.test.ts`). * * What it honestly **claims**: the six enum-family keys read back as `number` * (they are always encoded — a decoded `CompilerOptions.Type` constrains each * to a spelling the codec's tables cover, so the runtime "unknown string passes * through unencoded" branch is unreachable for a well-typed input); `lib` reads * back as `string[]` (the file-name form); every other value is one of the * structural forms `ts.CompilerOptions` accepts. * * What it does **not** prove: that an arbitrary passthrough value carried * through from JSONC (the schema preserves unknown keys as `unknown`) fits * {@link ProgrammaticCompilerOptionsValue}. Neither does `ts.CompilerOptions`: * its own index signature makes the identical unproven claim, and any consumer * feeding parsed tsconfig to `ts.createProgram` relies on it. The single * narrowing that bridges the codec's `unknown`/`readonly` outputs to this type * lives once, at `encodeCompilerOptions`'s return (below), so the assertion is * owned here rather than re-made at every call site. * * @public */ interface ProgrammaticCompilerOptions { readonly [option: string]: ProgrammaticCompilerOptionsValue; readonly target?: number; readonly module?: number; readonly moduleResolution?: number; readonly jsx?: number; readonly newLine?: number; readonly moduleDetection?: number; readonly lib?: string[]; } /** * The string↔numeric enum codec for `compilerOptions` / `watchOptions` * families, per R1.6. Plain data: every lookup is a synchronous map read * returning `Option.Option`, never a thrown error. * * @public */ declare class TsEnumCodec { private constructor(); /** * Encodes a family's canonical (or alias) string spelling to its numeric * form. `Option.none()` for a string with no table entry — never guessed. */ static readonly encode: (family: EnumFamily, value: string) => Option.Option; /** * Decodes a family's numeric value to its canonical string spelling. * `Option.none()` for a numeric value with no table entry (a future TS * enum member) — never guessed. */ static readonly decode: (family: EnumFamily, value: number) => Option.Option; /** * Normalizes any spelling of a `lib` reference — the plain short name * (`esnext`), the on-disk file name (`lib.esnext.d.ts`), or an absolute * path to one (`/…/typescript/lib/lib.dom.iterable.d.ts`) — to the * canonical lowercase short name (`esnext`, `dom.iterable`). Strips a * leading directory, the `lib.` prefix and the `.d.ts` suffix; idempotent * on an already-short name. */ static readonly normalizeLibReference: (lib: string) => string; /** * Encodes a decoded `compilerOptions` object into the * numeric-enum-shaped {@link ProgrammaticCompilerOptions} form * `ts.CompilerOptions` (and `@typescript/vfs`'s `TsEnvironment`) expect: * every R1.6 enum family becomes its numeric value, and `lib` entries * become the file-name form (`lib.esnext.d.ts`) — see the module banner * for the evidence. Every other key (booleans, strings, arrays, unknown * passthrough keys) is copied through untouched. * * @remarks * The return carries this package's single narrowing from the codec's * internal `Record` (whose values include the schema's * `unknown` passthrough and its `readonly` arrays) to * {@link ProgrammaticCompilerOptions} — see that type's docs for why the * package owns this one assertion instead of leaving every consumer to * cast. Runtime behavior is unchanged; only the declared return type * narrows. */ static readonly encodeCompilerOptions: (options: CompilerOptions.Type) => ProgrammaticCompilerOptions; /** * Decodes a numeric-enum-shaped `compilerOptions` object (as produced by * {@link TsEnumCodec.encodeCompilerOptions} or read off a live * `ts.CompilerOptions`) back into the string-enum shape this package's * schemas use: every R1.6 enum family becomes its canonical string, and * `lib` entries become the short form. A numeric value with no table * entry — a future TS enum member — is left as-is (passthrough, never an * error) — which is why the return type stays the wider * `Record` rather than * {@link (CompilerOptions:namespace).Type}: an unmappable passthrough * value would violate that narrower type's contract. Every other key is * copied through untouched. */ static readonly decodeCompilerOptions: (numeric: Readonly>) => Record; } //#endregion export { CompilerOptions, type EnumFamily, FallbackPolling, type FindNearestOptions, Jsx, JsxConfig, Lib, Module, ModuleDetection, ModuleResolution, NewLine, PortableTsconfig, type PortableTsconfigOptions, type ProgrammaticCompilerOptions, type ProgrammaticCompilerOptionsValue, Reference, ResolvedTsconfig, type SyncFileSystem, type SyncPath, Target, TsEnumCodec, TsconfigDiscovery, TsconfigExtendsError, TsconfigJson, TsconfigJsonFromString, TsconfigLoader, TsconfigLoaderSync, type TsconfigLoaderSyncOptions, TsconfigParseError, TypeAcquisition, WatchDirectory, WatchFile, WatchOptions }; //# sourceMappingURL=index.d.ts.map