@tsdoctor/vfs 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +25 -25
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -22,7 +22,7 @@ import { PathLike } from "node:fs";
22
22
  *
23
23
  * @public
24
24
  */
25
- declare const TypeResolutionCompilerOptions: Schema.Struct<{
25
+ export declare const TypeResolutionCompilerOptions: Schema.Struct<{
26
26
  readonly target: Schema.optionalKey<Schema.decodeTo<Schema.Literals<readonly ["es5", "es6", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2021", "es2022", "es2023", "es2024", "es2025", "esnext"]>, Schema.String, never, never>>;
27
27
  readonly module: Schema.optionalKey<Schema.decodeTo<Schema.Literals<readonly ["none", "commonjs", "amd", "umd", "system", "es6", "es2015", "es2020", "es2022", "esnext", "node16", "node18", "node20", "nodenext", "preserve"]>, Schema.String, never, never>>;
28
28
  readonly moduleResolution: Schema.optionalKey<Schema.decodeTo<Schema.Literals<readonly ["node10", "node", "classic", "node16", "nodenext", "bundler"]>, Schema.String, never, never>>;
@@ -40,7 +40,7 @@ declare const TypeResolutionCompilerOptions: Schema.Struct<{
40
40
  *
41
41
  * @public
42
42
  */
43
- type TypeResolutionCompilerOptions = typeof TypeResolutionCompilerOptions.Type;
43
+ export type TypeResolutionCompilerOptions = typeof TypeResolutionCompilerOptions.Type;
44
44
  /**
45
45
  * Decode compiler options written in either spelling into the whitelist.
46
46
  *
@@ -60,7 +60,7 @@ type TypeResolutionCompilerOptions = typeof TypeResolutionCompilerOptions.Type;
60
60
  *
61
61
  * @public
62
62
  */
63
- declare const decodeCompilerOptions: (input: unknown) => Result.Result<TypeResolutionCompilerOptions, Schema.SchemaError>;
63
+ export declare const decodeCompilerOptions: (input: unknown) => Result.Result<TypeResolutionCompilerOptions, Schema.SchemaError>;
64
64
  /**
65
65
  * Convert whitelisted options to the numeric-enum form the TypeScript compiler
66
66
  * takes.
@@ -78,7 +78,7 @@ declare const decodeCompilerOptions: (input: unknown) => Result.Result<TypeResol
78
78
  *
79
79
  * @public
80
80
  */
81
- declare const toProgrammaticCompilerOptions: (options: TypeResolutionCompilerOptions) => ProgrammaticCompilerOptions;
81
+ export declare const toProgrammaticCompilerOptions: (options: TypeResolutionCompilerOptions) => ProgrammaticCompilerOptions;
82
82
  //#endregion
83
83
  //#region src/TsconfigParser.d.ts
84
84
  /**
@@ -95,7 +95,7 @@ declare const toProgrammaticCompilerOptions: (options: TypeResolutionCompilerOpt
95
95
  *
96
96
  * @public
97
97
  */
98
- declare class TsConfigParseError extends Error {
98
+ export declare class TsConfigParseError extends Error {
99
99
  readonly configPath: string;
100
100
  readonly cause?: unknown | undefined;
101
101
  constructor(configPath: string, message: string, cause?: unknown | undefined);
@@ -117,7 +117,7 @@ declare class TsConfigParseError extends Error {
117
117
  *
118
118
  * @public
119
119
  */
120
- declare function parseTsConfig(configPath: string, projectRoot: string): TypeResolutionCompilerOptions;
120
+ export declare function parseTsConfig(configPath: string, projectRoot: string): TypeResolutionCompilerOptions;
121
121
  //#endregion
122
122
  //#region src/Vfs.d.ts
123
123
  /**
@@ -149,14 +149,14 @@ type Vfs = Map<string, string>;
149
149
  *
150
150
  * @public
151
151
  */
152
- declare const mergeVfs: (...maps: ReadonlyArray<ReadonlyMap<string, string>>) => Vfs;
152
+ export declare const mergeVfs: (...maps: ReadonlyArray<ReadonlyMap<string, string>>) => Vfs;
153
153
  /**
154
154
  * Prefix every path in `entries` with `node_modules/<name>/`, normalizing
155
155
  * away leading slashes.
156
156
  *
157
157
  * @public
158
158
  */
159
- declare const prefixVfs: (name: string, entries: ReadonlyMap<string, string>) => Vfs;
159
+ export declare const prefixVfs: (name: string, entries: ReadonlyMap<string, string>) => Vfs;
160
160
  /**
161
161
  * Whether a path names a TypeScript declaration file.
162
162
  *
@@ -170,7 +170,7 @@ declare const prefixVfs: (name: string, entries: ReadonlyMap<string, string>) =>
170
170
  *
171
171
  * @public
172
172
  */
173
- declare const isTypeDefinition: (filePath: string) => boolean;
173
+ export declare const isTypeDefinition: (filePath: string) => boolean;
174
174
  //#endregion
175
175
  //#region src/TsEnvironment.d.ts
176
176
  declare const TsEnvironmentError_base: Schema.Class<TsEnvironmentError, Schema.TaggedStruct<"TsEnvironmentError", {
@@ -184,7 +184,7 @@ declare const TsEnvironmentError_base: Schema.Class<TsEnvironmentError, Schema.T
184
184
  *
185
185
  * @public
186
186
  */
187
- declare class TsEnvironmentError extends TsEnvironmentError_base {
187
+ export declare class TsEnvironmentError extends TsEnvironmentError_base {
188
188
  get message(): string;
189
189
  }
190
190
  /**
@@ -247,7 +247,7 @@ interface TsEnvironmentOptions {
247
247
  *
248
248
  * @public
249
249
  */
250
- declare class TsEnvironment {
250
+ export declare class TsEnvironment {
251
251
  private constructor();
252
252
  /** Build a `VirtualTypeScriptEnvironment` over a {@link Vfs}. */
253
253
  static make(options: TsEnvironmentOptions): Effect.Effect<VirtualTypeScriptEnvironment, TsEnvironmentError>;
@@ -314,7 +314,7 @@ declare class TsEnvironment {
314
314
  *
315
315
  * @public
316
316
  */
317
- declare const TWOSLASH_CACHE_FORMAT = 1;
317
+ export declare const TWOSLASH_CACHE_FORMAT = 1;
318
318
  /**
319
319
  * The subset of a Twoslash run that Shiki consumes, and all this cache stores.
320
320
  *
@@ -369,7 +369,7 @@ interface TwoslashResultCache extends TwoslashTypesCache {
369
369
  *
370
370
  * @public
371
371
  */
372
- declare function twoslashEnvHash(vfs: ReadonlyMap<string, string>, toolchain: string): string;
372
+ export declare function twoslashEnvHash(vfs: ReadonlyMap<string, string>, toolchain: string): string;
373
373
  /**
374
374
  * Per-entry key: the code, its language, and the compiler configuration it is
375
375
  * checked under.
@@ -380,25 +380,25 @@ declare function twoslashEnvHash(vfs: ReadonlyMap<string, string>, toolchain: st
380
380
  *
381
381
  * @public
382
382
  */
383
- declare function twoslashEntryKey(code: string, lang: string | undefined, compilerOptions?: unknown): string;
383
+ export declare function twoslashEntryKey(code: string, lang: string | undefined, compilerOptions?: unknown): string;
384
384
  /**
385
385
  * The cache key a whole generation is stored under. One blob per environment,
386
386
  * so a changed environment reads as a miss rather than serving stale results.
387
387
  *
388
388
  * @public
389
389
  */
390
- declare function twoslashBlobKey(envHash: string): string;
390
+ export declare function twoslashBlobKey(envHash: string): string;
391
391
  /**
392
392
  * Build a synchronous Twoslash cache over an in-memory map, optionally seeded
393
393
  * with entries loaded from a previous build.
394
394
  *
395
395
  * @public
396
396
  */
397
- declare function makeTwoslashCache(initial?: ReadonlyMap<string, TwoslashCacheValue>): TwoslashResultCache;
397
+ export declare function makeTwoslashCache(initial?: ReadonlyMap<string, TwoslashCacheValue>): TwoslashResultCache;
398
398
  /** Serialize a generation for storage. Gzipped JSON — hover text compresses well. *
399
399
  * @public
400
400
  */
401
- declare function encodeTwoslashCache(entries: ReadonlyMap<string, TwoslashCacheValue>): Uint8Array;
401
+ export declare function encodeTwoslashCache(entries: ReadonlyMap<string, TwoslashCacheValue>): Uint8Array;
402
402
  /**
403
403
  * Deserialize a stored generation.
404
404
  *
@@ -408,7 +408,7 @@ declare function encodeTwoslashCache(entries: ReadonlyMap<string, TwoslashCacheV
408
408
  *
409
409
  * @public
410
410
  */
411
- declare function decodeTwoslashCache(blob: Uint8Array): Map<string, TwoslashCacheValue>;
411
+ export declare function decodeTwoslashCache(blob: Uint8Array): Map<string, TwoslashCacheValue>;
412
412
  //#endregion
413
413
  //#region src/TypeScriptConfig.d.ts
414
414
  /**
@@ -467,7 +467,7 @@ type CompilerOptionsInput = Readonly<Record<string, unknown>>;
467
467
  *
468
468
  * @public
469
469
  */
470
- declare const DEFAULT_COMPILER_OPTIONS: TypeResolutionCompilerOptions;
470
+ export declare const DEFAULT_COMPILER_OPTIONS: TypeResolutionCompilerOptions;
471
471
  /**
472
472
  * Merge one set of compiler options over another, later winning per key.
473
473
  *
@@ -482,7 +482,7 @@ declare const DEFAULT_COMPILER_OPTIONS: TypeResolutionCompilerOptions;
482
482
  *
483
483
  * @public
484
484
  */
485
- declare function mergeCompilerOptions(base: TypeResolutionCompilerOptions, override: TypeResolutionCompilerOptions | undefined): TypeResolutionCompilerOptions;
485
+ export declare function mergeCompilerOptions(base: TypeResolutionCompilerOptions, override: TypeResolutionCompilerOptions | undefined): TypeResolutionCompilerOptions;
486
486
  /**
487
487
  * Resolve a single TypeScriptConfig to compiler options (sync version).
488
488
  * Only handles path-based tsconfig - use resolveTypeScriptConfigSingleAsync for function-based.
@@ -512,7 +512,7 @@ declare function mergeCompilerOptions(base: TypeResolutionCompilerOptions, overr
512
512
  *
513
513
  * @public
514
514
  */
515
- declare function resolveTypeScriptConfigSingle(config: TypeScriptConfig | undefined, projectRoot: string): TypeResolutionCompilerOptions;
515
+ export declare function resolveTypeScriptConfigSingle(config: TypeScriptConfig | undefined, projectRoot: string): TypeResolutionCompilerOptions;
516
516
  /**
517
517
  * Resolve a single TypeScriptConfig to compiler options (async version).
518
518
  * Handles both path-based and function-based tsconfig.
@@ -544,7 +544,7 @@ declare function resolveTypeScriptConfigSingle(config: TypeScriptConfig | undefi
544
544
  *
545
545
  * @public
546
546
  */
547
- declare function resolveTypeScriptConfigSingleAsync(config: TypeScriptConfig | undefined, projectRoot: string): Promise<TypeResolutionCompilerOptions>;
547
+ export declare function resolveTypeScriptConfigSingleAsync(config: TypeScriptConfig | undefined, projectRoot: string): Promise<TypeResolutionCompilerOptions>;
548
548
  /**
549
549
  * Resolve TypeScript compiler options from a cascade of configurations (async).
550
550
  *
@@ -583,7 +583,7 @@ declare function resolveTypeScriptConfigSingleAsync(config: TypeScriptConfig | u
583
583
  *
584
584
  * @public
585
585
  */
586
- declare function resolveTypeScriptConfig(projectRoot: string, global?: TypeScriptConfig, api?: TypeScriptConfig): Promise<TypeResolutionCompilerOptions>;
586
+ export declare function resolveTypeScriptConfig(projectRoot: string, global?: TypeScriptConfig, api?: TypeScriptConfig): Promise<TypeResolutionCompilerOptions>;
587
587
  //#endregion
588
588
  //#region src/VirtualPackage.d.ts
589
589
  declare const VirtualPackage_base: Schema.Class<VirtualPackage, Schema.Struct<{
@@ -619,7 +619,7 @@ declare const VirtualPackage_base: Schema.Class<VirtualPackage, Schema.Struct<{
619
619
  *
620
620
  * @public
621
621
  */
622
- declare class VirtualPackage extends VirtualPackage_base {
622
+ export declare class VirtualPackage extends VirtualPackage_base {
623
623
  /**
624
624
  * Single-entry factory: a virtual package whose sole entry point is
625
625
  * `index.d.ts`.
@@ -659,5 +659,5 @@ declare class VirtualPackage extends VirtualPackage_base {
659
659
  private toPackageJson;
660
660
  }
661
661
  //#endregion
662
- export { type CompilerOptionsInput, DEFAULT_COMPILER_OPTIONS, TWOSLASH_CACHE_FORMAT, TsConfigParseError, TsEnvironment, TsEnvironmentError, type TsEnvironmentOptions, type TwoslashCacheStats, type TwoslashCacheValue, type TwoslashResultCache, TypeResolutionCompilerOptions, type TypeScriptConfig, type Vfs, VirtualPackage, decodeCompilerOptions, decodeTwoslashCache, encodeTwoslashCache, isTypeDefinition, makeTwoslashCache, mergeCompilerOptions, mergeVfs, parseTsConfig, prefixVfs, resolveTypeScriptConfig, resolveTypeScriptConfigSingle, resolveTypeScriptConfigSingleAsync, toProgrammaticCompilerOptions, twoslashBlobKey, twoslashEntryKey, twoslashEnvHash };
662
+ export type { CompilerOptionsInput, TsEnvironmentOptions, TwoslashCacheStats, TwoslashCacheValue, TwoslashResultCache, TypeScriptConfig, Vfs };
663
663
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsdoctor/vfs",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "description": "Virtual TypeScript projects for documentation tooling: the Vfs currency type, declaration-backed virtual packages, @typescript/vfs environments, and the compiler-option resolution that configures them.",
6
6
  "keywords": [
@@ -37,10 +37,10 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "peerDependencies": {
40
- "@effected/tsconfig-json": "^0.7.0",
40
+ "@effected/tsconfig-json": "^0.8.0",
41
41
  "@shikijs/twoslash": "^4.4.3",
42
42
  "@typescript/vfs": "^1.6.4",
43
- "effect": "4.0.0-rc.109",
43
+ "effect": "4.0.0-rc.112",
44
44
  "typescript": "^6.0.3"
45
45
  },
46
46
  "peerDependenciesMeta": {