typescript 7.1.0-dev.20260916.1 → 7.1.0-dev.20260918.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.
@@ -3,12 +3,15 @@ import { ModuleDetectionKind } from "#enums/moduleDetectionKind";
3
3
  import { ModuleKind } from "#enums/moduleKind";
4
4
  import { ModuleResolutionKind } from "#enums/moduleResolutionKind";
5
5
  import { NewLineKind } from "#enums/newLineKind";
6
+ import { ScriptKind } from "#enums/scriptKind";
6
7
  import { ScriptTarget } from "#enums/scriptTarget";
8
+ import type { Path } from "../ast/index.ts";
7
9
  export { JsxEmit } from "#enums/jsxEmit";
8
10
  export { ModuleDetectionKind } from "#enums/moduleDetectionKind";
9
11
  export { ModuleKind } from "#enums/moduleKind";
10
12
  export { ModuleResolutionKind } from "#enums/moduleResolutionKind";
11
13
  export { NewLineKind } from "#enums/newLineKind";
14
+ export { ScriptKind } from "#enums/scriptKind";
12
15
  export { ScriptTarget } from "#enums/scriptTarget";
13
16
  export type APIMethod<TParams, TResult> = {
14
17
  params: TParams;
@@ -18,13 +21,15 @@ export interface APIMethodInfo {
18
21
  release: APIMethod<ReleaseParams, void>;
19
22
  batchRequests: APIMethod<BatchRequestsParams, BatchRequestsResponse>;
20
23
  initialize: APIMethod<null, InitializeResponse>;
21
- updateSnapshot: APIMethod<UpdateSnapshotParams, UpdateSnapshotResponse>;
22
- updateTemporarySnapshot: APIMethod<UpdateTemporarySnapshotParams, UpdateSnapshotResponse>;
23
- createProgram: APIMethod<CreateProgramParams, CreateProgramResponse>;
24
+ createSnapshot: APIMethod<CreateSnapshotParams, CreateSnapshotResponse>;
25
+ updateSnapshot: APIMethod<UpdateSnapshotParams, CreateSnapshotResponse>;
26
+ getCurrentLanguageServerSnapshot: APIMethod<GetCurrentLanguageServerSnapshotParams, CreateSnapshotResponse>;
24
27
  parseCommandLine: APIMethod<ParseCommandLineParams, ConfigFileResponse>;
25
28
  readConfigFile: APIMethod<ReadConfigFileParams, ReadConfigFileResponse>;
26
29
  parseJsonConfigFileContent: APIMethod<ParseJsonConfigFileContentParams, ConfigFileResponse>;
27
30
  parseConfigFile: APIMethod<ParseConfigFileParams, ConfigFileResponse>;
31
+ createSourceFile: APIMethod<CreateSourceFileParams, SourceFileResponse>;
32
+ createSourceFileFromFile: APIMethod<CreateSourceFileFromFileParams, SourceFileResponse>;
28
33
  transpileModule: APIMethod<TranspileParams, TranspileOutputResponse>;
29
34
  transpileModuleFromFile: APIMethod<TranspileFromFileParams, TranspileOutputResponse>;
30
35
  transpileDeclaration: APIMethod<TranspileParams, TranspileOutputResponse>;
@@ -43,6 +48,8 @@ export interface APIMethodInfo {
43
48
  getSourceFile: APIMethod<GetSourceFileParams, SourceFileResponse | null>;
44
49
  getSourceFileNames: APIMethod<GetSourceFileNamesParams, string[]>;
45
50
  getSourceFileMetadata: APIMethod<GetSourceFileParams, SourceFileMetadata | null>;
51
+ getModeForUsageLocation: APIMethod<GetModeForUsageLocationParams, ModuleKind>;
52
+ getModeForResolutionAtIndex: APIMethod<GetModeForResolutionAtIndexParams, ModuleKind>;
46
53
  getResolvedModule: APIMethod<GetResolvedModuleParams, ResolvedModule | null>;
47
54
  getResolvedModuleFromModuleSpecifier: APIMethod<GetResolvedModuleFromModuleSpecifierParams, ResolvedModule | null>;
48
55
  getResolvedTypeReferenceDirective: APIMethod<GetResolvedTypeReferenceDirectiveParams, ResolvedTypeReferenceDirective | null>;
@@ -119,7 +126,7 @@ export interface APIMethodInfo {
119
126
  getImportAdderEdits: APIMethod<GetImportAdderEditsParams, TextEdit[]>;
120
127
  getTrueTypeOfConditionalType: APIMethod<GetTypePropertyParams, TypeResponse>;
121
128
  getFalseTypeOfConditionalType: APIMethod<GetTypePropertyParams, TypeResponse>;
122
- getConstantValue: APIMethod<CheckerNodeParams, unknown | null>;
129
+ getConstantValue: APIMethod<CheckerNodeParams, ConstantValueResponse | null>;
123
130
  getSignatureFromDeclaration: APIMethod<CheckerNodeParams, SignatureResponse>;
124
131
  getExportSpecifierLocalTargetSymbol: APIMethod<CheckerNodeParams, SymbolResponse | null>;
125
132
  getAliasedSymbol: APIMethod<CheckerSymbolParams, SymbolResponse>;
@@ -172,6 +179,17 @@ export interface APIMethodInfo {
172
179
  export type DocumentIdentifier = string | {
173
180
  uri: string;
174
181
  };
182
+ export type EnsurePrograms = true | readonly ProjectId[];
183
+ export type InferredProjectId = string & {
184
+ __inferredProjectIdBrand: any;
185
+ };
186
+ export type ConfiguredProjectId = Path & {
187
+ __configuredProjectIdBrand: any;
188
+ };
189
+ export type SyntheticProjectId = string & {
190
+ __syntheticProjectIdBrand: any;
191
+ };
192
+ export type ProjectId = InferredProjectId | ConfiguredProjectId | SyntheticProjectId;
175
193
  /** ReleaseParams are the parameters for the release method. */
176
194
  export interface ReleaseParams {
177
195
  snapshot: number;
@@ -192,82 +210,38 @@ export interface InitializeResponse {
192
210
  /** CurrentDirectory is the server's current working directory. */
193
211
  currentDirectory: string;
194
212
  }
195
- /**
196
- * UpdateSnapshotParams are the parameters for creating a new snapshot.
197
- * All fields are optional. With no fields set, the server adopts the latest LSP state.
198
- */
199
- export interface UpdateSnapshotParams {
200
- /**
201
- * Snapshot, when set, requires this to be the latest active snapshot and layers
202
- * FileSystem over that snapshot's filesystem. Used by Snapshot.update.
203
- */
204
- snapshot?: number | undefined;
205
- /**
206
- * OpenProjects lists tsconfig.json files to open/load in the new snapshot.
207
- * Opens are ref-counted and persist across snapshots until closed.
208
- */
209
- openProjects?: readonly DocumentIdentifier[] | undefined;
210
- /**
211
- * CloseProjects lists tsconfig.json files to release in the new snapshot.
212
- * A project is only unloaded once every API client that opened it closes it.
213
- */
214
- closeProjects?: readonly DocumentIdentifier[] | undefined;
215
- /** FileChanges describes file system changes since the last snapshot. */
216
- fileChanges?: APIFileChanges | undefined;
213
+ /** CreateSnapshotParams are the parameters for creating a new independent snapshot. */
214
+ export interface CreateSnapshotParams extends SnapshotRequestChangesParams {
215
+ /** FileNotifications describes host file system changes to invalidate while creating the snapshot. */
216
+ fileNotifications?: FileNotifications | undefined;
217
217
  /**
218
218
  * FileSystem supplies file contents and directory listings for the new snapshot.
219
219
  * A full filesystem is canonical and total. A filesystem layer is checked
220
- * before falling back to the host filesystem.
220
+ * before falling back to the base snapshot or host filesystem.
221
221
  */
222
222
  fileSystem?: RequestFileSystem | undefined;
223
- /**
224
- * OpenFiles lists files to keep open for the API client, mirroring LSP's
225
- * textDocument/didOpen. For each file, ancestor directories are searched for a
226
- * tsconfig that contains it; if found, that configured project is loaded and
227
- * becomes the file's default project. Otherwise the file is loaded into the
228
- * inferred project (e.g. a node_modules d.ts not in any project's import graph).
229
- * Opens persist across snapshots until the file is closed.
230
- */
231
- openFiles?: readonly DocumentIdentifier[] | undefined;
232
- /**
233
- * CloseFiles lists files to release in the new snapshot. A file is only fully
234
- * closed once every API client that opened it closes it.
235
- */
236
- closeFiles?: readonly DocumentIdentifier[] | undefined;
237
223
  }
238
- /** UpdateSnapshotResponse is returned by updateSnapshot. */
239
- export interface UpdateSnapshotResponse {
224
+ /** CreateSnapshotResponse is returned by createSnapshot. */
225
+ export interface CreateSnapshotResponse {
240
226
  /** Snapshot is the handle for the newly created snapshot. */
241
227
  snapshot: number;
242
- /** Projects is the list of projects in the snapshot. */
243
- projects: ProjectResponse[];
244
228
  /**
245
- * Changes describes source file differences from the previous snapshot.
246
- * Nil for the first snapshot in a session.
229
+ * Projects contains all projects when no response base was supplied, or only
230
+ * projects added or replaced relative to that base.
247
231
  */
232
+ projects: ProjectResponse[];
233
+ /** Changes describes source file differences from the response base. */
248
234
  changes?: SnapshotChanges | undefined;
235
+ /** Operation describes results correlated with the request that produced the snapshot. */
236
+ operation: SnapshotOperationResponse;
249
237
  }
250
- /**
251
- * UpdateTemporarySnapshotParams are the parameters for creating a temporary
252
- * snapshot that overrides a single file's content.
253
- */
254
- export interface UpdateTemporarySnapshotParams {
255
- /** Snapshot is the current client snapshot on which to layer the temporary update. */
238
+ export interface UpdateSnapshotParams {
256
239
  snapshot: number;
257
- /** File identifies the file whose content is temporarily overridden. */
258
- file: DocumentIdentifier;
259
- /** NewText is the temporary content for the file. */
260
- newText: string;
261
- }
262
- export interface CreateProgramParams {
263
- rootFiles: readonly DocumentIdentifier[] | null;
264
- createProgramOptions: CreateProgramOptions;
265
- oldProgram?: CreateProgramOldProgramParams | undefined;
266
- fileChanges?: APIFileChanges | undefined;
240
+ changes?: CreateSnapshotParams | undefined;
267
241
  }
268
- export interface CreateProgramResponse {
269
- snapshot: number;
270
- project: ProjectResponse | null;
242
+ export interface GetCurrentLanguageServerSnapshotParams {
243
+ baseSnapshot?: number | undefined;
244
+ changes?: LanguageServerSnapshotChanges | undefined;
271
245
  }
272
246
  export interface ParseCommandLineParams {
273
247
  commandLine: readonly string[] | null;
@@ -296,6 +270,23 @@ export interface ParseJsonConfigFileContentParams {
296
270
  export interface ParseConfigFileParams {
297
271
  file: DocumentIdentifier;
298
272
  }
273
+ export interface CreateSourceFileParams {
274
+ fileName: string;
275
+ sourceText: string;
276
+ options: CreateSourceFileOptions;
277
+ }
278
+ /**
279
+ * SourceFileResponse contains the binary-encoded AST data for a source file.
280
+ * The Data field is base64-encoded binary data in the encoder's format.
281
+ */
282
+ export interface SourceFileResponse {
283
+ /** Data is the base64-encoded binary AST data in the encoder's format. */
284
+ data: string;
285
+ }
286
+ export interface CreateSourceFileFromFileParams {
287
+ fileName: string;
288
+ options: CreateSourceFileOptions;
289
+ }
299
290
  export interface TranspileParams {
300
291
  input: string;
301
292
  options: TranspileOptions;
@@ -314,9 +305,10 @@ export interface GetDefaultProjectForFileParams {
314
305
  file: DocumentIdentifier;
315
306
  }
316
307
  export interface ProjectResponse {
317
- id: string;
308
+ id: ProjectId;
318
309
  configFileName: string;
319
310
  currentDirectory: string;
311
+ dirty: boolean;
320
312
  parsedCommandLine: ConfigFileResponse;
321
313
  /** @deprecated Use parsedCommandLine.fileNames. */
322
314
  rootFiles: string[];
@@ -325,7 +317,7 @@ export interface ProjectResponse {
325
317
  }
326
318
  export interface GetSymbolAtPositionParams {
327
319
  snapshot: number;
328
- project: string;
320
+ project: ProjectId;
329
321
  file: DocumentIdentifier;
330
322
  position: number;
331
323
  }
@@ -335,7 +327,7 @@ export interface SymbolResponse {
335
327
  * Project is the project in which the symbol was first observed. It is the
336
328
  * default project for follow-up lookups whose results can vary by project.
337
329
  */
338
- project: string;
330
+ project: ProjectId;
339
331
  name: string;
340
332
  flags: number;
341
333
  checkFlags: number;
@@ -346,33 +338,33 @@ export interface SymbolResponse {
346
338
  }
347
339
  export interface GetSymbolsAtPositionsParams {
348
340
  snapshot: number;
349
- project: string;
341
+ project: ProjectId;
350
342
  file: DocumentIdentifier;
351
343
  positions: readonly number[] | null;
352
344
  }
353
345
  export interface GetSymbolAtLocationParams {
354
346
  snapshot: number;
355
- project: string;
347
+ project: ProjectId;
356
348
  location: string;
357
349
  }
358
350
  export interface GetSymbolsAtLocationsParams {
359
351
  snapshot: number;
360
- project: string;
352
+ project: ProjectId;
361
353
  locations: readonly string[] | null;
362
354
  }
363
355
  export interface GetSymbolOfSourceFileParams {
364
356
  snapshot: number;
365
- project: string;
357
+ project: ProjectId;
366
358
  file: DocumentIdentifier;
367
359
  }
368
360
  export interface GetSymbolsOfSourceFilesParams {
369
361
  snapshot: number;
370
- project: string;
362
+ project: ProjectId;
371
363
  files: readonly DocumentIdentifier[] | null;
372
364
  }
373
365
  export interface GetTypeOfSymbolParams {
374
366
  snapshot: number;
375
- project: string;
367
+ project: ProjectId;
376
368
  symbol: number;
377
369
  }
378
370
  export interface TypeResponse {
@@ -424,25 +416,17 @@ export interface TypeResponse {
424
416
  }
425
417
  export interface GetTypesOfSymbolsParams {
426
418
  snapshot: number;
427
- project: string;
419
+ project: ProjectId;
428
420
  symbols: readonly number[] | null;
429
421
  }
430
422
  export interface GetSourceFileParams {
431
423
  snapshot: number;
432
- project: string;
424
+ project: ProjectId;
433
425
  file: DocumentIdentifier;
434
426
  }
435
- /**
436
- * SourceFileResponse contains the binary-encoded AST data for a source file.
437
- * The Data field is base64-encoded binary data in the encoder's format.
438
- */
439
- export interface SourceFileResponse {
440
- /** Data is the base64-encoded binary AST data in the encoder's format. */
441
- data: string;
442
- }
443
427
  export interface GetSourceFileNamesParams {
444
428
  snapshot: number;
445
- project: string;
429
+ project: ProjectId;
446
430
  }
447
431
  /** SourceFileMetadata carries program-stored metadata about a single source file. */
448
432
  export interface SourceFileMetadata {
@@ -452,9 +436,21 @@ export interface SourceFileMetadata {
452
436
  packageJsonDirectory: string;
453
437
  impliedNodeFormat: ModuleKind;
454
438
  }
439
+ export interface GetModeForUsageLocationParams {
440
+ snapshot: number;
441
+ project: ProjectId;
442
+ file: DocumentIdentifier;
443
+ usage: string;
444
+ }
445
+ export interface GetModeForResolutionAtIndexParams {
446
+ snapshot: number;
447
+ project: ProjectId;
448
+ file: DocumentIdentifier;
449
+ index: number;
450
+ }
455
451
  export interface GetResolvedModuleParams {
456
452
  snapshot: number;
457
- project: string;
453
+ project: ProjectId;
458
454
  file: DocumentIdentifier;
459
455
  moduleName: string;
460
456
  mode: ModuleKind;
@@ -471,13 +467,13 @@ export interface ResolvedModule {
471
467
  }
472
468
  export interface GetResolvedModuleFromModuleSpecifierParams {
473
469
  snapshot: number;
474
- project: string;
470
+ project: ProjectId;
475
471
  moduleSpecifier: string;
476
472
  sourceFile?: DocumentIdentifier | undefined;
477
473
  }
478
474
  export interface GetResolvedTypeReferenceDirectiveParams {
479
475
  snapshot: number;
480
- project: string;
476
+ project: ProjectId;
481
477
  file: DocumentIdentifier;
482
478
  typeDirectiveName: string;
483
479
  mode: ModuleKind;
@@ -491,7 +487,7 @@ export interface ResolvedTypeReferenceDirective {
491
487
  }
492
488
  export interface GetResolvedTypeReferenceDirectiveFromReferenceParams {
493
489
  snapshot: number;
494
- project: string;
490
+ project: ProjectId;
495
491
  sourceFile: DocumentIdentifier;
496
492
  typeDirectiveName: string;
497
493
  resolutionMode: ModuleKind;
@@ -499,11 +495,11 @@ export interface GetResolvedTypeReferenceDirectiveFromReferenceParams {
499
495
  /** GetProjectDiagnosticsParams are parameters for project-wide diagnostic methods. */
500
496
  export interface GetProjectDiagnosticsParams {
501
497
  snapshot: number;
502
- project: string;
498
+ project: ProjectId;
503
499
  }
504
500
  export interface ResolveNameParams {
505
501
  snapshot: number;
506
- project: string;
502
+ project: ProjectId;
507
503
  name: string;
508
504
  /** Optional: node handle for location context */
509
505
  location?: string | undefined;
@@ -522,7 +518,7 @@ export interface ResolveNameParams {
522
518
  */
523
519
  export interface GetSymbolsInScopeParams {
524
520
  snapshot: number;
525
- project: string;
521
+ project: ProjectId;
526
522
  /** Optional: node handle for location context */
527
523
  location?: string | undefined;
528
524
  /** Optional: file for location context (alternative to Location) */
@@ -534,7 +530,7 @@ export interface GetSymbolsInScopeParams {
534
530
  }
535
531
  export interface GetSignaturesOfTypeParams {
536
532
  snapshot: number;
537
- project: string;
533
+ project: ProjectId;
538
534
  type: number;
539
535
  kind: number;
540
536
  }
@@ -549,116 +545,116 @@ export interface SignatureResponse {
549
545
  }
550
546
  export interface GetResolvedSignatureParams {
551
547
  snapshot: number;
552
- project: string;
548
+ project: ProjectId;
553
549
  location: string;
554
550
  }
555
551
  export interface GetTypeAtLocationParams {
556
552
  snapshot: number;
557
- project: string;
553
+ project: ProjectId;
558
554
  location: string;
559
555
  }
560
556
  export interface GetTypeAtLocationsParams {
561
557
  snapshot: number;
562
- project: string;
558
+ project: ProjectId;
563
559
  locations: readonly string[] | null;
564
560
  }
565
561
  export interface GetTypeAtPositionParams {
566
562
  snapshot: number;
567
- project: string;
563
+ project: ProjectId;
568
564
  file: DocumentIdentifier;
569
565
  position: number;
570
566
  }
571
567
  export interface GetTypesAtPositionsParams {
572
568
  snapshot: number;
573
- project: string;
569
+ project: ProjectId;
574
570
  file: DocumentIdentifier;
575
571
  positions: readonly number[] | null;
576
572
  }
577
573
  /** GetSymbolPropertyParams is used for all symbol sub-property endpoints. */
578
574
  export interface GetSymbolPropertyParams {
579
575
  snapshot: number;
580
- project: string;
576
+ project: ProjectId;
581
577
  objectId: number;
582
578
  }
583
579
  /** GetTypePropertyParams is used for all type sub-property endpoints. */
584
580
  export interface GetTypePropertyParams {
585
581
  snapshot: number;
586
- project: string;
582
+ project: ProjectId;
587
583
  objectId: number;
588
584
  }
589
585
  /** GetSignaturePropertyParams is used for all signature sub-property endpoints. */
590
586
  export interface GetSignaturePropertyParams {
591
587
  snapshot: number;
592
- project: string;
588
+ project: ProjectId;
593
589
  objectId: number;
594
590
  }
595
591
  /** GetContextualTypeParams returns the contextual type for a node. */
596
592
  export interface GetContextualTypeParams {
597
593
  snapshot: number;
598
- project: string;
594
+ project: ProjectId;
599
595
  location: string;
600
596
  }
601
597
  export interface GetContextualTypeForArgumentParams {
602
598
  snapshot: number;
603
- project: string;
599
+ project: ProjectId;
604
600
  location: string;
605
601
  index: number;
606
602
  }
607
603
  /** CheckerTypeParams are parameters for checker methods that operate on a type. */
608
604
  export interface CheckerTypeParams {
609
605
  snapshot: number;
610
- project: string;
606
+ project: ProjectId;
611
607
  type: number;
612
608
  }
613
609
  /** GetBaseTypeOfLiteralTypeParams returns the base type of a literal type. */
614
610
  export interface GetBaseTypeOfLiteralTypeParams {
615
611
  snapshot: number;
616
- project: string;
612
+ project: ProjectId;
617
613
  type: number;
618
614
  }
619
615
  /** GetTypeFromTypeNodeParams are the parameters for the getTypeFromTypeNode method. */
620
616
  export interface GetTypeFromTypeNodeParams {
621
617
  snapshot: number;
622
- project: string;
618
+ project: ProjectId;
623
619
  location: string;
624
620
  }
625
621
  /** GetWidenedTypeParams are the parameters for the getWidenedType method. */
626
622
  export interface GetWidenedTypeParams {
627
623
  snapshot: number;
628
- project: string;
624
+ project: ProjectId;
629
625
  type: number;
630
626
  }
631
627
  /** GetParameterTypeParams are the parameters for the getParameterType method. */
632
628
  export interface GetParameterTypeParams {
633
629
  snapshot: number;
634
- project: string;
630
+ project: ProjectId;
635
631
  signature: number;
636
632
  index: number;
637
633
  }
638
634
  /** IsArrayLikeTypeParams checks whether a type is array-like. */
639
635
  export interface IsArrayLikeTypeParams {
640
636
  snapshot: number;
641
- project: string;
637
+ project: ProjectId;
642
638
  type: number;
643
639
  }
644
640
  /** IsTypeAssignableToParams checks assignability between two types. */
645
641
  export interface IsTypeAssignableToParams {
646
642
  snapshot: number;
647
- project: string;
643
+ project: ProjectId;
648
644
  source: number;
649
645
  target: number;
650
646
  }
651
647
  /** GetTypeOfSymbolAtLocationParams returns the narrowed type of a symbol at a specific location. */
652
648
  export interface GetTypeOfSymbolAtLocationParams {
653
649
  snapshot: number;
654
- project: string;
650
+ project: ProjectId;
655
651
  symbol: number;
656
652
  location: string;
657
653
  }
658
654
  /** TypeToTypeNodeParams are the parameters for the typeToTypeNode method. */
659
655
  export interface TypeToTypeNodeParams {
660
656
  snapshot: number;
661
- project: string;
657
+ project: ProjectId;
662
658
  type: number;
663
659
  location?: string | undefined;
664
660
  flags?: number | undefined;
@@ -666,7 +662,7 @@ export interface TypeToTypeNodeParams {
666
662
  /** SignatureToSignatureDeclarationParams are the parameters for the signatureToSignatureDeclaration method. */
667
663
  export interface SignatureToSignatureDeclarationParams {
668
664
  snapshot: number;
669
- project: string;
665
+ project: ProjectId;
670
666
  signature: number;
671
667
  kind: number;
672
668
  location?: string | undefined;
@@ -675,7 +671,7 @@ export interface SignatureToSignatureDeclarationParams {
675
671
  /** CheckerSignatureParams are parameters for checker methods that operate on a signature. */
676
672
  export interface CheckerSignatureParams {
677
673
  snapshot: number;
678
- project: string;
674
+ project: ProjectId;
679
675
  signature: number;
680
676
  }
681
677
  /** TypePredicateResponse is the response for getTypePredicateOfSignature. */
@@ -688,13 +684,13 @@ export interface TypePredicateResponse {
688
684
  /** GetPropertyOfTypeParams are parameters for getPropertyOfType (a named property of a type). */
689
685
  export interface GetPropertyOfTypeParams {
690
686
  snapshot: number;
691
- project: string;
687
+ project: ProjectId;
692
688
  type: number;
693
689
  name: string;
694
690
  }
695
691
  export interface GetIndexInfoOfTypeParams {
696
692
  snapshot: number;
697
- project: string;
693
+ project: ProjectId;
698
694
  type: number;
699
695
  kind: number;
700
696
  }
@@ -707,7 +703,7 @@ export interface IndexInfoResponse {
707
703
  }
708
704
  export interface GetImportAdderEditsParams {
709
705
  snapshot: number;
710
- project: string;
706
+ project: ProjectId;
711
707
  file: DocumentIdentifier;
712
708
  actions: readonly ImportAdderAction[] | null;
713
709
  }
@@ -719,19 +715,23 @@ export interface TextEdit {
719
715
  /** CheckerNodeParams are parameters for checker methods that operate on a node location. */
720
716
  export interface CheckerNodeParams {
721
717
  snapshot: number;
722
- project: string;
718
+ project: ProjectId;
723
719
  location: string;
724
720
  }
721
+ export interface ConstantValueResponse {
722
+ isNumber: boolean;
723
+ value: unknown;
724
+ }
725
725
  /** CheckerSymbolParams are parameters for checker methods that operate on a symbol. */
726
726
  export interface CheckerSymbolParams {
727
727
  snapshot: number;
728
- project: string;
728
+ project: ProjectId;
729
729
  symbol: number;
730
730
  }
731
731
  /** GetMemberInModuleExportsParams are parameters for getMemberInModuleExports. */
732
732
  export interface GetMemberInModuleExportsParams {
733
733
  snapshot: number;
734
- project: string;
734
+ project: ProjectId;
735
735
  symbol: number;
736
736
  name: string;
737
737
  }
@@ -746,14 +746,14 @@ export interface JSDocTagInfo {
746
746
  /** GetReferencesToSymbolInFileParams are the parameters for the getReferencesToSymbolInFile method. */
747
747
  export interface GetReferencesToSymbolInFileParams {
748
748
  snapshot: number;
749
- project: string;
749
+ project: ProjectId;
750
750
  file: DocumentIdentifier;
751
751
  symbol: number;
752
752
  }
753
753
  /** GetReferencedSymbolsForNodeParams are the parameters for the getReferencedSymbolsForNode method. */
754
754
  export interface GetReferencedSymbolsForNodeParams {
755
755
  snapshot: number;
756
- project: string;
756
+ project: ProjectId;
757
757
  node: string;
758
758
  position: number;
759
759
  }
@@ -766,7 +766,7 @@ export interface ReferencedSymbolEntry {
766
766
  /** GetSignatureUsagesParams are the parameters for the getSignatureUsages method. */
767
767
  export interface GetSignatureUsagesParams {
768
768
  snapshot: number;
769
- project: string;
769
+ project: ProjectId;
770
770
  signatureDecl: string;
771
771
  }
772
772
  /** SignatureUsageResponse represents a single usage of a signature as a name-call pair. */
@@ -777,7 +777,7 @@ export interface SignatureUsageResponse {
777
777
  /** GetCompletionsAtPositionParams are the parameters for the getCompletionsAtPosition method. */
778
778
  export interface GetCompletionsAtPositionParams {
779
779
  snapshot: number;
780
- project: string;
780
+ project: ProjectId;
781
781
  file: DocumentIdentifier;
782
782
  position: number;
783
783
  triggerCharacter?: string | undefined;
@@ -791,7 +791,7 @@ export interface CompletionInfoResponse {
791
791
  /** GetDiagnosticsParams are parameters for per-file diagnostic methods. */
792
792
  export interface GetDiagnosticsParams {
793
793
  snapshot: number;
794
- project: string;
794
+ project: ProjectId;
795
795
  files?: readonly DocumentIdentifier[] | undefined;
796
796
  }
797
797
  /** DiagnosticResponse is the API response for a single diagnostic. */
@@ -836,7 +836,7 @@ export interface PrintNodeParams {
836
836
  /** FormatNodeForInsertionParams are the parameters for the formatNodeForInsertion method. */
837
837
  export interface FormatNodeForInsertionParams {
838
838
  snapshot: number;
839
- project: string;
839
+ project: ProjectId;
840
840
  /** target file where the node will be inserted */
841
841
  file: DocumentIdentifier;
842
842
  /** UTF-16 code-unit offset of the insertion position in the target file */
@@ -846,7 +846,7 @@ export interface FormatNodeForInsertionParams {
846
846
  }
847
847
  export interface EmitParams {
848
848
  snapshot: number;
849
- project: string;
849
+ project: ProjectId;
850
850
  emitOnly?: number | undefined;
851
851
  }
852
852
  export interface EmitResponse {
@@ -866,13 +866,13 @@ export interface EmitOutputResponse {
866
866
  }
867
867
  export interface SelectedFilesEmitParams {
868
868
  snapshot: number;
869
- project: string;
869
+ project: ProjectId;
870
870
  files: readonly DocumentIdentifier[] | null;
871
871
  }
872
872
  /** GetIntrinsicTypeParams is used for intrinsic type getters (anyType, stringType, etc.). */
873
873
  export interface GetIntrinsicTypeParams {
874
874
  snapshot: number;
875
- project: string;
875
+ project: ProjectId;
876
876
  }
877
877
  /**
878
878
  * WellKnownSymbolsResponse carries the handle ids of the per-checker singleton
@@ -899,20 +899,58 @@ export interface ProfileResult {
899
899
  file: string;
900
900
  }
901
901
  export interface BatchRequest {
902
- method: "batchRequests" | "createProgram" | "emit" | "emitToString" | "formatNodeForInsertion" | "getAliasSymbolOfType" | "getAliasTypeArgumentsOfType" | "getAliasedSymbol" | "getAnyType" | "getApparentPropertiesOfType" | "getApparentType" | "getAwaitedType" | "getBaseConstraintOfType" | "getBaseTypeOfLiteralType" | "getBaseTypeOfType" | "getBaseTypes" | "getBigIntType" | "getBindDiagnostics" | "getBooleanType" | "getCheckTypeOfType" | "getCompletionsAtPosition" | "getConfigFileNames" | "getConfigFileParsingDiagnostics" | "getConfigSourceFile" | "getConstantValue" | "getConstraintOfType" | "getConstraintOfTypeParameter" | "getContextualType" | "getContextualTypeForArgument" | "getDeclarationDiagnostics" | "getDeclarationEmit" | "getDeclaredTypeOfSymbol" | "getDefaultFromTypeParameter" | "getDefaultProjectForFile" | "getDocumentationComment" | "getESSymbolType" | "getExportSpecifierLocalTargetSymbol" | "getExportSymbolOfSymbol" | "getExportSymbolOfSymbolForChecker" | "getExportsOfModule" | "getExportsOfSymbol" | "getExtendsTypeOfType" | "getFalseTypeOfConditionalType" | "getFreshTypeOfType" | "getFullyQualifiedName" | "getGlobalDiagnostics" | "getImmediateAliasedSymbol" | "getImportAdderEdits" | "getIndexInfoOfType" | "getIndexInfosOfType" | "getIndexTypeOfType" | "getIndexTypeOfTypeByKind" | "getJavaScriptEmit" | "getJsDocTags" | "getLocalTypeParametersOfType" | "getMemberInModuleExports" | "getMembersOfSymbol" | "getNeverType" | "getNonMissingTypeOfSymbol" | "getNonNullableType" | "getNonPrimitiveType" | "getNullType" | "getNumberType" | "getObjectTypeOfType" | "getOuterTypeParametersOfType" | "getParameterType" | "getParametersOfSignature" | "getParentOfSymbol" | "getProgramDiagnostics" | "getPropertiesOfType" | "getPropertyOfType" | "getReducedType" | "getReferencedSymbolsForNode" | "getReferencesToSymbolInFile" | "getRegularTypeOfType" | "getResolvedModule" | "getResolvedModuleFromModuleSpecifier" | "getResolvedSignature" | "getResolvedTypeReferenceDirective" | "getResolvedTypeReferenceDirectiveFromTypeReferenceDirective" | "getRestTypeOfSignature" | "getReturnTypeOfSignature" | "getSemanticDiagnostics" | "getShorthandAssignmentValueSymbol" | "getSignatureFromDeclaration" | "getSignatureUsages" | "getSignaturesOfType" | "getSourceFile" | "getSourceFileMetadata" | "getSourceFileNames" | "getStringType" | "getSuggestionDiagnostics" | "getSymbolAtLocation" | "getSymbolAtPosition" | "getSymbolOfSourceFile" | "getSymbolOfType" | "getSymbolsAtLocations" | "getSymbolsAtPositions" | "getSymbolsInScope" | "getSymbolsOfSourceFiles" | "getSyntacticDiagnostics" | "getTargetOfSignature" | "getTargetOfType" | "getTargetSymbol" | "getThisParameterOfSignature" | "getThisTypeOfType" | "getTrueTypeOfConditionalType" | "getTypeArguments" | "getTypeAtLocation" | "getTypeAtLocations" | "getTypeAtPosition" | "getTypeFromTypeNode" | "getTypeOfPropertyOfType" | "getTypeOfSymbol" | "getTypeOfSymbolAtLocation" | "getTypeParameterAtPosition" | "getTypeParametersOfSignature" | "getTypeParametersOfType" | "getTypePredicateOfSignature" | "getTypesAtPositions" | "getTypesOfSymbols" | "getTypesOfType" | "getUndefinedType" | "getUnknownType" | "getVoidType" | "getWellKnownSignatures" | "getWellKnownSymbols" | "getWidenedType" | "initialize" | "isArrayLikeType" | "isArrayType" | "isContextSensitive" | "isReadonlySymbol" | "isTypeAssignableTo" | "parseCommandLine" | "parseConfigFile" | "parseJsonConfigFileContent" | "printNode" | "readConfigFile" | "release" | "resolveName" | "saveHeapProfile" | "signatureToSignatureDeclaration" | "startCPUProfile" | "stopCPUProfile" | "transpileDeclaration" | "transpileDeclarationFromFile" | "transpileModule" | "transpileModuleFromFile" | "typeToString" | "typeToTypeNode" | "updateSnapshot" | "updateTemporarySnapshot";
902
+ method: "batchRequests" | "createSnapshot" | "createSourceFile" | "createSourceFileFromFile" | "emit" | "emitToString" | "formatNodeForInsertion" | "getAliasSymbolOfType" | "getAliasTypeArgumentsOfType" | "getAliasedSymbol" | "getAnyType" | "getApparentPropertiesOfType" | "getApparentType" | "getAwaitedType" | "getBaseConstraintOfType" | "getBaseTypeOfLiteralType" | "getBaseTypeOfType" | "getBaseTypes" | "getBigIntType" | "getBindDiagnostics" | "getBooleanType" | "getCheckTypeOfType" | "getCompletionsAtPosition" | "getConfigFileNames" | "getConfigFileParsingDiagnostics" | "getConfigSourceFile" | "getConstantValue" | "getConstraintOfType" | "getConstraintOfTypeParameter" | "getContextualType" | "getContextualTypeForArgument" | "getCurrentLanguageServerSnapshot" | "getDeclarationDiagnostics" | "getDeclarationEmit" | "getDeclaredTypeOfSymbol" | "getDefaultFromTypeParameter" | "getDefaultProjectForFile" | "getDocumentationComment" | "getESSymbolType" | "getExportSpecifierLocalTargetSymbol" | "getExportSymbolOfSymbol" | "getExportSymbolOfSymbolForChecker" | "getExportsOfModule" | "getExportsOfSymbol" | "getExtendsTypeOfType" | "getFalseTypeOfConditionalType" | "getFreshTypeOfType" | "getFullyQualifiedName" | "getGlobalDiagnostics" | "getImmediateAliasedSymbol" | "getImportAdderEdits" | "getIndexInfoOfType" | "getIndexInfosOfType" | "getIndexTypeOfType" | "getIndexTypeOfTypeByKind" | "getJavaScriptEmit" | "getJsDocTags" | "getLocalTypeParametersOfType" | "getMemberInModuleExports" | "getMembersOfSymbol" | "getModeForResolutionAtIndex" | "getModeForUsageLocation" | "getNeverType" | "getNonMissingTypeOfSymbol" | "getNonNullableType" | "getNonPrimitiveType" | "getNullType" | "getNumberType" | "getObjectTypeOfType" | "getOuterTypeParametersOfType" | "getParameterType" | "getParametersOfSignature" | "getParentOfSymbol" | "getProgramDiagnostics" | "getPropertiesOfType" | "getPropertyOfType" | "getReducedType" | "getReferencedSymbolsForNode" | "getReferencesToSymbolInFile" | "getRegularTypeOfType" | "getResolvedModule" | "getResolvedModuleFromModuleSpecifier" | "getResolvedSignature" | "getResolvedTypeReferenceDirective" | "getResolvedTypeReferenceDirectiveFromTypeReferenceDirective" | "getRestTypeOfSignature" | "getReturnTypeOfSignature" | "getSemanticDiagnostics" | "getShorthandAssignmentValueSymbol" | "getSignatureFromDeclaration" | "getSignatureUsages" | "getSignaturesOfType" | "getSourceFile" | "getSourceFileMetadata" | "getSourceFileNames" | "getStringType" | "getSuggestionDiagnostics" | "getSymbolAtLocation" | "getSymbolAtPosition" | "getSymbolOfSourceFile" | "getSymbolOfType" | "getSymbolsAtLocations" | "getSymbolsAtPositions" | "getSymbolsInScope" | "getSymbolsOfSourceFiles" | "getSyntacticDiagnostics" | "getTargetOfSignature" | "getTargetOfType" | "getTargetSymbol" | "getThisParameterOfSignature" | "getThisTypeOfType" | "getTrueTypeOfConditionalType" | "getTypeArguments" | "getTypeAtLocation" | "getTypeAtLocations" | "getTypeAtPosition" | "getTypeFromTypeNode" | "getTypeOfPropertyOfType" | "getTypeOfSymbol" | "getTypeOfSymbolAtLocation" | "getTypeParameterAtPosition" | "getTypeParametersOfSignature" | "getTypeParametersOfType" | "getTypePredicateOfSignature" | "getTypesAtPositions" | "getTypesOfSymbols" | "getTypesOfType" | "getUndefinedType" | "getUnknownType" | "getVoidType" | "getWellKnownSignatures" | "getWellKnownSymbols" | "getWidenedType" | "initialize" | "isArrayLikeType" | "isArrayType" | "isContextSensitive" | "isReadonlySymbol" | "isTypeAssignableTo" | "parseCommandLine" | "parseConfigFile" | "parseJsonConfigFileContent" | "printNode" | "readConfigFile" | "release" | "resolveName" | "saveHeapProfile" | "signatureToSignatureDeclaration" | "startCPUProfile" | "stopCPUProfile" | "transpileDeclaration" | "transpileDeclarationFromFile" | "transpileModule" | "transpileModuleFromFile" | "typeToString" | "typeToTypeNode" | "updateSnapshot";
903
903
  params?: unknown | undefined;
904
904
  }
905
905
  export interface BatchResponse {
906
- method: "batchRequests" | "createProgram" | "emit" | "emitToString" | "formatNodeForInsertion" | "getAliasSymbolOfType" | "getAliasTypeArgumentsOfType" | "getAliasedSymbol" | "getAnyType" | "getApparentPropertiesOfType" | "getApparentType" | "getAwaitedType" | "getBaseConstraintOfType" | "getBaseTypeOfLiteralType" | "getBaseTypeOfType" | "getBaseTypes" | "getBigIntType" | "getBindDiagnostics" | "getBooleanType" | "getCheckTypeOfType" | "getCompletionsAtPosition" | "getConfigFileNames" | "getConfigFileParsingDiagnostics" | "getConfigSourceFile" | "getConstantValue" | "getConstraintOfType" | "getConstraintOfTypeParameter" | "getContextualType" | "getContextualTypeForArgument" | "getDeclarationDiagnostics" | "getDeclarationEmit" | "getDeclaredTypeOfSymbol" | "getDefaultFromTypeParameter" | "getDefaultProjectForFile" | "getDocumentationComment" | "getESSymbolType" | "getExportSpecifierLocalTargetSymbol" | "getExportSymbolOfSymbol" | "getExportSymbolOfSymbolForChecker" | "getExportsOfModule" | "getExportsOfSymbol" | "getExtendsTypeOfType" | "getFalseTypeOfConditionalType" | "getFreshTypeOfType" | "getFullyQualifiedName" | "getGlobalDiagnostics" | "getImmediateAliasedSymbol" | "getImportAdderEdits" | "getIndexInfoOfType" | "getIndexInfosOfType" | "getIndexTypeOfType" | "getIndexTypeOfTypeByKind" | "getJavaScriptEmit" | "getJsDocTags" | "getLocalTypeParametersOfType" | "getMemberInModuleExports" | "getMembersOfSymbol" | "getNeverType" | "getNonMissingTypeOfSymbol" | "getNonNullableType" | "getNonPrimitiveType" | "getNullType" | "getNumberType" | "getObjectTypeOfType" | "getOuterTypeParametersOfType" | "getParameterType" | "getParametersOfSignature" | "getParentOfSymbol" | "getProgramDiagnostics" | "getPropertiesOfType" | "getPropertyOfType" | "getReducedType" | "getReferencedSymbolsForNode" | "getReferencesToSymbolInFile" | "getRegularTypeOfType" | "getResolvedModule" | "getResolvedModuleFromModuleSpecifier" | "getResolvedSignature" | "getResolvedTypeReferenceDirective" | "getResolvedTypeReferenceDirectiveFromTypeReferenceDirective" | "getRestTypeOfSignature" | "getReturnTypeOfSignature" | "getSemanticDiagnostics" | "getShorthandAssignmentValueSymbol" | "getSignatureFromDeclaration" | "getSignatureUsages" | "getSignaturesOfType" | "getSourceFile" | "getSourceFileMetadata" | "getSourceFileNames" | "getStringType" | "getSuggestionDiagnostics" | "getSymbolAtLocation" | "getSymbolAtPosition" | "getSymbolOfSourceFile" | "getSymbolOfType" | "getSymbolsAtLocations" | "getSymbolsAtPositions" | "getSymbolsInScope" | "getSymbolsOfSourceFiles" | "getSyntacticDiagnostics" | "getTargetOfSignature" | "getTargetOfType" | "getTargetSymbol" | "getThisParameterOfSignature" | "getThisTypeOfType" | "getTrueTypeOfConditionalType" | "getTypeArguments" | "getTypeAtLocation" | "getTypeAtLocations" | "getTypeAtPosition" | "getTypeFromTypeNode" | "getTypeOfPropertyOfType" | "getTypeOfSymbol" | "getTypeOfSymbolAtLocation" | "getTypeParameterAtPosition" | "getTypeParametersOfSignature" | "getTypeParametersOfType" | "getTypePredicateOfSignature" | "getTypesAtPositions" | "getTypesOfSymbols" | "getTypesOfType" | "getUndefinedType" | "getUnknownType" | "getVoidType" | "getWellKnownSignatures" | "getWellKnownSymbols" | "getWidenedType" | "initialize" | "isArrayLikeType" | "isArrayType" | "isContextSensitive" | "isReadonlySymbol" | "isTypeAssignableTo" | "parseCommandLine" | "parseConfigFile" | "parseJsonConfigFileContent" | "printNode" | "readConfigFile" | "release" | "resolveName" | "saveHeapProfile" | "signatureToSignatureDeclaration" | "startCPUProfile" | "stopCPUProfile" | "transpileDeclaration" | "transpileDeclarationFromFile" | "transpileModule" | "transpileModuleFromFile" | "typeToString" | "typeToTypeNode" | "updateSnapshot" | "updateTemporarySnapshot";
906
+ method: "batchRequests" | "createSnapshot" | "createSourceFile" | "createSourceFileFromFile" | "emit" | "emitToString" | "formatNodeForInsertion" | "getAliasSymbolOfType" | "getAliasTypeArgumentsOfType" | "getAliasedSymbol" | "getAnyType" | "getApparentPropertiesOfType" | "getApparentType" | "getAwaitedType" | "getBaseConstraintOfType" | "getBaseTypeOfLiteralType" | "getBaseTypeOfType" | "getBaseTypes" | "getBigIntType" | "getBindDiagnostics" | "getBooleanType" | "getCheckTypeOfType" | "getCompletionsAtPosition" | "getConfigFileNames" | "getConfigFileParsingDiagnostics" | "getConfigSourceFile" | "getConstantValue" | "getConstraintOfType" | "getConstraintOfTypeParameter" | "getContextualType" | "getContextualTypeForArgument" | "getCurrentLanguageServerSnapshot" | "getDeclarationDiagnostics" | "getDeclarationEmit" | "getDeclaredTypeOfSymbol" | "getDefaultFromTypeParameter" | "getDefaultProjectForFile" | "getDocumentationComment" | "getESSymbolType" | "getExportSpecifierLocalTargetSymbol" | "getExportSymbolOfSymbol" | "getExportSymbolOfSymbolForChecker" | "getExportsOfModule" | "getExportsOfSymbol" | "getExtendsTypeOfType" | "getFalseTypeOfConditionalType" | "getFreshTypeOfType" | "getFullyQualifiedName" | "getGlobalDiagnostics" | "getImmediateAliasedSymbol" | "getImportAdderEdits" | "getIndexInfoOfType" | "getIndexInfosOfType" | "getIndexTypeOfType" | "getIndexTypeOfTypeByKind" | "getJavaScriptEmit" | "getJsDocTags" | "getLocalTypeParametersOfType" | "getMemberInModuleExports" | "getMembersOfSymbol" | "getModeForResolutionAtIndex" | "getModeForUsageLocation" | "getNeverType" | "getNonMissingTypeOfSymbol" | "getNonNullableType" | "getNonPrimitiveType" | "getNullType" | "getNumberType" | "getObjectTypeOfType" | "getOuterTypeParametersOfType" | "getParameterType" | "getParametersOfSignature" | "getParentOfSymbol" | "getProgramDiagnostics" | "getPropertiesOfType" | "getPropertyOfType" | "getReducedType" | "getReferencedSymbolsForNode" | "getReferencesToSymbolInFile" | "getRegularTypeOfType" | "getResolvedModule" | "getResolvedModuleFromModuleSpecifier" | "getResolvedSignature" | "getResolvedTypeReferenceDirective" | "getResolvedTypeReferenceDirectiveFromTypeReferenceDirective" | "getRestTypeOfSignature" | "getReturnTypeOfSignature" | "getSemanticDiagnostics" | "getShorthandAssignmentValueSymbol" | "getSignatureFromDeclaration" | "getSignatureUsages" | "getSignaturesOfType" | "getSourceFile" | "getSourceFileMetadata" | "getSourceFileNames" | "getStringType" | "getSuggestionDiagnostics" | "getSymbolAtLocation" | "getSymbolAtPosition" | "getSymbolOfSourceFile" | "getSymbolOfType" | "getSymbolsAtLocations" | "getSymbolsAtPositions" | "getSymbolsInScope" | "getSymbolsOfSourceFiles" | "getSyntacticDiagnostics" | "getTargetOfSignature" | "getTargetOfType" | "getTargetSymbol" | "getThisParameterOfSignature" | "getThisTypeOfType" | "getTrueTypeOfConditionalType" | "getTypeArguments" | "getTypeAtLocation" | "getTypeAtLocations" | "getTypeAtPosition" | "getTypeFromTypeNode" | "getTypeOfPropertyOfType" | "getTypeOfSymbol" | "getTypeOfSymbolAtLocation" | "getTypeParameterAtPosition" | "getTypeParametersOfSignature" | "getTypeParametersOfType" | "getTypePredicateOfSignature" | "getTypesAtPositions" | "getTypesOfSymbols" | "getTypesOfType" | "getUndefinedType" | "getUnknownType" | "getVoidType" | "getWellKnownSignatures" | "getWellKnownSymbols" | "getWidenedType" | "initialize" | "isArrayLikeType" | "isArrayType" | "isContextSensitive" | "isReadonlySymbol" | "isTypeAssignableTo" | "parseCommandLine" | "parseConfigFile" | "parseJsonConfigFileContent" | "printNode" | "readConfigFile" | "release" | "resolveName" | "saveHeapProfile" | "signatureToSignatureDeclaration" | "startCPUProfile" | "stopCPUProfile" | "transpileDeclaration" | "transpileDeclarationFromFile" | "transpileModule" | "transpileModuleFromFile" | "typeToString" | "typeToTypeNode" | "updateSnapshot";
907
907
  result: unknown;
908
908
  error?: string | undefined;
909
909
  }
910
910
  /**
911
- * APIFileChanges describes file changes to apply when updating a snapshot.
912
- * Either InvalidateAll is true (discard all caches) or Changed/Created/Deleted
913
- * list individual documents.
911
+ * SnapshotRequestChangesParams describes project, file, and program changes to apply
912
+ * while creating or updating a snapshot.
913
+ */
914
+ export interface SnapshotRequestChangesParams {
915
+ /** OpenProjects lists tsconfig.json files to open/load in the new snapshot. */
916
+ openProjects?: readonly DocumentIdentifier[] | undefined;
917
+ /**
918
+ * CloseProjects lists tsconfig.json files to release in the new snapshot.
919
+ * A project is only unloaded once every API client that opened it closes it.
920
+ */
921
+ closeProjects?: readonly DocumentIdentifier[] | undefined;
922
+ /**
923
+ * OpenFiles lists files to open in the new snapshot, mirroring LSP's
924
+ * textDocument/didOpen. For each file, ancestor directories are searched for a
925
+ * tsconfig that contains it; if found, that configured project is loaded and
926
+ * becomes the file's default project. Otherwise the file is loaded into the
927
+ * inferred project (e.g. a node_modules d.ts not in any project's import graph).
928
+ */
929
+ openFiles?: readonly DocumentIdentifier[] | undefined;
930
+ /**
931
+ * CloseFiles lists files to release in the new snapshot. A file is only fully
932
+ * closed once every API client that opened it closes it.
933
+ */
934
+ closeFiles?: readonly DocumentIdentifier[] | undefined;
935
+ /** CreatePrograms describes synthetic programs to create in the snapshot. */
936
+ createPrograms?: readonly CreateSnapshotProgramParams[] | undefined;
937
+ /** ReconfigurePrograms replaces the configuration of existing synthetic programs. */
938
+ reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
939
+ /** RemovePrograms lists synthetic project handles to remove from the snapshot. */
940
+ removePrograms?: readonly SyntheticProjectId[] | undefined;
941
+ /**
942
+ * EnsurePrograms identifies projects whose programs should be updated if dirty,
943
+ * or all contained projects when true.
944
+ */
945
+ ensurePrograms?: EnsurePrograms | undefined;
946
+ }
947
+ /**
948
+ * FileNotifications describes changes to files that have occurred on the host
949
+ * file system, used to notify the session to reload cached files and reevaluate
950
+ * tsconfig.json `include` globs. Either InvalidateAll is true (discard all caches)
951
+ * or Changed/Created/Deleted list individual documents.
914
952
  */
915
- export interface APIFileChanges {
953
+ export interface FileNotifications {
916
954
  invalidateAll?: boolean | undefined;
917
955
  changed?: DocumentIdentifier[] | undefined;
918
956
  created?: DocumentIdentifier[] | undefined;
@@ -937,8 +975,8 @@ export interface RequestFileSystem {
937
975
  removedPaths?: string[] | undefined;
938
976
  }
939
977
  /**
940
- * SnapshotChanges describes what changed between the previous latest snapshot
941
- * and the newly created snapshot. Changes are reported per-project so clients
978
+ * SnapshotChanges describes what changed between a response base and a new
979
+ * snapshot. Changes are reported per-project so clients
942
980
  * can track cache refs at the (snapshot, project) level.
943
981
  */
944
982
  export interface SnapshotChanges {
@@ -951,16 +989,17 @@ export interface SnapshotChanges {
951
989
  * RemovedProjects lists project handles that were present in the previous
952
990
  * snapshot but absent from the new one.
953
991
  */
954
- removedProjects?: string[] | undefined;
992
+ removedProjects?: ProjectId[] | undefined;
955
993
  }
956
- export interface CreateProgramOptions {
957
- compilerOptions: CompilerOptions;
958
- projectReferences?: ProjectReference[] | undefined;
959
- configFileParsingDiagnostics?: DiagnosticResponse[] | undefined;
994
+ export interface SnapshotOperationResponse {
995
+ createdPrograms?: SyntheticProjectId[] | undefined;
996
+ openedFiles?: OpenedFileOperationResult[] | undefined;
960
997
  }
961
- export interface CreateProgramOldProgramParams {
962
- snapshot?: number | undefined;
963
- project?: string | undefined;
998
+ /**
999
+ * LanguageServerSnapshotChanges describes API-driven changes to adopt into the
1000
+ * language server's canonical state.
1001
+ */
1002
+ export interface LanguageServerSnapshotChanges extends SnapshotRequestChangesParams {
964
1003
  }
965
1004
  /** CompilerOptions contains the compiler options exposed by the API. */
966
1005
  export interface CompilerOptions {
@@ -1081,6 +1120,9 @@ export interface TypeAcquisition {
1081
1120
  exclude?: string[] | undefined;
1082
1121
  disableFilenameBasedTypeAcquisition?: boolean | undefined;
1083
1122
  }
1123
+ export interface CreateSourceFileOptions {
1124
+ scriptKind?: ScriptKind | undefined;
1125
+ }
1084
1126
  export interface TranspileOptions {
1085
1127
  compilerOptions?: CompilerOptions | undefined;
1086
1128
  fileName?: string | undefined;
@@ -1121,6 +1163,15 @@ export interface EmitOutputFile {
1121
1163
  text: string;
1122
1164
  sourceFileName?: string | undefined;
1123
1165
  }
1166
+ export interface CreateSnapshotProgramParams {
1167
+ rootFiles: readonly DocumentIdentifier[] | null;
1168
+ options: CreateProgramOptions;
1169
+ }
1170
+ export interface ReconfigureSnapshotProgramParams {
1171
+ id: SyntheticProjectId;
1172
+ rootFiles: readonly DocumentIdentifier[] | null;
1173
+ options: CreateProgramOptions;
1174
+ }
1124
1175
  /**
1125
1176
  * RequestDirectoryEntries is a cached directory listing. Entry names are
1126
1177
  * relative to the directory, matching vfs.GetAccessibleEntries.
@@ -1149,9 +1200,17 @@ export interface ProjectFileChanges {
1149
1200
  /** DeletedFiles lists source file paths removed from the project's program. */
1150
1201
  deletedFiles?: string[] | undefined;
1151
1202
  }
1203
+ export interface OpenedFileOperationResult {
1204
+ project: ProjectId;
1205
+ }
1152
1206
  /** CompletionEntryLabelDetailsResponse holds additional label display text for a completion entry. */
1153
1207
  export interface CompletionEntryLabelDetailsResponse {
1154
1208
  detail?: string | undefined;
1155
1209
  description?: string | undefined;
1156
1210
  }
1211
+ export interface CreateProgramOptions {
1212
+ compilerOptions: CompilerOptions;
1213
+ projectReferences?: ProjectReference[] | undefined;
1214
+ configFileParsingDiagnostics?: DiagnosticResponse[] | undefined;
1215
+ }
1157
1216
  //# sourceMappingURL=proto.generated.d.ts.map