typescript 7.1.0-dev.20261001.1 → 7.1.0-dev.20261003.1

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 (118) hide show
  1. package/dist/api/async/api.d.ts +73 -42
  2. package/dist/api/async/api.d.ts.map +1 -1
  3. package/dist/api/async/api.js +224 -68
  4. package/dist/api/async/api.js.map +1 -1
  5. package/dist/api/async/client.d.ts.map +1 -1
  6. package/dist/api/async/client.js +73 -16
  7. package/dist/api/async/client.js.map +1 -1
  8. package/dist/api/async/types.d.ts +4 -3
  9. package/dist/api/async/types.d.ts.map +1 -1
  10. package/dist/api/compilerOptions.generated.d.ts +123 -0
  11. package/dist/api/compilerOptions.generated.d.ts.map +1 -0
  12. package/dist/api/compilerOptions.generated.js +8 -0
  13. package/dist/api/compilerOptions.generated.js.map +1 -0
  14. package/dist/api/diagnosticFormatter.d.ts.map +1 -1
  15. package/dist/api/diagnosticFormatter.js.map +1 -1
  16. package/dist/api/fs.d.ts +10 -8
  17. package/dist/api/fs.d.ts.map +1 -1
  18. package/dist/api/fs.js.map +1 -1
  19. package/dist/api/node/encoder.generated.js +1 -1
  20. package/dist/api/node/encoder.generated.js.map +1 -1
  21. package/dist/api/node/node.d.ts +18 -10
  22. package/dist/api/node/node.d.ts.map +1 -1
  23. package/dist/api/node/node.generated.js +1 -1
  24. package/dist/api/node/node.generated.js.map +1 -1
  25. package/dist/api/node/node.infrastructure.d.ts.map +1 -1
  26. package/dist/api/node/node.infrastructure.js.map +1 -1
  27. package/dist/api/node/node.js +39 -11
  28. package/dist/api/node/node.js.map +1 -1
  29. package/dist/api/path.d.ts +46 -9
  30. package/dist/api/path.d.ts.map +1 -1
  31. package/dist/api/path.js +365 -28
  32. package/dist/api/path.js.map +1 -1
  33. package/dist/api/prepareCompilerOptions.generated.d.ts +5 -0
  34. package/dist/api/prepareCompilerOptions.generated.d.ts.map +1 -0
  35. package/dist/api/prepareCompilerOptions.generated.js +24 -0
  36. package/dist/api/prepareCompilerOptions.generated.js.map +1 -0
  37. package/dist/api/proto.generated.d.ts +223 -172
  38. package/dist/api/proto.generated.d.ts.map +1 -1
  39. package/dist/api/proto.generated.js +3 -0
  40. package/dist/api/proto.generated.js.map +1 -1
  41. package/dist/api/sourceFileCache.d.ts +15 -9
  42. package/dist/api/sourceFileCache.d.ts.map +1 -1
  43. package/dist/api/sourceFileCache.js +30 -12
  44. package/dist/api/sourceFileCache.js.map +1 -1
  45. package/dist/api/sync/api.d.ts +101 -49
  46. package/dist/api/sync/api.d.ts.map +1 -1
  47. package/dist/api/sync/api.js +314 -86
  48. package/dist/api/sync/api.js.map +1 -1
  49. package/dist/api/sync/types.d.ts +4 -3
  50. package/dist/api/sync/types.d.ts.map +1 -1
  51. package/dist/api/typedPaths.d.ts +3 -0
  52. package/dist/api/typedPaths.d.ts.map +1 -0
  53. package/dist/api/typedPaths.js +2 -0
  54. package/dist/api/typedPaths.js.map +1 -0
  55. package/dist/ast/ast.d.ts +58 -7
  56. package/dist/ast/ast.d.ts.map +1 -1
  57. package/dist/ast/ast.generated.d.ts +3 -3
  58. package/dist/ast/ast.generated.d.ts.map +1 -1
  59. package/dist/ast/factory.generated.d.ts +2 -2
  60. package/dist/ast/factory.generated.d.ts.map +1 -1
  61. package/dist/ast/factory.generated.js.map +1 -1
  62. package/dist/ast/is.generated.d.ts.map +1 -1
  63. package/dist/ast/is.generated.js +2 -1
  64. package/dist/ast/is.generated.js.map +1 -1
  65. package/dist/ast/scanner.d.ts.map +1 -1
  66. package/dist/ast/scanner.js +1 -0
  67. package/dist/ast/scanner.js.map +1 -1
  68. package/dist/enums/caseSensitivity.d.ts +2 -0
  69. package/dist/enums/caseSensitivity.d.ts.map +1 -0
  70. package/dist/enums/caseSensitivity.enum.d.ts +5 -0
  71. package/dist/enums/caseSensitivity.enum.d.ts.map +1 -0
  72. package/dist/enums/caseSensitivity.enum.js +7 -0
  73. package/dist/enums/caseSensitivity.enum.js.map +1 -0
  74. package/dist/enums/caseSensitivity.js +7 -0
  75. package/dist/enums/caseSensitivity.js.map +1 -0
  76. package/dist/enums/jsxEmit.enum.js +1 -1
  77. package/dist/enums/jsxEmit.enum.js.map +1 -1
  78. package/dist/enums/jsxEmit.js +1 -1
  79. package/dist/enums/jsxEmit.js.map +1 -1
  80. package/dist/enums/moduleDetectionKind.enum.js +1 -1
  81. package/dist/enums/moduleDetectionKind.enum.js.map +1 -1
  82. package/dist/enums/moduleDetectionKind.js +1 -1
  83. package/dist/enums/moduleDetectionKind.js.map +1 -1
  84. package/dist/enums/moduleKind.enum.js +1 -1
  85. package/dist/enums/moduleKind.enum.js.map +1 -1
  86. package/dist/enums/moduleKind.js +1 -1
  87. package/dist/enums/moduleKind.js.map +1 -1
  88. package/dist/enums/moduleResolutionKind.enum.js +1 -1
  89. package/dist/enums/moduleResolutionKind.enum.js.map +1 -1
  90. package/dist/enums/moduleResolutionKind.js +1 -1
  91. package/dist/enums/moduleResolutionKind.js.map +1 -1
  92. package/dist/enums/newLineKind.enum.js +1 -1
  93. package/dist/enums/newLineKind.enum.js.map +1 -1
  94. package/dist/enums/newLineKind.js +1 -1
  95. package/dist/enums/newLineKind.js.map +1 -1
  96. package/dist/enums/scriptTarget.d.ts.map +1 -1
  97. package/dist/enums/scriptTarget.enum.d.ts.map +1 -1
  98. package/dist/enums/scriptTarget.enum.js +1 -0
  99. package/dist/enums/scriptTarget.enum.js.map +1 -1
  100. package/dist/enums/scriptTarget.js +1 -0
  101. package/dist/enums/scriptTarget.js.map +1 -1
  102. package/dist/enums/syntaxKind.enum.d.ts +198 -197
  103. package/dist/enums/syntaxKind.enum.d.ts.map +1 -1
  104. package/dist/enums/syntaxKind.enum.js +199 -198
  105. package/dist/enums/syntaxKind.enum.js.map +1 -1
  106. package/dist/enums/syntaxKind.js +199 -198
  107. package/dist/enums/syntaxKind.js.map +1 -1
  108. package/dist/vscode/extensionApi.d.ts +56 -0
  109. package/dist/vscode/extensionApi.d.ts.map +1 -0
  110. package/dist/vscode/extensionApi.js +2 -0
  111. package/dist/vscode/extensionApi.js.map +1 -0
  112. package/dist/vscode/protocol.generated.d.ts +2886 -0
  113. package/dist/vscode/protocol.generated.d.ts.map +1 -0
  114. package/dist/vscode/protocol.generated.js +4 -0
  115. package/dist/vscode/protocol.generated.js.map +1 -0
  116. package/package.json +16 -9
  117. package/schemas/jsconfig.schema.json +2207 -0
  118. package/schemas/tsconfig.schema.json +2206 -0
@@ -18,9 +18,9 @@ import { SymbolOwnerKind } from "#enums/symbolOwnerKind";
18
18
  import { TypeFlags } from "#enums/typeFlags";
19
19
  import { TypeFormatFlags } from "#enums/typeFormatFlags";
20
20
  import { TypePredicateKind } from "#enums/typePredicateKind";
21
- import { type __String, type CallLikeExpression, type Declaration, type Expression, type FileReference, type Identifier, ModifierFlags, type NamedTupleMember, type Node, type ParameterDeclaration, type Path, type SourceFile, type StringLiteralLikeNode, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
21
+ import { type __String, type CallLikeExpression, type Declaration, type Expression, type FileReference, type Identifier, ModifierFlags, type NamedTupleMember, type Node, type ParameterDeclaration, type PathKey, type RootedDirectoryPath, type RootedFilePath, type SourceFile, type StringLiteralLikeNode, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
22
22
  import type { APIOptions, LSPConnectionOptions } from "../options.ts";
23
- import type { BuildResponse, CleanBuildResponse, CompactSymbolReference, CompilerOptions, CompletionPreferences, ConfiguredProjectId, CreateBuildOrchestratorResponse, CreateProgramOptions as ProtocolCreateProgramOptions, CreateSnapshotParams as ProtocolCreateSnapshotParams, CreateSnapshotProgramParams as ProtocolCreateSnapshotProgramParams, CreateSnapshotResponse, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, FileNotifications, InferredProjectId, LanguageServerSnapshotChanges as ProtocolLanguageServerSnapshotChanges, ModuleResolutionEntry, ModuleResolutionSpec, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ProjectResponse, ProtocolSymbolResponse, ReadConfigFileResponse, ReconfigureSnapshotProgramParams as ProtocolReconfigureSnapshotProgramParams, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, StaticModuleResolution, SymbolPropertyMethod, SymbolReference, SymbolResponse, SymbolsPropertyMethod, SyntheticProjectId, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UserPreferences } from "../proto.ts";
23
+ import type { BuildResponse, CleanBuildResponse, CompactSymbolReference, CompilerOptions, CompletionPreferences, ConfiguredProjectId, CreateBuildOrchestratorResponse, CreateProgramOptions as ProtocolCreateProgramOptions, CreateSnapshotParams as ProtocolCreateSnapshotParams, CreateSnapshotProgramParams as ProtocolCreateSnapshotProgramParams, CreateSnapshotResponse, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, FileNotifications, InferredProjectId, LanguageServerSnapshotChanges as ProtocolLanguageServerSnapshotChanges, ModuleResolutionEntry, ModuleResolutionSpec, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ProjectResponse, ProtocolSymbolResponse, RawCompilerOptions, ReadConfigFileResponse, ReconfigureSnapshotProgramParams as ProtocolReconfigureSnapshotProgramParams, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, StaticModuleResolution, SymbolPropertyMethod, SymbolReference, SymbolResponse, SymbolsPropertyMethod, SyntheticProjectId, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UserPreferences } from "../proto.ts";
24
24
  import { type CachedSourceFile, SourceFileCache } from "../sourceFileCache.ts";
25
25
  import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
26
26
  import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
@@ -28,7 +28,7 @@ import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLi
28
28
  export { formatDiagnostics, formatDiagnosticsWithColorAndContext } from "../diagnosticFormatter.ts";
29
29
  export { documentURIToFileName, fileNameToDocumentURI } from "../path.ts";
30
30
  export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, IndexKind, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, ScriptKind, SignatureFlags, SignatureKind, SymbolFlags, SymbolOwnerKind, TypeFlags, TypeFormatFlags, TypePredicateKind };
31
- export type { APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, CompletionPreferences, ConditionalType, ConfiguredProjectId, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FileNotifications, FormatDiagnosticsHost, FreshableType, GenericType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InferredProjectId, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, MappedType, ModuleResolutionEntry, ModuleResolutionSpec, NumberLiteralType, ObjectType, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ReadConfigFileResponse, RequestTiming, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SourceFileMetadata, StaticModuleResolution, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, SyntheticProjectId, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, TupleTypeReference, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, UserPreferences, };
31
+ export type { APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, CompletionPreferences, ConditionalType, ConfiguredProjectId, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FileNotifications, FormatDiagnosticsHost, FreshableType, GenericType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InferredProjectId, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, MappedType, ModuleResolutionEntry, ModuleResolutionSpec, NumberLiteralType, ObjectType, PackageId, ParsedCommandLine, ProjectId, ProjectReference, RawCompilerOptions, ReadConfigFileResponse, RequestTiming, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SourceFileMetadata, StaticModuleResolution, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, SyntheticProjectId, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, TupleTypeReference, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, UserPreferences, };
32
32
  export interface ModuleResolverOptions {
33
33
  moduleResolutions?: ModuleResolutionSpec | undefined;
34
34
  resolveModuleName?: ResolveModuleNameCallback | undefined;
@@ -41,8 +41,11 @@ export type InProgressSnapshot = number & {
41
41
  readonly [inProgressSnapshotBrand]: never;
42
42
  };
43
43
  export type ResolveModuleNameCallback = (moduleName: string, containingDirectory: string, resolutionMode: ResolutionMode | undefined, options: ResolveModuleNameCallbackOptions) => StaticModuleResolution | undefined;
44
- export type CreateProgramOptions = Omit<ProtocolCreateProgramOptions, "moduleResolver"> & {
44
+ export type CreateProgramOptions = Omit<ProtocolCreateProgramOptions, "moduleResolver" | "projectReferences"> & {
45
45
  moduleResolver?: ModuleResolver | undefined;
46
+ projectReferences?: readonly (Omit<ProjectReference, "path"> & {
47
+ path: string;
48
+ })[] | undefined;
46
49
  };
47
50
  export type CreateSnapshotProgramParams = Omit<ProtocolCreateSnapshotProgramParams, "options"> & {
48
51
  options?: CreateProgramOptions | undefined;
@@ -59,7 +62,7 @@ export type LanguageServerSnapshotChanges = Omit<ProtocolLanguageServerSnapshotC
59
62
  reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
60
63
  };
61
64
  export interface TranspileOptions {
62
- compilerOptions?: CompilerOptions | undefined;
65
+ compilerOptions?: RawCompilerOptions | undefined;
63
66
  fileName?: string | undefined;
64
67
  reportDiagnostics?: boolean | undefined;
65
68
  }
@@ -71,12 +74,14 @@ export interface TranspileOutput {
71
74
  export { all, type AllAPIRequestGenerator, type AnyAPIRequestGenerator, type APIRequestGenerator, defer, type DeferredAPIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
72
75
  import { type AnyAPIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
73
76
  export declare class API<FromLSP extends boolean = false> implements FormatDiagnosticsHost {
74
- private client;
75
- private sourceFileCache;
77
+ /** @internal */
78
+ readonly client: Client;
79
+ /** @internal */
80
+ readonly sourceFileCache: SourceFileCache<Symbol>;
76
81
  private toPath;
77
- private currentDirectory;
78
82
  private readonly decoder;
79
- private getCanonicalFileNameWorker;
83
+ private currentDirectory;
84
+ private caseSensitivity;
80
85
  private initialized;
81
86
  private initializing;
82
87
  private activeSnapshots;
@@ -85,6 +90,14 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
85
90
  readonly printer: Printer;
86
91
  readonly internal: InternalAPI;
87
92
  constructor(options?: APIOptions | LSPConnectionOptions);
93
+ /**
94
+ * Looks up a remote declaration's binder symbol. Throws for synthesized or configuration ASTs.
95
+ */
96
+ get getSymbol(): {
97
+ (declaration: Declaration): Symbol;
98
+ gen(declaration: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
99
+ };
100
+ private get fetchDeclarationSymbol();
88
101
  /**
89
102
  * Create an API instance from an existing LSP connection's API session.
90
103
  * Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
@@ -96,8 +109,9 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
96
109
  batch<T extends readonly AnyAPIRequestGenerator[]>(...requestGenerators: T): ExecutedGeneratorsResults<T>;
97
110
  private get ensureInitialized();
98
111
  private get initializeWorker();
99
- getCurrentDirectory(): string;
112
+ getCurrentDirectory(): RootedDirectoryPath;
100
113
  getCanonicalFileName(fileName: string): string;
114
+ private getCaseSensitivity;
101
115
  getNewLine(): string;
102
116
  get createBuildOrchestrator(): {
103
117
  (rootNames: readonly string[], buildOrchestratorOptions: BuildOrchestratorOptions): BuildOrchestrator;
@@ -198,8 +212,8 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
198
212
  gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
199
213
  };
200
214
  get createModuleResolver(): {
201
- (compilerOptions: CompilerOptions, options?: ModuleResolverOptions): ModuleResolver;
202
- gen(compilerOptions: CompilerOptions, options?: ModuleResolverOptions): Generator<ProtocolRequest, ModuleResolver, ProtocolResponse["result"]>;
215
+ (compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): ModuleResolver;
216
+ gen(compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): Generator<ProtocolRequest, ModuleResolver, ProtocolResponse["result"]>;
203
217
  };
204
218
  clearSourceFileCache(): void;
205
219
  get runWithTemporaryFileUpdate(): {
@@ -228,22 +242,26 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
228
242
  };
229
243
  /** Creates a program from current filesystem state. */
230
244
  get createProgram(): {
231
- (rootFiles: readonly DocumentIdentifier[], compilerOptions: CompilerOptions, createProgramOptions?: CreateProgramOptions): Program;
232
- gen(rootFiles: readonly DocumentIdentifier[], compilerOptions: CompilerOptions, createProgramOptions?: CreateProgramOptions): Generator<ProtocolRequest, Program, ProtocolResponse["result"]>;
245
+ (rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Program;
246
+ gen(rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Generator<ProtocolRequest, Program, ProtocolResponse["result"]>;
233
247
  };
234
248
  }
235
249
  type EnsureInitialized = (() => void) & {
236
250
  gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
237
251
  };
252
+ /** Looks up a remote declaration's binder symbol through its API. Throws for non-remote declarations. */
253
+ export declare function getSymbol(declaration: Declaration): Symbol;
254
+ export declare namespace getSymbol {
255
+ function gen(declaration: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
256
+ }
238
257
  /** An independently retained source file and its disposable remote-lifetime lease. */
239
258
  export declare class RetainedSourceFile {
240
259
  readonly sourceFile: SourceFile;
241
260
  private readonly lease;
242
- private readonly client;
243
261
  private readonly onDispose;
244
262
  private disposed;
245
263
  private disposePromise;
246
- constructor(sourceFile: SourceFile, lease: number, client: Client, onDispose: () => void);
264
+ constructor(sourceFile: SourceFile, lease: number, onDispose: () => void);
247
265
  [globalThis.Symbol.dispose](): void;
248
266
  get dispose(): {
249
267
  (): void;
@@ -261,12 +279,12 @@ export declare class InternalAPI {
261
279
  gen(dir: string): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
262
280
  };
263
281
  get stopCPUProfile(): {
264
- (): string;
265
- gen(): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
282
+ (): RootedFilePath;
283
+ gen(): Generator<ProtocolRequest, RootedFilePath, ProtocolResponse["result"]>;
266
284
  };
267
285
  get saveHeapProfile(): {
268
- (dir: string): string;
269
- gen(dir: string): Generator<ProtocolRequest, string, ProtocolResponse["result"]>;
286
+ (dir: string): RootedFilePath;
287
+ gen(dir: string): Generator<ProtocolRequest, RootedFilePath, ProtocolResponse["result"]>;
270
288
  };
271
289
  }
272
290
  type SnapshotUpdater = ((params: CreateSnapshotParams) => Snapshot) & {
@@ -321,7 +339,7 @@ export declare class Snapshot {
321
339
  readonly operation: SnapshotOperation;
322
340
  private projectMap;
323
341
  private toPath;
324
- private client;
342
+ private readonly api;
325
343
  private disposed;
326
344
  private disposePromise;
327
345
  private onDispose;
@@ -329,7 +347,8 @@ export declare class Snapshot {
329
347
  private projectDataMap;
330
348
  private updateSnapshot;
331
349
  readonly internal: SnapshotInternalAPI;
332
- constructor(data: CreateSnapshotResponse, client: Client, sourceFileCache: SourceFileCache<Symbol>, toPath: (fileName: string) => Path, formatDiagnosticsHost: FormatDiagnosticsHost, onDispose: () => void, updateSnapshot: SnapshotUpdater, baseSnapshot?: Snapshot);
350
+ private get client();
351
+ constructor(data: CreateSnapshotResponse, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, onDispose: () => void, updateSnapshot: SnapshotUpdater, baseSnapshot?: Snapshot);
333
352
  getProjects(): readonly Project[];
334
353
  getConfiguredProject(configFileName: string): Project<ConfiguredProjectId> | undefined;
335
354
  getProject<Id extends ProjectId>(projectId: Id): Project<Id> | undefined;
@@ -393,15 +412,15 @@ declare class SnapshotObjectRegistry {
393
412
  clear(): void;
394
413
  }
395
414
  declare class ProjectObjectRegistry {
396
- private client;
397
415
  private snapshotId;
398
416
  readonly project: Project;
399
417
  private snapshotRegistry;
400
- private sourceFileCache;
401
418
  private types;
402
419
  private signatures;
403
420
  private disposed;
404
- constructor(client: Client, snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry, sourceFileCache: SourceFileCache<Symbol>);
421
+ private get client();
422
+ private get sourceFileCache();
423
+ constructor(snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry);
405
424
  getOrCreateSymbol(data: ProtocolSymbolResponse): Symbol;
406
425
  /** Find an already-interned symbol and retain its file record for this registry. */
407
426
  getCachedSymbol(reference: CompactSymbolReference): Symbol | undefined;
@@ -467,21 +486,22 @@ declare class ProjectObjectRegistry {
467
486
  };
468
487
  }
469
488
  export declare class Project<Id extends ProjectId = ProjectId> {
489
+ /** @internal */
490
+ readonly api: API<boolean>;
470
491
  readonly id: Id;
471
- readonly configFileName: string;
472
- readonly currentDirectory: string;
492
+ readonly configFileName: RootedFilePath | undefined;
493
+ readonly currentDirectory: RootedDirectoryPath;
473
494
  readonly dirty: boolean;
474
495
  readonly parsedCommandLine: ParsedCommandLine;
475
496
  /** @deprecated Use `parsedCommandLine.options`. */
476
497
  readonly compilerOptions: CompilerOptions;
477
498
  /** @deprecated Use `parsedCommandLine.fileNames`. */
478
- readonly rootFiles: readonly string[];
499
+ readonly rootFiles: readonly RootedFilePath[];
479
500
  readonly program: Program<Id>;
480
501
  readonly checker: Checker;
481
502
  readonly languageService: LanguageService;
482
- private client;
483
503
  private snapshotId;
484
- constructor(data: ProjectResponse, snapshotId: number, client: Client, sourceFileCache: SourceFileCache<Symbol>, toPath: (fileName: string) => Path, formatDiagnosticsHost: FormatDiagnosticsHost, snapshotRegistry: SnapshotObjectRegistry);
504
+ constructor(data: ProjectResponse, snapshotId: number, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, snapshotRegistry: SnapshotObjectRegistry);
485
505
  /** @deprecated Use `languageService.getImportAdderEdits`. */
486
506
  get getImportAdderEdits(): {
487
507
  (file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
@@ -497,9 +517,9 @@ export declare class Project<Id extends ProjectId = ProjectId> {
497
517
  export declare class LanguageService {
498
518
  private snapshotId;
499
519
  private project;
500
- private client;
501
520
  private objectRegistry;
502
- constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
521
+ private get client();
522
+ constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
503
523
  get getImportAdderEdits(): {
504
524
  (file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
505
525
  gen(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
@@ -526,16 +546,15 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
526
546
  readonly snapshotId: number;
527
547
  readonly id: Id;
528
548
  private readonly project;
529
- private readonly client;
530
- private readonly sourceFileCache;
531
549
  private readonly toPath;
532
- private readonly formatDiagnosticsHost;
533
550
  private readonly decoder;
534
551
  private readonly sourceFileMetadataCache;
535
552
  private ownedSnapshot;
536
553
  private disposePromise;
537
- constructor(snapshotId: number, project: Project<Id>, client: Client, sourceFileCache: SourceFileCache<Symbol>, toPath: (fileName: string) => Path, formatDiagnosticsHost: FormatDiagnosticsHost);
538
- getCurrentDirectory(): string;
554
+ private get client();
555
+ private get sourceFileCache();
556
+ constructor(snapshotId: number, project: Project<Id>, toPath: (fileName: string, basePath?: string) => PathKey);
557
+ getCurrentDirectory(): RootedDirectoryPath;
539
558
  getCanonicalFileName(fileName: string): string;
540
559
  getNewLine(): string;
541
560
  /** @internal */
@@ -551,6 +570,16 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
551
570
  (file: DocumentIdentifier): SourceFile | undefined;
552
571
  gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
553
572
  };
573
+ /**
574
+ * Returns the source file for an already-canonical path.
575
+ *
576
+ * @internal
577
+ */
578
+ get getSourceFileByPath(): {
579
+ (path: PathKey): SourceFile | undefined;
580
+ gen(path: PathKey): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
581
+ };
582
+ private get getSourceFileWorker();
554
583
  get getResolvedModule(): {
555
584
  (file: DocumentIdentifier, moduleName: string, mode: ModuleKind): ResolvedModule | undefined;
556
585
  gen(file: DocumentIdentifier, moduleName: string, mode: ModuleKind): Generator<ProtocolRequest, ResolvedModule | undefined, ProtocolResponse["result"]>;
@@ -576,8 +605,8 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
576
605
  gen(typeReferenceDirective: FileReference, sourceFile: DocumentIdentifier): Generator<ProtocolRequest, ResolvedTypeReferenceDirective | undefined, ProtocolResponse["result"]>;
577
606
  };
578
607
  get getSourceFileNames(): {
579
- (): readonly string[];
580
- gen(): Generator<ProtocolRequest, readonly string[], ProtocolResponse["result"]>;
608
+ (): readonly RootedFilePath[];
609
+ gen(): Generator<ProtocolRequest, readonly RootedFilePath[], ProtocolResponse["result"]>;
581
610
  };
582
611
  /**
583
612
  * Returns program-stored metadata for the given source file, or `undefined` if the file
@@ -595,10 +624,11 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
595
624
  * this `Program` instance.
596
625
  */
597
626
  get getSourceFileMetadataByPath(): {
598
- (path: Path): SourceFileMetadata | undefined;
599
- gen(path: Path): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
627
+ (path: PathKey): SourceFileMetadata | undefined;
628
+ gen(path: PathKey): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
600
629
  };
601
630
  private get fetchSourceFileMetadata();
631
+ private pathKeyForFileName;
602
632
  /**
603
633
  * Returns whether the given source file was loaded as part of an external library
604
634
  * (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
@@ -622,8 +652,8 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
622
652
  * Includes the root config file and any extended config files.
623
653
  */
624
654
  get getConfigFileNames(): {
625
- (): readonly string[];
626
- gen(): Generator<ProtocolRequest, readonly string[], ProtocolResponse["result"]>;
655
+ (): readonly RootedFilePath[];
656
+ gen(): Generator<ProtocolRequest, readonly RootedFilePath[], ProtocolResponse["result"]>;
627
657
  };
628
658
  /**
629
659
  * Get a config source file by file name/URI.
@@ -779,12 +809,35 @@ export declare class BuildOrchestrator {
779
809
  export declare class Checker {
780
810
  private snapshotId;
781
811
  private project;
782
- private client;
783
812
  private objectRegistry;
784
813
  private wellKnownSymbols;
785
814
  private wellKnownSignatures;
786
- constructor(snapshotId: number, project: Project, client: Client, objectRegistry: ProjectObjectRegistry);
815
+ private get client();
816
+ constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
787
817
  dispose(): void;
818
+ /** Get the merged symbol, or the original symbol if it has not been merged. */
819
+ get getMergedSymbol(): {
820
+ (symbol: Symbol): Symbol;
821
+ gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
822
+ };
823
+ /**
824
+ * Get a node's merged symbol. For a declaration, prefer
825
+ * {@link Checker.getSymbolOfDeclaration} for a non-nullable result.
826
+ */
827
+ get getSymbolOfNode(): {
828
+ (node: Node): Symbol | undefined;
829
+ gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
830
+ };
831
+ /** Get a declaration's merged symbol. */
832
+ get getSymbolOfDeclaration(): {
833
+ (node: Declaration): Symbol;
834
+ gen(node: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
835
+ };
836
+ /** Get a symbol's merged parent, if any. */
837
+ get getParentOfSymbol(): {
838
+ (symbol: Symbol): Symbol | undefined;
839
+ gen(symbol: Symbol): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
840
+ };
788
841
  get getSymbolAtLocation(): {
789
842
  (node: Node): Symbol | undefined;
790
843
  (nodes: readonly Node[]): (Symbol | undefined)[];
@@ -1286,7 +1339,7 @@ export declare class NodeHandle<out T extends Node = Node> {
1286
1339
  private readonly fileOwner;
1287
1340
  readonly index: number;
1288
1341
  readonly kind: SyntaxKind;
1289
- readonly path: Path;
1342
+ readonly path: PathKey;
1290
1343
  constructor(handle: string, canonicalProject: Project | undefined, fileOwner?: SourceFileOwner);
1291
1344
  /**
1292
1345
  * Resolve this handle to the actual AST node by fetching the source file from a project
@@ -1316,11 +1369,10 @@ export interface SignatureUsage {
1316
1369
  /** The node handle for the call expression, if the reference is invoked. */
1317
1370
  call?: NodeHandle | undefined;
1318
1371
  }
1319
- /** A cached source-file record and the dependencies needed to materialize or extend it. */
1372
+ /** A cached source-file record and its owning API. */
1320
1373
  interface SourceFileOwner {
1321
1374
  readonly record: CachedSourceFile<Symbol>;
1322
- readonly cache: SourceFileCache<Symbol>;
1323
- readonly client: Client;
1375
+ readonly api: API<boolean>;
1324
1376
  }
1325
1377
  type SymbolStorage = {
1326
1378
  readonly kind: typeof SymbolOwnerKind.File;