@schematics/angular 18.1.0-next.0 → 18.1.0-next.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 (113) hide show
  1. package/app-shell/index.d.ts +1 -1
  2. package/app-shell/index.js +2 -2
  3. package/application/files/common-files/tsconfig.app.json.template +2 -1
  4. package/application/files/common-files/tsconfig.spec.json.template +2 -1
  5. package/application/index.d.ts +1 -1
  6. package/application/index.js +2 -2
  7. package/class/index.d.ts +1 -1
  8. package/class/index.js +2 -2
  9. package/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template +1 -1
  10. package/component/index.d.ts +1 -1
  11. package/component/index.js +2 -2
  12. package/config/index.d.ts +1 -1
  13. package/config/index.js +2 -2
  14. package/directive/index.d.ts +1 -1
  15. package/directive/index.js +2 -2
  16. package/e2e/files/tsconfig.json.template +2 -1
  17. package/e2e/index.d.ts +1 -1
  18. package/e2e/index.js +2 -2
  19. package/enum/index.d.ts +1 -1
  20. package/enum/index.js +2 -2
  21. package/environments/index.d.ts +1 -1
  22. package/environments/index.js +2 -2
  23. package/guard/index.d.ts +1 -1
  24. package/guard/index.js +2 -2
  25. package/interceptor/index.d.ts +1 -1
  26. package/interceptor/index.js +2 -2
  27. package/interface/index.d.ts +1 -1
  28. package/interface/index.js +2 -2
  29. package/library/files/tsconfig.lib.json.template +2 -1
  30. package/library/files/tsconfig.lib.prod.json.template +2 -1
  31. package/library/files/tsconfig.spec.json.template +2 -1
  32. package/library/index.d.ts +1 -1
  33. package/library/index.js +2 -2
  34. package/migrations/use-application-builder/css-import-lexer.d.ts +1 -1
  35. package/migrations/use-application-builder/css-import-lexer.js +2 -3
  36. package/migrations/use-application-builder/migration.d.ts +1 -1
  37. package/migrations/use-application-builder/migration.js +2 -2
  38. package/module/index.d.ts +1 -1
  39. package/module/index.js +2 -2
  40. package/ng-new/index.d.ts +1 -1
  41. package/ng-new/index.js +2 -2
  42. package/ng-new/schema.d.ts +1 -1
  43. package/ng-new/schema.json +1 -1
  44. package/package.json +12 -3
  45. package/pipe/index.d.ts +1 -1
  46. package/pipe/index.js +2 -2
  47. package/resolver/index.d.ts +1 -1
  48. package/resolver/index.js +2 -2
  49. package/server/files/root/tsconfig.server.json.template +2 -1
  50. package/server/index.d.ts +1 -1
  51. package/server/index.js +2 -2
  52. package/service/index.d.ts +1 -1
  53. package/service/index.js +2 -2
  54. package/service-worker/index.d.ts +1 -1
  55. package/service-worker/index.js +2 -2
  56. package/ssr/index.d.ts +1 -1
  57. package/ssr/index.js +2 -2
  58. package/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +1008 -1413
  59. package/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +183622 -179407
  60. package/utility/add-declaration-to-ng-module.d.ts +1 -1
  61. package/utility/add-declaration-to-ng-module.js +2 -3
  62. package/utility/ast-utils.d.ts +1 -1
  63. package/utility/ast-utils.js +18 -19
  64. package/utility/change.d.ts +1 -1
  65. package/utility/change.js +3 -3
  66. package/utility/dependencies.d.ts +1 -1
  67. package/utility/dependencies.js +5 -5
  68. package/utility/dependency.d.ts +1 -1
  69. package/utility/dependency.js +3 -3
  70. package/utility/eol.d.ts +1 -1
  71. package/utility/eol.js +2 -3
  72. package/utility/find-module.d.ts +1 -1
  73. package/utility/find-module.js +5 -5
  74. package/utility/generate-from-files.d.ts +1 -1
  75. package/utility/generate-from-files.js +2 -3
  76. package/utility/index.d.ts +1 -1
  77. package/utility/index.js +1 -1
  78. package/utility/json-file.d.ts +1 -1
  79. package/utility/json-file.js +1 -1
  80. package/utility/latest-versions.d.ts +1 -1
  81. package/utility/latest-versions.js +3 -3
  82. package/utility/ng-ast-utils.d.ts +1 -1
  83. package/utility/ng-ast-utils.js +4 -5
  84. package/utility/parse-name.d.ts +1 -1
  85. package/utility/parse-name.js +2 -3
  86. package/utility/paths.d.ts +1 -1
  87. package/utility/paths.js +2 -3
  88. package/utility/project-targets.d.ts +1 -1
  89. package/utility/project-targets.js +2 -3
  90. package/utility/standalone/app_config.d.ts +1 -1
  91. package/utility/standalone/app_config.js +2 -3
  92. package/utility/standalone/code_block.d.ts +1 -1
  93. package/utility/standalone/code_block.js +1 -1
  94. package/utility/standalone/index.d.ts +1 -1
  95. package/utility/standalone/index.js +1 -1
  96. package/utility/standalone/rules.d.ts +1 -1
  97. package/utility/standalone/rules.js +3 -4
  98. package/utility/standalone/util.d.ts +1 -1
  99. package/utility/standalone/util.js +7 -8
  100. package/utility/validation.d.ts +1 -1
  101. package/utility/validation.js +4 -4
  102. package/utility/workspace-models.d.ts +1 -1
  103. package/utility/workspace-models.js +1 -1
  104. package/utility/workspace.d.ts +1 -1
  105. package/utility/workspace.js +9 -9
  106. package/web-worker/files/worker-tsconfig/tsconfig.worker.json.template +1 -1
  107. package/web-worker/index.d.ts +1 -1
  108. package/web-worker/index.js +2 -2
  109. package/workspace/files/tsconfig.json.template +2 -2
  110. package/workspace/index.d.ts +1 -1
  111. package/workspace/index.js +2 -2
  112. package/workspace/schema.d.ts +1 -1
  113. package/workspace/schema.json +1 -1
@@ -15,92 +15,38 @@ and limitations under the License.
15
15
 
16
16
  declare namespace ts {
17
17
  namespace server {
18
- type ActionSet = "action::set";
19
- type ActionInvalidate = "action::invalidate";
20
- type ActionPackageInstalled = "action::packageInstalled";
21
- type EventTypesRegistry = "event::typesRegistry";
22
- type EventBeginInstallTypes = "event::beginInstallTypes";
23
- type EventEndInstallTypes = "event::endInstallTypes";
24
- type EventInitializationFailed = "event::initializationFailed";
25
- type ActionWatchTypingLocations = "action::watchTypingLocations";
26
- interface TypingInstallerResponse {
27
- readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed | ActionWatchTypingLocations;
28
- }
29
- interface TypingInstallerRequestWithProjectName {
30
- readonly projectName: string;
31
- }
32
- interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
33
- readonly fileNames: string[];
34
- readonly projectRootPath: Path;
35
- readonly compilerOptions: CompilerOptions;
36
- readonly typeAcquisition: TypeAcquisition;
37
- readonly unresolvedImports: SortedReadonlyArray<string>;
38
- readonly cachePath?: string;
39
- readonly kind: "discover";
40
- }
41
- interface CloseProject extends TypingInstallerRequestWithProjectName {
42
- readonly kind: "closeProject";
43
- }
44
- interface TypesRegistryRequest {
45
- readonly kind: "typesRegistry";
46
- }
47
- interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
48
- readonly kind: "installPackage";
49
- readonly fileName: Path;
50
- readonly packageName: string;
51
- readonly projectRootPath: Path;
52
- readonly id: number;
53
- }
54
- interface PackageInstalledResponse extends ProjectResponse {
55
- readonly kind: ActionPackageInstalled;
56
- readonly id: number;
57
- readonly success: boolean;
58
- readonly message: string;
59
- }
60
- interface InitializationFailedResponse extends TypingInstallerResponse {
61
- readonly kind: EventInitializationFailed;
62
- readonly message: string;
63
- readonly stack?: string;
64
- }
65
- interface ProjectResponse extends TypingInstallerResponse {
66
- readonly projectName: string;
67
- }
68
- interface InvalidateCachedTypings extends ProjectResponse {
69
- readonly kind: ActionInvalidate;
70
- }
71
- interface InstallTypes extends ProjectResponse {
72
- readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
73
- readonly eventId: number;
74
- readonly typingsInstallerVersion: string;
75
- readonly packagesToInstall: readonly string[];
76
- }
77
- interface BeginInstallTypes extends InstallTypes {
78
- readonly kind: EventBeginInstallTypes;
79
- }
80
- interface EndInstallTypes extends InstallTypes {
81
- readonly kind: EventEndInstallTypes;
82
- readonly installSuccess: boolean;
83
- }
84
- interface InstallTypingHost extends JsTyping.TypingResolutionHost {
85
- useCaseSensitiveFileNames: boolean;
86
- writeFile(path: string, content: string): void;
87
- createDirectory(path: string): void;
88
- getCurrentDirectory?(): string;
89
- }
90
- interface SetTypings extends ProjectResponse {
91
- readonly typeAcquisition: TypeAcquisition;
92
- readonly compilerOptions: CompilerOptions;
93
- readonly typings: string[];
94
- readonly unresolvedImports: SortedReadonlyArray<string>;
95
- readonly kind: ActionSet;
96
- }
97
- interface WatchTypingLocations extends ProjectResponse {
98
- /** if files is undefined, retain same set of watchers */
99
- readonly files: readonly string[] | undefined;
100
- readonly kind: ActionWatchTypingLocations;
101
- }
102
18
  namespace protocol {
103
- enum CommandTypes {
19
+ export import ApplicableRefactorInfo = ts.ApplicableRefactorInfo;
20
+ export import ClassificationType = ts.ClassificationType;
21
+ export import CompletionsTriggerCharacter = ts.CompletionsTriggerCharacter;
22
+ export import CompletionTriggerKind = ts.CompletionTriggerKind;
23
+ export import InlayHintKind = ts.InlayHintKind;
24
+ export import OrganizeImportsMode = ts.OrganizeImportsMode;
25
+ export import RefactorActionInfo = ts.RefactorActionInfo;
26
+ export import RefactorTriggerReason = ts.RefactorTriggerReason;
27
+ export import RenameInfoFailure = ts.RenameInfoFailure;
28
+ export import SemicolonPreference = ts.SemicolonPreference;
29
+ export import SignatureHelpCharacterTypedReason = ts.SignatureHelpCharacterTypedReason;
30
+ export import SignatureHelpInvokedReason = ts.SignatureHelpInvokedReason;
31
+ export import SignatureHelpParameter = ts.SignatureHelpParameter;
32
+ export import SignatureHelpRetriggerCharacter = ts.SignatureHelpRetriggerCharacter;
33
+ export import SignatureHelpRetriggeredReason = ts.SignatureHelpRetriggeredReason;
34
+ export import SignatureHelpTriggerCharacter = ts.SignatureHelpTriggerCharacter;
35
+ export import SignatureHelpTriggerReason = ts.SignatureHelpTriggerReason;
36
+ export import SymbolDisplayPart = ts.SymbolDisplayPart;
37
+ export import UserPreferences = ts.UserPreferences;
38
+ type ChangePropertyTypes<
39
+ T,
40
+ Substitutions extends {
41
+ [K in keyof T]?: any;
42
+ },
43
+ > = {
44
+ [K in keyof T]: K extends keyof Substitutions ? Substitutions[K] : T[K];
45
+ };
46
+ type ChangeStringIndexSignature<T, NewStringIndexSignatureType> = {
47
+ [K in keyof T]: string extends K ? NewStringIndexSignatureType : T[K];
48
+ };
49
+ export enum CommandTypes {
104
50
  JsxClosingTag = "jsxClosingTag",
105
51
  LinkedEditingRange = "linkedEditingRange",
106
52
  Brace = "brace",
@@ -161,6 +107,7 @@ declare namespace ts {
161
107
  GetApplicableRefactors = "getApplicableRefactors",
162
108
  GetEditsForRefactor = "getEditsForRefactor",
163
109
  GetMoveToRefactoringFileSuggestions = "getMoveToRefactoringFileSuggestions",
110
+ GetPasteEdits = "getPasteEdits",
164
111
  OrganizeImports = "organizeImports",
165
112
  GetEditsForFileRename = "getEditsForFileRename",
166
113
  ConfigurePlugin = "configurePlugin",
@@ -174,11 +121,12 @@ declare namespace ts {
174
121
  ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
175
122
  ProvideInlayHints = "provideInlayHints",
176
123
  WatchChange = "watchChange",
124
+ MapCode = "mapCode",
177
125
  }
178
126
  /**
179
127
  * A TypeScript Server message
180
128
  */
181
- interface Message {
129
+ export interface Message {
182
130
  /**
183
131
  * Sequence number of the message
184
132
  */
@@ -191,7 +139,7 @@ declare namespace ts {
191
139
  /**
192
140
  * Client-initiated request message
193
141
  */
194
- interface Request extends Message {
142
+ export interface Request extends Message {
195
143
  type: "request";
196
144
  /**
197
145
  * The command to execute
@@ -205,13 +153,13 @@ declare namespace ts {
205
153
  /**
206
154
  * Request to reload the project structure for all the opened files
207
155
  */
208
- interface ReloadProjectsRequest extends Request {
156
+ export interface ReloadProjectsRequest extends Request {
209
157
  command: CommandTypes.ReloadProjects;
210
158
  }
211
159
  /**
212
160
  * Server-initiated event message
213
161
  */
214
- interface Event extends Message {
162
+ export interface Event extends Message {
215
163
  type: "event";
216
164
  /**
217
165
  * Name of event
@@ -225,7 +173,7 @@ declare namespace ts {
225
173
  /**
226
174
  * Response by server to client request message.
227
175
  */
228
- interface Response extends Message {
176
+ export interface Response extends Message {
229
177
  type: "response";
230
178
  /**
231
179
  * Sequence number of the request message.
@@ -257,7 +205,7 @@ declare namespace ts {
257
205
  */
258
206
  performanceData?: PerformanceData;
259
207
  }
260
- interface PerformanceData {
208
+ export interface PerformanceData {
261
209
  /**
262
210
  * Time spent updating the program graph, in milliseconds.
263
211
  */
@@ -270,17 +218,17 @@ declare namespace ts {
270
218
  /**
271
219
  * Arguments for FileRequest messages.
272
220
  */
273
- interface FileRequestArgs {
221
+ export interface FileRequestArgs {
274
222
  /**
275
223
  * The file for the request (absolute pathname required).
276
224
  */
277
225
  file: string;
278
226
  projectFileName?: string;
279
227
  }
280
- interface StatusRequest extends Request {
228
+ export interface StatusRequest extends Request {
281
229
  command: CommandTypes.Status;
282
230
  }
283
- interface StatusResponseBody {
231
+ export interface StatusResponseBody {
284
232
  /**
285
233
  * The TypeScript version (`ts.version`).
286
234
  */
@@ -289,32 +237,32 @@ declare namespace ts {
289
237
  /**
290
238
  * Response to StatusRequest
291
239
  */
292
- interface StatusResponse extends Response {
240
+ export interface StatusResponse extends Response {
293
241
  body: StatusResponseBody;
294
242
  }
295
243
  /**
296
244
  * Requests a JS Doc comment template for a given position
297
245
  */
298
- interface DocCommentTemplateRequest extends FileLocationRequest {
246
+ export interface DocCommentTemplateRequest extends FileLocationRequest {
299
247
  command: CommandTypes.DocCommentTemplate;
300
248
  }
301
249
  /**
302
250
  * Response to DocCommentTemplateRequest
303
251
  */
304
- interface DocCommandTemplateResponse extends Response {
252
+ export interface DocCommandTemplateResponse extends Response {
305
253
  body?: TextInsertion;
306
254
  }
307
255
  /**
308
256
  * A request to get TODO comments from the file
309
257
  */
310
- interface TodoCommentRequest extends FileRequest {
258
+ export interface TodoCommentRequest extends FileRequest {
311
259
  command: CommandTypes.TodoComments;
312
260
  arguments: TodoCommentRequestArgs;
313
261
  }
314
262
  /**
315
263
  * Arguments for TodoCommentRequest request.
316
264
  */
317
- interface TodoCommentRequestArgs extends FileRequestArgs {
265
+ export interface TodoCommentRequestArgs extends FileRequestArgs {
318
266
  /**
319
267
  * Array of target TodoCommentDescriptors that describes TODO comments to be found
320
268
  */
@@ -323,17 +271,17 @@ declare namespace ts {
323
271
  /**
324
272
  * Response for TodoCommentRequest request.
325
273
  */
326
- interface TodoCommentsResponse extends Response {
274
+ export interface TodoCommentsResponse extends Response {
327
275
  body?: TodoComment[];
328
276
  }
329
277
  /**
330
278
  * A request to determine if the caret is inside a comment.
331
279
  */
332
- interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
280
+ export interface SpanOfEnclosingCommentRequest extends FileLocationRequest {
333
281
  command: CommandTypes.GetSpanOfEnclosingComment;
334
282
  arguments: SpanOfEnclosingCommentRequestArgs;
335
283
  }
336
- interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
284
+ export interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs {
337
285
  /**
338
286
  * Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
339
287
  */
@@ -342,49 +290,36 @@ declare namespace ts {
342
290
  /**
343
291
  * Request to obtain outlining spans in file.
344
292
  */
345
- interface OutliningSpansRequest extends FileRequest {
293
+ export interface OutliningSpansRequest extends FileRequest {
346
294
  command: CommandTypes.GetOutliningSpans;
347
295
  }
348
- interface OutliningSpan {
349
- /** The span of the document to actually collapse. */
296
+ export type OutliningSpan = ChangePropertyTypes<ts.OutliningSpan, {
350
297
  textSpan: TextSpan;
351
- /** The span of the document to display when the user hovers over the collapsed span. */
352
298
  hintSpan: TextSpan;
353
- /** The text to display in the editor for the collapsed region. */
354
- bannerText: string;
355
- /**
356
- * Whether or not this region should be automatically collapsed when
357
- * the 'Collapse to Definitions' command is invoked.
358
- */
359
- autoCollapse: boolean;
360
- /**
361
- * Classification of the contents of the span
362
- */
363
- kind: OutliningSpanKind;
364
- }
299
+ }>;
365
300
  /**
366
301
  * Response to OutliningSpansRequest request.
367
302
  */
368
- interface OutliningSpansResponse extends Response {
303
+ export interface OutliningSpansResponse extends Response {
369
304
  body?: OutliningSpan[];
370
305
  }
371
306
  /**
372
307
  * A request to get indentation for a location in file
373
308
  */
374
- interface IndentationRequest extends FileLocationRequest {
309
+ export interface IndentationRequest extends FileLocationRequest {
375
310
  command: CommandTypes.Indentation;
376
311
  arguments: IndentationRequestArgs;
377
312
  }
378
313
  /**
379
314
  * Response for IndentationRequest request.
380
315
  */
381
- interface IndentationResponse extends Response {
316
+ export interface IndentationResponse extends Response {
382
317
  body?: IndentationResult;
383
318
  }
384
319
  /**
385
320
  * Indentation result representing where indentation should be placed
386
321
  */
387
- interface IndentationResult {
322
+ export interface IndentationResult {
388
323
  /**
389
324
  * The base position in the document that the indent should be relative to
390
325
  */
@@ -397,7 +332,7 @@ declare namespace ts {
397
332
  /**
398
333
  * Arguments for IndentationRequest request.
399
334
  */
400
- interface IndentationRequestArgs extends FileLocationRequestArgs {
335
+ export interface IndentationRequestArgs extends FileLocationRequestArgs {
401
336
  /**
402
337
  * An optional set of settings to be used when computing indentation.
403
338
  * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
@@ -407,7 +342,7 @@ declare namespace ts {
407
342
  /**
408
343
  * Arguments for ProjectInfoRequest request.
409
344
  */
410
- interface ProjectInfoRequestArgs extends FileRequestArgs {
345
+ export interface ProjectInfoRequestArgs extends FileRequestArgs {
411
346
  /**
412
347
  * Indicate if the file name list of the project is needed
413
348
  */
@@ -416,20 +351,20 @@ declare namespace ts {
416
351
  /**
417
352
  * A request to get the project information of the current file.
418
353
  */
419
- interface ProjectInfoRequest extends Request {
354
+ export interface ProjectInfoRequest extends Request {
420
355
  command: CommandTypes.ProjectInfo;
421
356
  arguments: ProjectInfoRequestArgs;
422
357
  }
423
358
  /**
424
359
  * A request to retrieve compiler options diagnostics for a project
425
360
  */
426
- interface CompilerOptionsDiagnosticsRequest extends Request {
361
+ export interface CompilerOptionsDiagnosticsRequest extends Request {
427
362
  arguments: CompilerOptionsDiagnosticsRequestArgs;
428
363
  }
429
364
  /**
430
365
  * Arguments for CompilerOptionsDiagnosticsRequest request.
431
366
  */
432
- interface CompilerOptionsDiagnosticsRequestArgs {
367
+ export interface CompilerOptionsDiagnosticsRequestArgs {
433
368
  /**
434
369
  * Name of the project to retrieve compiler options diagnostics.
435
370
  */
@@ -438,7 +373,7 @@ declare namespace ts {
438
373
  /**
439
374
  * Response message body for "projectInfo" request
440
375
  */
441
- interface ProjectInfo {
376
+ export interface ProjectInfo {
442
377
  /**
443
378
  * For configured project, this is the normalized path of the 'tsconfig.json' file
444
379
  * For inferred project, this is undefined
@@ -458,7 +393,7 @@ declare namespace ts {
458
393
  * - start position and length of the error span
459
394
  * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
460
395
  */
461
- interface DiagnosticWithLinePosition {
396
+ export interface DiagnosticWithLinePosition {
462
397
  message: string;
463
398
  start: number;
464
399
  length: number;
@@ -474,20 +409,20 @@ declare namespace ts {
474
409
  /**
475
410
  * Response message for "projectInfo" request
476
411
  */
477
- interface ProjectInfoResponse extends Response {
412
+ export interface ProjectInfoResponse extends Response {
478
413
  body?: ProjectInfo;
479
414
  }
480
415
  /**
481
416
  * Request whose sole parameter is a file name.
482
417
  */
483
- interface FileRequest extends Request {
418
+ export interface FileRequest extends Request {
484
419
  arguments: FileRequestArgs;
485
420
  }
486
421
  /**
487
422
  * Instances of this interface specify a location in a source file:
488
423
  * (file, line, character offset), where line and character offset are 1-based.
489
424
  */
490
- interface FileLocationRequestArgs extends FileRequestArgs {
425
+ export interface FileLocationRequestArgs extends FileRequestArgs {
491
426
  /**
492
427
  * The line number for the request (1-based).
493
428
  */
@@ -497,15 +432,15 @@ declare namespace ts {
497
432
  */
498
433
  offset: number;
499
434
  }
500
- type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
435
+ export type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs;
501
436
  /**
502
437
  * Request refactorings at a given position or selection area.
503
438
  */
504
- interface GetApplicableRefactorsRequest extends Request {
439
+ export interface GetApplicableRefactorsRequest extends Request {
505
440
  command: CommandTypes.GetApplicableRefactors;
506
441
  arguments: GetApplicableRefactorsRequestArgs;
507
442
  }
508
- type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
443
+ export type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs & {
509
444
  triggerReason?: RefactorTriggerReason;
510
445
  kind?: string;
511
446
  /**
@@ -517,88 +452,61 @@ declare namespace ts {
517
452
  */
518
453
  includeInteractiveActions?: boolean;
519
454
  };
520
- type RefactorTriggerReason = "implicit" | "invoked";
521
455
  /**
522
456
  * Response is a list of available refactorings.
523
457
  * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
524
458
  */
525
- interface GetApplicableRefactorsResponse extends Response {
459
+ export interface GetApplicableRefactorsResponse extends Response {
526
460
  body?: ApplicableRefactorInfo[];
527
461
  }
528
462
  /**
529
463
  * Request refactorings at a given position or selection area to move to an existing file.
530
464
  */
531
- interface GetMoveToRefactoringFileSuggestionsRequest extends Request {
465
+ export interface GetMoveToRefactoringFileSuggestionsRequest extends Request {
532
466
  command: CommandTypes.GetMoveToRefactoringFileSuggestions;
533
467
  arguments: GetMoveToRefactoringFileSuggestionsRequestArgs;
534
468
  }
535
- type GetMoveToRefactoringFileSuggestionsRequestArgs = FileLocationOrRangeRequestArgs & {
469
+ export type GetMoveToRefactoringFileSuggestionsRequestArgs = FileLocationOrRangeRequestArgs & {
536
470
  kind?: string;
537
471
  };
538
472
  /**
539
473
  * Response is a list of available files.
540
474
  * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
541
475
  */
542
- interface GetMoveToRefactoringFileSuggestions extends Response {
476
+ export interface GetMoveToRefactoringFileSuggestions extends Response {
543
477
  body: {
544
478
  newFileName: string;
545
479
  files: string[];
546
480
  };
547
481
  }
548
482
  /**
549
- * A set of one or more available refactoring actions, grouped under a parent refactoring.
483
+ * Request refactorings at a given position post pasting text from some other location.
550
484
  */
551
- interface ApplicableRefactorInfo {
552
- /**
553
- * The programmatic name of the refactoring
554
- */
555
- name: string;
556
- /**
557
- * A description of this refactoring category to show to the user.
558
- * If the refactoring gets inlined (see below), this text will not be visible.
559
- */
560
- description: string;
561
- /**
562
- * Inlineable refactorings can have their actions hoisted out to the top level
563
- * of a context menu. Non-inlineanable refactorings should always be shown inside
564
- * their parent grouping.
565
- *
566
- * If not specified, this value is assumed to be 'true'
567
- */
568
- inlineable?: boolean;
569
- actions: RefactorActionInfo[];
485
+ export interface GetPasteEditsRequest extends Request {
486
+ command: CommandTypes.GetPasteEdits;
487
+ arguments: GetPasteEditsRequestArgs;
570
488
  }
571
- /**
572
- * Represents a single refactoring action - for example, the "Extract Method..." refactor might
573
- * offer several actions, each corresponding to a surround class or closure to extract into.
574
- */
575
- interface RefactorActionInfo {
576
- /**
577
- * The programmatic name of the refactoring action
578
- */
579
- name: string;
580
- /**
581
- * A description of this refactoring action to show to the user.
582
- * If the parent refactoring is inlined away, this will be the only text shown,
583
- * so this description should make sense by itself if the parent is inlineable=true
584
- */
585
- description: string;
586
- /**
587
- * A message to show to the user if the refactoring cannot be applied in
588
- * the current context.
589
- */
590
- notApplicableReason?: string;
591
- /**
592
- * The hierarchical dotted name of the refactor action.
593
- */
594
- kind?: string;
595
- /**
596
- * Indicates that the action requires additional arguments to be passed
597
- * when calling 'GetEditsForRefactor'.
489
+ export interface GetPasteEditsRequestArgs extends FileRequestArgs {
490
+ /** The text that gets pasted in a file. */
491
+ pastedText: string[];
492
+ /** Locations of where the `pastedText` gets added in a file. If the length of the `pastedText` and `pastedLocations` are not the same,
493
+ * then the `pastedText` is combined into one and added at all the `pastedLocations`.
598
494
  */
599
- isInteractive?: boolean;
495
+ pasteLocations: TextSpan[];
496
+ /** The source location of each `pastedText`. If present, the length of `spans` must be equal to the length of `pastedText`. */
497
+ copiedFrom?: {
498
+ file: string;
499
+ spans: TextSpan[];
500
+ };
600
501
  }
601
- interface GetEditsForRefactorRequest extends Request {
502
+ export interface GetPasteEditsResponse extends Response {
503
+ body: PasteEditsAction;
504
+ }
505
+ export interface PasteEditsAction {
506
+ edits: FileCodeEdits[];
507
+ fixId?: {};
508
+ }
509
+ export interface GetEditsForRefactorRequest extends Request {
602
510
  command: CommandTypes.GetEditsForRefactor;
603
511
  arguments: GetEditsForRefactorRequestArgs;
604
512
  }
@@ -606,15 +514,15 @@ declare namespace ts {
606
514
  * Request the edits that a particular refactoring action produces.
607
515
  * Callers must specify the name of the refactor and the name of the action.
608
516
  */
609
- type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
517
+ export type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & {
610
518
  refactor: string;
611
519
  action: string;
612
520
  interactiveRefactorArguments?: InteractiveRefactorArguments;
613
521
  };
614
- interface GetEditsForRefactorResponse extends Response {
522
+ export interface GetEditsForRefactorResponse extends Response {
615
523
  body?: RefactorEditInfo;
616
524
  }
617
- interface RefactorEditInfo {
525
+ export interface RefactorEditInfo {
618
526
  edits: FileCodeEdits[];
619
527
  /**
620
528
  * An optional location where the editor should start a rename operation once
@@ -630,58 +538,53 @@ declare namespace ts {
630
538
  * 2) Coalescing imports from the same module
631
539
  * 3) Sorting imports
632
540
  */
633
- interface OrganizeImportsRequest extends Request {
541
+ export interface OrganizeImportsRequest extends Request {
634
542
  command: CommandTypes.OrganizeImports;
635
543
  arguments: OrganizeImportsRequestArgs;
636
544
  }
637
- type OrganizeImportsScope = GetCombinedCodeFixScope;
638
- enum OrganizeImportsMode {
639
- All = "All",
640
- SortAndCombine = "SortAndCombine",
641
- RemoveUnused = "RemoveUnused",
642
- }
643
- interface OrganizeImportsRequestArgs {
545
+ export type OrganizeImportsScope = GetCombinedCodeFixScope;
546
+ export interface OrganizeImportsRequestArgs {
644
547
  scope: OrganizeImportsScope;
645
548
  /** @deprecated Use `mode` instead */
646
549
  skipDestructiveCodeActions?: boolean;
647
550
  mode?: OrganizeImportsMode;
648
551
  }
649
- interface OrganizeImportsResponse extends Response {
552
+ export interface OrganizeImportsResponse extends Response {
650
553
  body: readonly FileCodeEdits[];
651
554
  }
652
- interface GetEditsForFileRenameRequest extends Request {
555
+ export interface GetEditsForFileRenameRequest extends Request {
653
556
  command: CommandTypes.GetEditsForFileRename;
654
557
  arguments: GetEditsForFileRenameRequestArgs;
655
558
  }
656
559
  /** Note: Paths may also be directories. */
657
- interface GetEditsForFileRenameRequestArgs {
560
+ export interface GetEditsForFileRenameRequestArgs {
658
561
  readonly oldFilePath: string;
659
562
  readonly newFilePath: string;
660
563
  }
661
- interface GetEditsForFileRenameResponse extends Response {
564
+ export interface GetEditsForFileRenameResponse extends Response {
662
565
  body: readonly FileCodeEdits[];
663
566
  }
664
567
  /**
665
568
  * Request for the available codefixes at a specific position.
666
569
  */
667
- interface CodeFixRequest extends Request {
570
+ export interface CodeFixRequest extends Request {
668
571
  command: CommandTypes.GetCodeFixes;
669
572
  arguments: CodeFixRequestArgs;
670
573
  }
671
- interface GetCombinedCodeFixRequest extends Request {
574
+ export interface GetCombinedCodeFixRequest extends Request {
672
575
  command: CommandTypes.GetCombinedCodeFix;
673
576
  arguments: GetCombinedCodeFixRequestArgs;
674
577
  }
675
- interface GetCombinedCodeFixResponse extends Response {
578
+ export interface GetCombinedCodeFixResponse extends Response {
676
579
  body: CombinedCodeActions;
677
580
  }
678
- interface ApplyCodeActionCommandRequest extends Request {
581
+ export interface ApplyCodeActionCommandRequest extends Request {
679
582
  command: CommandTypes.ApplyCodeActionCommand;
680
583
  arguments: ApplyCodeActionCommandRequestArgs;
681
584
  }
682
- interface ApplyCodeActionCommandResponse extends Response {
585
+ export interface ApplyCodeActionCommandResponse extends Response {
683
586
  }
684
- interface FileRangeRequestArgs extends FileRequestArgs {
587
+ export interface FileRangeRequestArgs extends FileRequestArgs {
685
588
  /**
686
589
  * The line number for the request (1-based).
687
590
  */
@@ -702,47 +605,47 @@ declare namespace ts {
702
605
  /**
703
606
  * Instances of this interface specify errorcodes on a specific location in a sourcefile.
704
607
  */
705
- interface CodeFixRequestArgs extends FileRangeRequestArgs {
608
+ export interface CodeFixRequestArgs extends FileRangeRequestArgs {
706
609
  /**
707
610
  * Errorcodes we want to get the fixes for.
708
611
  */
709
612
  errorCodes: readonly number[];
710
613
  }
711
- interface GetCombinedCodeFixRequestArgs {
614
+ export interface GetCombinedCodeFixRequestArgs {
712
615
  scope: GetCombinedCodeFixScope;
713
616
  fixId: {};
714
617
  }
715
- interface GetCombinedCodeFixScope {
618
+ export interface GetCombinedCodeFixScope {
716
619
  type: "file";
717
620
  args: FileRequestArgs;
718
621
  }
719
- interface ApplyCodeActionCommandRequestArgs {
622
+ export interface ApplyCodeActionCommandRequestArgs {
720
623
  /** May also be an array of commands. */
721
624
  command: {};
722
625
  }
723
626
  /**
724
627
  * Response for GetCodeFixes request.
725
628
  */
726
- interface GetCodeFixesResponse extends Response {
629
+ export interface GetCodeFixesResponse extends Response {
727
630
  body?: CodeAction[];
728
631
  }
729
632
  /**
730
633
  * A request whose arguments specify a file location (file, line, col).
731
634
  */
732
- interface FileLocationRequest extends FileRequest {
635
+ export interface FileLocationRequest extends FileRequest {
733
636
  arguments: FileLocationRequestArgs;
734
637
  }
735
638
  /**
736
639
  * A request to get codes of supported code fixes.
737
640
  */
738
- interface GetSupportedCodeFixesRequest extends Request {
641
+ export interface GetSupportedCodeFixesRequest extends Request {
739
642
  command: CommandTypes.GetSupportedCodeFixes;
740
643
  arguments?: Partial<FileRequestArgs>;
741
644
  }
742
645
  /**
743
646
  * A response for GetSupportedCodeFixesRequest request.
744
647
  */
745
- interface GetSupportedCodeFixesResponse extends Response {
648
+ export interface GetSupportedCodeFixesResponse extends Response {
746
649
  /**
747
650
  * List of error codes supported by the server.
748
651
  */
@@ -751,13 +654,13 @@ declare namespace ts {
751
654
  /**
752
655
  * A request to get encoded semantic classifications for a span in the file
753
656
  */
754
- interface EncodedSemanticClassificationsRequest extends FileRequest {
657
+ export interface EncodedSemanticClassificationsRequest extends FileRequest {
755
658
  arguments: EncodedSemanticClassificationsRequestArgs;
756
659
  }
757
660
  /**
758
661
  * Arguments for EncodedSemanticClassificationsRequest request.
759
662
  */
760
- interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
663
+ export interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
761
664
  /**
762
665
  * Start position of the span.
763
666
  */
@@ -773,13 +676,13 @@ declare namespace ts {
773
676
  format?: "original" | "2020";
774
677
  }
775
678
  /** The response for a EncodedSemanticClassificationsRequest */
776
- interface EncodedSemanticClassificationsResponse extends Response {
679
+ export interface EncodedSemanticClassificationsResponse extends Response {
777
680
  body?: EncodedSemanticClassificationsResponseBody;
778
681
  }
779
682
  /**
780
683
  * Implementation response message. Gives series of text spans depending on the format ar.
781
684
  */
782
- interface EncodedSemanticClassificationsResponseBody {
685
+ export interface EncodedSemanticClassificationsResponseBody {
783
686
  endOfLineState: EndOfLineState;
784
687
  spans: number[];
785
688
  }
@@ -787,7 +690,7 @@ declare namespace ts {
787
690
  * Arguments in document highlight request; include: filesToSearch, file,
788
691
  * line, offset.
789
692
  */
790
- interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
693
+ export interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs {
791
694
  /**
792
695
  * List of files to search for document highlights.
793
696
  */
@@ -798,16 +701,16 @@ declare namespace ts {
798
701
  * "definition". Return response giving the file locations that
799
702
  * define the symbol found in file at location line, col.
800
703
  */
801
- interface DefinitionRequest extends FileLocationRequest {
704
+ export interface DefinitionRequest extends FileLocationRequest {
802
705
  command: CommandTypes.Definition;
803
706
  }
804
- interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
707
+ export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
805
708
  readonly command: CommandTypes.DefinitionAndBoundSpan;
806
709
  }
807
- interface FindSourceDefinitionRequest extends FileLocationRequest {
710
+ export interface FindSourceDefinitionRequest extends FileLocationRequest {
808
711
  readonly command: CommandTypes.FindSourceDefinition;
809
712
  }
810
- interface DefinitionAndBoundSpanResponse extends Response {
713
+ export interface DefinitionAndBoundSpanResponse extends Response {
811
714
  readonly body: DefinitionInfoAndBoundSpan;
812
715
  }
813
716
  /**
@@ -815,7 +718,7 @@ declare namespace ts {
815
718
  * "typeDefinition". Return response giving the file locations that
816
719
  * define the type for the symbol found in file at location line, col.
817
720
  */
818
- interface TypeDefinitionRequest extends FileLocationRequest {
721
+ export interface TypeDefinitionRequest extends FileLocationRequest {
819
722
  command: CommandTypes.TypeDefinition;
820
723
  }
821
724
  /**
@@ -823,20 +726,20 @@ declare namespace ts {
823
726
  * "implementation". Return response giving the file locations that
824
727
  * implement the symbol found in file at location line, col.
825
728
  */
826
- interface ImplementationRequest extends FileLocationRequest {
729
+ export interface ImplementationRequest extends FileLocationRequest {
827
730
  command: CommandTypes.Implementation;
828
731
  }
829
732
  /**
830
733
  * Location in source code expressed as (one-based) line and (one-based) column offset.
831
734
  */
832
- interface Location {
735
+ export interface Location {
833
736
  line: number;
834
737
  offset: number;
835
738
  }
836
739
  /**
837
740
  * Object found in response messages defining a span of text in source code.
838
741
  */
839
- interface TextSpan {
742
+ export interface TextSpan {
840
743
  /**
841
744
  * First character of the definition.
842
745
  */
@@ -849,13 +752,13 @@ declare namespace ts {
849
752
  /**
850
753
  * Object found in response messages defining a span of text in a specific source file.
851
754
  */
852
- interface FileSpan extends TextSpan {
755
+ export interface FileSpan extends TextSpan {
853
756
  /**
854
757
  * File containing text span.
855
758
  */
856
759
  file: string;
857
760
  }
858
- interface JSDocTagInfo {
761
+ export interface JSDocTagInfo {
859
762
  /** Name of the JSDoc tag */
860
763
  name: string;
861
764
  /**
@@ -864,78 +767,78 @@ declare namespace ts {
864
767
  */
865
768
  text?: string | SymbolDisplayPart[];
866
769
  }
867
- interface TextSpanWithContext extends TextSpan {
770
+ export interface TextSpanWithContext extends TextSpan {
868
771
  contextStart?: Location;
869
772
  contextEnd?: Location;
870
773
  }
871
- interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
774
+ export interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
872
775
  }
873
- interface DefinitionInfo extends FileSpanWithContext {
776
+ export interface DefinitionInfo extends FileSpanWithContext {
874
777
  /**
875
778
  * When true, the file may or may not exist.
876
779
  */
877
780
  unverified?: boolean;
878
781
  }
879
- interface DefinitionInfoAndBoundSpan {
782
+ export interface DefinitionInfoAndBoundSpan {
880
783
  definitions: readonly DefinitionInfo[];
881
784
  textSpan: TextSpan;
882
785
  }
883
786
  /**
884
787
  * Definition response message. Gives text range for definition.
885
788
  */
886
- interface DefinitionResponse extends Response {
789
+ export interface DefinitionResponse extends Response {
887
790
  body?: DefinitionInfo[];
888
791
  }
889
- interface DefinitionInfoAndBoundSpanResponse extends Response {
792
+ export interface DefinitionInfoAndBoundSpanResponse extends Response {
890
793
  body?: DefinitionInfoAndBoundSpan;
891
794
  }
892
795
  /** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead. */
893
- type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
796
+ export type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse;
894
797
  /**
895
798
  * Definition response message. Gives text range for definition.
896
799
  */
897
- interface TypeDefinitionResponse extends Response {
800
+ export interface TypeDefinitionResponse extends Response {
898
801
  body?: FileSpanWithContext[];
899
802
  }
900
803
  /**
901
804
  * Implementation response message. Gives text range for implementations.
902
805
  */
903
- interface ImplementationResponse extends Response {
806
+ export interface ImplementationResponse extends Response {
904
807
  body?: FileSpanWithContext[];
905
808
  }
906
809
  /**
907
810
  * Request to get brace completion for a location in the file.
908
811
  */
909
- interface BraceCompletionRequest extends FileLocationRequest {
812
+ export interface BraceCompletionRequest extends FileLocationRequest {
910
813
  command: CommandTypes.BraceCompletion;
911
814
  arguments: BraceCompletionRequestArgs;
912
815
  }
913
816
  /**
914
817
  * Argument for BraceCompletionRequest request.
915
818
  */
916
- interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
819
+ export interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
917
820
  /**
918
821
  * Kind of opening brace
919
822
  */
920
823
  openingBrace: string;
921
824
  }
922
- interface JsxClosingTagRequest extends FileLocationRequest {
825
+ export interface JsxClosingTagRequest extends FileLocationRequest {
923
826
  readonly command: CommandTypes.JsxClosingTag;
924
827
  readonly arguments: JsxClosingTagRequestArgs;
925
828
  }
926
- interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
829
+ export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
927
830
  }
928
- interface JsxClosingTagResponse extends Response {
831
+ export interface JsxClosingTagResponse extends Response {
929
832
  readonly body: TextInsertion;
930
833
  }
931
- interface LinkedEditingRangeRequest extends FileLocationRequest {
834
+ export interface LinkedEditingRangeRequest extends FileLocationRequest {
932
835
  readonly command: CommandTypes.LinkedEditingRange;
933
836
  }
934
- interface LinkedEditingRangesBody {
837
+ export interface LinkedEditingRangesBody {
935
838
  ranges: TextSpan[];
936
839
  wordPattern?: string;
937
840
  }
938
- interface LinkedEditingRangeResponse extends Response {
841
+ export interface LinkedEditingRangeResponse extends Response {
939
842
  readonly body: LinkedEditingRangesBody;
940
843
  }
941
844
  /**
@@ -943,20 +846,20 @@ declare namespace ts {
943
846
  * "documentHighlights". Return response giving spans that are relevant
944
847
  * in the file at a given line and column.
945
848
  */
946
- interface DocumentHighlightsRequest extends FileLocationRequest {
849
+ export interface DocumentHighlightsRequest extends FileLocationRequest {
947
850
  command: CommandTypes.DocumentHighlights;
948
851
  arguments: DocumentHighlightsRequestArgs;
949
852
  }
950
853
  /**
951
854
  * Span augmented with extra information that denotes the kind of the highlighting to be used for span.
952
855
  */
953
- interface HighlightSpan extends TextSpanWithContext {
856
+ export interface HighlightSpan extends TextSpanWithContext {
954
857
  kind: HighlightSpanKind;
955
858
  }
956
859
  /**
957
860
  * Represents a set of highligh spans for a give name
958
861
  */
959
- interface DocumentHighlightsItem {
862
+ export interface DocumentHighlightsItem {
960
863
  /**
961
864
  * File containing highlight spans.
962
865
  */
@@ -969,7 +872,7 @@ declare namespace ts {
969
872
  /**
970
873
  * Response for a DocumentHighlightsRequest request.
971
874
  */
972
- interface DocumentHighlightsResponse extends Response {
875
+ export interface DocumentHighlightsResponse extends Response {
973
876
  body?: DocumentHighlightsItem[];
974
877
  }
975
878
  /**
@@ -977,10 +880,10 @@ declare namespace ts {
977
880
  * "references". Return response giving the file locations that
978
881
  * reference the symbol found in file at location line, col.
979
882
  */
980
- interface ReferencesRequest extends FileLocationRequest {
883
+ export interface ReferencesRequest extends FileLocationRequest {
981
884
  command: CommandTypes.References;
982
885
  }
983
- interface ReferencesResponseItem extends FileSpanWithContext {
886
+ export interface ReferencesResponseItem extends FileSpanWithContext {
984
887
  /**
985
888
  * Text of line containing the reference. Including this
986
889
  * with the response avoids latency of editor loading files
@@ -1004,7 +907,7 @@ declare namespace ts {
1004
907
  /**
1005
908
  * The body of a "references" response message.
1006
909
  */
1007
- interface ReferencesResponseBody {
910
+ export interface ReferencesResponseBody {
1008
911
  /**
1009
912
  * The file locations referencing the symbol.
1010
913
  */
@@ -1025,13 +928,13 @@ declare namespace ts {
1025
928
  /**
1026
929
  * Response to "references" request.
1027
930
  */
1028
- interface ReferencesResponse extends Response {
931
+ export interface ReferencesResponse extends Response {
1029
932
  body?: ReferencesResponseBody;
1030
933
  }
1031
- interface FileReferencesRequest extends FileRequest {
934
+ export interface FileReferencesRequest extends FileRequest {
1032
935
  command: CommandTypes.FileReferences;
1033
936
  }
1034
- interface FileReferencesResponseBody {
937
+ export interface FileReferencesResponseBody {
1035
938
  /**
1036
939
  * The file locations referencing the symbol.
1037
940
  */
@@ -1041,13 +944,13 @@ declare namespace ts {
1041
944
  */
1042
945
  symbolName: string;
1043
946
  }
1044
- interface FileReferencesResponse extends Response {
947
+ export interface FileReferencesResponse extends Response {
1045
948
  body?: FileReferencesResponseBody;
1046
949
  }
1047
950
  /**
1048
951
  * Argument for RenameRequest request.
1049
952
  */
1050
- interface RenameRequestArgs extends FileLocationRequestArgs {
953
+ export interface RenameRequestArgs extends FileLocationRequestArgs {
1051
954
  /**
1052
955
  * Should text at specified location be found/changed in comments?
1053
956
  */
@@ -1063,65 +966,31 @@ declare namespace ts {
1063
966
  * found in file at location line, col. Also return full display
1064
967
  * name of the symbol so that client can print it unambiguously.
1065
968
  */
1066
- interface RenameRequest extends FileLocationRequest {
969
+ export interface RenameRequest extends FileLocationRequest {
1067
970
  command: CommandTypes.Rename;
1068
971
  arguments: RenameRequestArgs;
1069
972
  }
1070
973
  /**
1071
974
  * Information about the item to be renamed.
1072
975
  */
1073
- type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
1074
- interface RenameInfoSuccess {
1075
- /**
1076
- * True if item can be renamed.
1077
- */
1078
- canRename: true;
1079
- /**
1080
- * File or directory to rename.
1081
- * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`.
1082
- */
1083
- fileToRename?: string;
1084
- /**
1085
- * Display name of the item to be renamed.
1086
- */
1087
- displayName: string;
1088
- /**
1089
- * Full display name of item to be renamed.
1090
- * If item to be renamed is a file, then this is the original text of the module specifer
1091
- */
1092
- fullDisplayName: string;
1093
- /**
1094
- * The items's kind (such as 'className' or 'parameterName' or plain 'text').
1095
- */
1096
- kind: ScriptElementKind;
1097
- /**
1098
- * Optional modifiers for the kind (such as 'public').
1099
- */
1100
- kindModifiers: string;
1101
- /** Span of text to rename. */
976
+ export type RenameInfo = RenameInfoSuccess | RenameInfoFailure;
977
+ export type RenameInfoSuccess = ChangePropertyTypes<ts.RenameInfoSuccess, {
1102
978
  triggerSpan: TextSpan;
1103
- }
1104
- interface RenameInfoFailure {
1105
- canRename: false;
1106
- /**
1107
- * Error message if item can not be renamed.
1108
- */
1109
- localizedErrorMessage: string;
1110
- }
979
+ }>;
1111
980
  /**
1112
981
  * A group of text spans, all in 'file'.
1113
982
  */
1114
- interface SpanGroup {
983
+ export interface SpanGroup {
1115
984
  /** The file to which the spans apply */
1116
985
  file: string;
1117
986
  /** The text spans in this group */
1118
987
  locs: RenameTextSpan[];
1119
988
  }
1120
- interface RenameTextSpan extends TextSpanWithContext {
989
+ export interface RenameTextSpan extends TextSpanWithContext {
1121
990
  readonly prefixText?: string;
1122
991
  readonly suffixText?: string;
1123
992
  }
1124
- interface RenameResponseBody {
993
+ export interface RenameResponseBody {
1125
994
  /**
1126
995
  * Information about the item to be renamed.
1127
996
  */
@@ -1134,7 +1003,7 @@ declare namespace ts {
1134
1003
  /**
1135
1004
  * Rename response message.
1136
1005
  */
1137
- interface RenameResponse extends Response {
1006
+ export interface RenameResponse extends Response {
1138
1007
  body?: RenameResponseBody;
1139
1008
  }
1140
1009
  /**
@@ -1146,7 +1015,7 @@ declare namespace ts {
1146
1015
  * create configured project for every config file but will maintain a link that these projects were created
1147
1016
  * as a result of opening external project so they should be removed once external project is closed.
1148
1017
  */
1149
- interface ExternalFile {
1018
+ export interface ExternalFile {
1150
1019
  /**
1151
1020
  * Name of file file
1152
1021
  */
@@ -1167,7 +1036,7 @@ declare namespace ts {
1167
1036
  /**
1168
1037
  * Represent an external project
1169
1038
  */
1170
- interface ExternalProject {
1039
+ export interface ExternalProject {
1171
1040
  /**
1172
1041
  * Project name
1173
1042
  */
@@ -1185,7 +1054,7 @@ declare namespace ts {
1185
1054
  */
1186
1055
  typeAcquisition?: TypeAcquisition;
1187
1056
  }
1188
- interface CompileOnSaveMixin {
1057
+ export interface CompileOnSaveMixin {
1189
1058
  /**
1190
1059
  * If compile on save is enabled for the project
1191
1060
  */
@@ -1195,8 +1064,8 @@ declare namespace ts {
1195
1064
  * For external projects, some of the project settings are sent together with
1196
1065
  * compiler settings.
1197
1066
  */
1198
- type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
1199
- interface FileWithProjectReferenceRedirectInfo {
1067
+ export type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions;
1068
+ export interface FileWithProjectReferenceRedirectInfo {
1200
1069
  /**
1201
1070
  * Name of file
1202
1071
  */
@@ -1209,7 +1078,7 @@ declare namespace ts {
1209
1078
  /**
1210
1079
  * Represents a set of changes that happen in project
1211
1080
  */
1212
- interface ProjectChanges {
1081
+ export interface ProjectChanges {
1213
1082
  /**
1214
1083
  * List of added files
1215
1084
  */
@@ -1231,7 +1100,7 @@ declare namespace ts {
1231
1100
  /**
1232
1101
  * Information found in a configure request.
1233
1102
  */
1234
- interface ConfigureRequestArguments {
1103
+ export interface ConfigureRequestArguments {
1235
1104
  /**
1236
1105
  * Information about the host, for example 'Emacs 24.4' or
1237
1106
  * 'Sublime Text version 3075'
@@ -1252,7 +1121,7 @@ declare namespace ts {
1252
1121
  extraFileExtensions?: FileExtensionInfo[];
1253
1122
  watchOptions?: WatchOptions;
1254
1123
  }
1255
- enum WatchFileKind {
1124
+ export enum WatchFileKind {
1256
1125
  FixedPollingInterval = "FixedPollingInterval",
1257
1126
  PriorityPollingInterval = "PriorityPollingInterval",
1258
1127
  DynamicPriorityPolling = "DynamicPriorityPolling",
@@ -1260,19 +1129,19 @@ declare namespace ts {
1260
1129
  UseFsEvents = "UseFsEvents",
1261
1130
  UseFsEventsOnParentDirectory = "UseFsEventsOnParentDirectory",
1262
1131
  }
1263
- enum WatchDirectoryKind {
1132
+ export enum WatchDirectoryKind {
1264
1133
  UseFsEvents = "UseFsEvents",
1265
1134
  FixedPollingInterval = "FixedPollingInterval",
1266
1135
  DynamicPriorityPolling = "DynamicPriorityPolling",
1267
1136
  FixedChunkSizePolling = "FixedChunkSizePolling",
1268
1137
  }
1269
- enum PollingWatchKind {
1138
+ export enum PollingWatchKind {
1270
1139
  FixedInterval = "FixedInterval",
1271
1140
  PriorityInterval = "PriorityInterval",
1272
1141
  DynamicPriority = "DynamicPriority",
1273
1142
  FixedChunkSize = "FixedChunkSize",
1274
1143
  }
1275
- interface WatchOptions {
1144
+ export interface WatchOptions {
1276
1145
  watchFile?: WatchFileKind | ts.WatchFileKind;
1277
1146
  watchDirectory?: WatchDirectoryKind | ts.WatchDirectoryKind;
1278
1147
  fallbackPolling?: PollingWatchKind | ts.PollingWatchKind;
@@ -1285,7 +1154,7 @@ declare namespace ts {
1285
1154
  * Configure request; value of command field is "configure". Specifies
1286
1155
  * host information, such as host type, tab size, and indent size.
1287
1156
  */
1288
- interface ConfigureRequest extends Request {
1157
+ export interface ConfigureRequest extends Request {
1289
1158
  command: CommandTypes.Configure;
1290
1159
  arguments: ConfigureRequestArguments;
1291
1160
  }
@@ -1293,52 +1162,52 @@ declare namespace ts {
1293
1162
  * Response to "configure" request. This is just an acknowledgement, so
1294
1163
  * no body field is required.
1295
1164
  */
1296
- interface ConfigureResponse extends Response {
1165
+ export interface ConfigureResponse extends Response {
1297
1166
  }
1298
- interface ConfigurePluginRequestArguments {
1167
+ export interface ConfigurePluginRequestArguments {
1299
1168
  pluginName: string;
1300
1169
  configuration: any;
1301
1170
  }
1302
- interface ConfigurePluginRequest extends Request {
1171
+ export interface ConfigurePluginRequest extends Request {
1303
1172
  command: CommandTypes.ConfigurePlugin;
1304
1173
  arguments: ConfigurePluginRequestArguments;
1305
1174
  }
1306
- interface ConfigurePluginResponse extends Response {
1175
+ export interface ConfigurePluginResponse extends Response {
1307
1176
  }
1308
- interface SelectionRangeRequest extends FileRequest {
1177
+ export interface SelectionRangeRequest extends FileRequest {
1309
1178
  command: CommandTypes.SelectionRange;
1310
1179
  arguments: SelectionRangeRequestArgs;
1311
1180
  }
1312
- interface SelectionRangeRequestArgs extends FileRequestArgs {
1181
+ export interface SelectionRangeRequestArgs extends FileRequestArgs {
1313
1182
  locations: Location[];
1314
1183
  }
1315
- interface SelectionRangeResponse extends Response {
1184
+ export interface SelectionRangeResponse extends Response {
1316
1185
  body?: SelectionRange[];
1317
1186
  }
1318
- interface SelectionRange {
1187
+ export interface SelectionRange {
1319
1188
  textSpan: TextSpan;
1320
1189
  parent?: SelectionRange;
1321
1190
  }
1322
- interface ToggleLineCommentRequest extends FileRequest {
1191
+ export interface ToggleLineCommentRequest extends FileRequest {
1323
1192
  command: CommandTypes.ToggleLineComment;
1324
1193
  arguments: FileRangeRequestArgs;
1325
1194
  }
1326
- interface ToggleMultilineCommentRequest extends FileRequest {
1195
+ export interface ToggleMultilineCommentRequest extends FileRequest {
1327
1196
  command: CommandTypes.ToggleMultilineComment;
1328
1197
  arguments: FileRangeRequestArgs;
1329
1198
  }
1330
- interface CommentSelectionRequest extends FileRequest {
1199
+ export interface CommentSelectionRequest extends FileRequest {
1331
1200
  command: CommandTypes.CommentSelection;
1332
1201
  arguments: FileRangeRequestArgs;
1333
1202
  }
1334
- interface UncommentSelectionRequest extends FileRequest {
1203
+ export interface UncommentSelectionRequest extends FileRequest {
1335
1204
  command: CommandTypes.UncommentSelection;
1336
1205
  arguments: FileRangeRequestArgs;
1337
1206
  }
1338
1207
  /**
1339
1208
  * Information found in an "open" request.
1340
1209
  */
1341
- interface OpenRequestArgs extends FileRequestArgs {
1210
+ export interface OpenRequestArgs extends FileRequestArgs {
1342
1211
  /**
1343
1212
  * Used when a version of the file content is known to be more up to date than the one on disk.
1344
1213
  * Then the known content will be used upon opening instead of the disk copy
@@ -1355,7 +1224,7 @@ declare namespace ts {
1355
1224
  */
1356
1225
  projectRootPath?: string;
1357
1226
  }
1358
- type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
1227
+ export type ScriptKindName = "TS" | "JS" | "TSX" | "JSX";
1359
1228
  /**
1360
1229
  * Open request; value of command field is "open". Notify the
1361
1230
  * server that the client has file open. The server will not
@@ -1364,32 +1233,32 @@ declare namespace ts {
1364
1233
  * reload messages) when the file changes. Server does not currently
1365
1234
  * send a response to an open request.
1366
1235
  */
1367
- interface OpenRequest extends Request {
1236
+ export interface OpenRequest extends Request {
1368
1237
  command: CommandTypes.Open;
1369
1238
  arguments: OpenRequestArgs;
1370
1239
  }
1371
1240
  /**
1372
1241
  * Request to open or update external project
1373
1242
  */
1374
- interface OpenExternalProjectRequest extends Request {
1243
+ export interface OpenExternalProjectRequest extends Request {
1375
1244
  command: CommandTypes.OpenExternalProject;
1376
1245
  arguments: OpenExternalProjectArgs;
1377
1246
  }
1378
1247
  /**
1379
1248
  * Arguments to OpenExternalProjectRequest request
1380
1249
  */
1381
- type OpenExternalProjectArgs = ExternalProject;
1250
+ export type OpenExternalProjectArgs = ExternalProject;
1382
1251
  /**
1383
1252
  * Request to open multiple external projects
1384
1253
  */
1385
- interface OpenExternalProjectsRequest extends Request {
1254
+ export interface OpenExternalProjectsRequest extends Request {
1386
1255
  command: CommandTypes.OpenExternalProjects;
1387
1256
  arguments: OpenExternalProjectsArgs;
1388
1257
  }
1389
1258
  /**
1390
1259
  * Arguments to OpenExternalProjectsRequest
1391
1260
  */
1392
- interface OpenExternalProjectsArgs {
1261
+ export interface OpenExternalProjectsArgs {
1393
1262
  /**
1394
1263
  * List of external projects to open or update
1395
1264
  */
@@ -1399,25 +1268,25 @@ declare namespace ts {
1399
1268
  * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so
1400
1269
  * no body field is required.
1401
1270
  */
1402
- interface OpenExternalProjectResponse extends Response {
1271
+ export interface OpenExternalProjectResponse extends Response {
1403
1272
  }
1404
1273
  /**
1405
1274
  * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so
1406
1275
  * no body field is required.
1407
1276
  */
1408
- interface OpenExternalProjectsResponse extends Response {
1277
+ export interface OpenExternalProjectsResponse extends Response {
1409
1278
  }
1410
1279
  /**
1411
1280
  * Request to close external project.
1412
1281
  */
1413
- interface CloseExternalProjectRequest extends Request {
1282
+ export interface CloseExternalProjectRequest extends Request {
1414
1283
  command: CommandTypes.CloseExternalProject;
1415
1284
  arguments: CloseExternalProjectRequestArgs;
1416
1285
  }
1417
1286
  /**
1418
1287
  * Arguments to CloseExternalProjectRequest request
1419
1288
  */
1420
- interface CloseExternalProjectRequestArgs {
1289
+ export interface CloseExternalProjectRequestArgs {
1421
1290
  /**
1422
1291
  * Name of the project to close
1423
1292
  */
@@ -1427,19 +1296,19 @@ declare namespace ts {
1427
1296
  * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so
1428
1297
  * no body field is required.
1429
1298
  */
1430
- interface CloseExternalProjectResponse extends Response {
1299
+ export interface CloseExternalProjectResponse extends Response {
1431
1300
  }
1432
1301
  /**
1433
1302
  * Request to synchronize list of open files with the client
1434
1303
  */
1435
- interface UpdateOpenRequest extends Request {
1304
+ export interface UpdateOpenRequest extends Request {
1436
1305
  command: CommandTypes.UpdateOpen;
1437
1306
  arguments: UpdateOpenRequestArgs;
1438
1307
  }
1439
1308
  /**
1440
1309
  * Arguments to UpdateOpenRequest
1441
1310
  */
1442
- interface UpdateOpenRequestArgs {
1311
+ export interface UpdateOpenRequestArgs {
1443
1312
  /**
1444
1313
  * List of newly open files
1445
1314
  */
@@ -1456,7 +1325,7 @@ declare namespace ts {
1456
1325
  /**
1457
1326
  * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
1458
1327
  */
1459
- type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
1328
+ export type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
1460
1329
  /**
1461
1330
  * Request to set compiler options for inferred projects.
1462
1331
  * External projects are opened / closed explicitly.
@@ -1466,14 +1335,14 @@ declare namespace ts {
1466
1335
  * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false,
1467
1336
  * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true.
1468
1337
  */
1469
- interface SetCompilerOptionsForInferredProjectsRequest extends Request {
1338
+ export interface SetCompilerOptionsForInferredProjectsRequest extends Request {
1470
1339
  command: CommandTypes.CompilerOptionsForInferredProjects;
1471
1340
  arguments: SetCompilerOptionsForInferredProjectsArgs;
1472
1341
  }
1473
1342
  /**
1474
1343
  * Argument for SetCompilerOptionsForInferredProjectsRequest request.
1475
1344
  */
1476
- interface SetCompilerOptionsForInferredProjectsArgs {
1345
+ export interface SetCompilerOptionsForInferredProjectsArgs {
1477
1346
  /**
1478
1347
  * Compiler options to be used with inferred projects.
1479
1348
  */
@@ -1489,13 +1358,13 @@ declare namespace ts {
1489
1358
  * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so
1490
1359
  * no body field is required.
1491
1360
  */
1492
- interface SetCompilerOptionsForInferredProjectsResponse extends Response {
1361
+ export interface SetCompilerOptionsForInferredProjectsResponse extends Response {
1493
1362
  }
1494
1363
  /**
1495
1364
  * Exit request; value of command field is "exit". Ask the server process
1496
1365
  * to exit.
1497
1366
  */
1498
- interface ExitRequest extends Request {
1367
+ export interface ExitRequest extends Request {
1499
1368
  command: CommandTypes.Exit;
1500
1369
  }
1501
1370
  /**
@@ -1505,29 +1374,30 @@ declare namespace ts {
1505
1374
  * monitoring the filesystem for changes to file. Server does not
1506
1375
  * currently send a response to a close request.
1507
1376
  */
1508
- interface CloseRequest extends FileRequest {
1377
+ export interface CloseRequest extends FileRequest {
1509
1378
  command: CommandTypes.Close;
1510
1379
  }
1511
- interface WatchChangeRequest extends Request {
1380
+ export interface WatchChangeRequest extends Request {
1512
1381
  command: CommandTypes.WatchChange;
1513
- arguments: WatchChangeRequestArgs;
1382
+ arguments: WatchChangeRequestArgs | readonly WatchChangeRequestArgs[];
1514
1383
  }
1515
- interface WatchChangeRequestArgs {
1384
+ export interface WatchChangeRequestArgs {
1516
1385
  id: number;
1517
- path: string;
1518
- eventType: "create" | "delete" | "update";
1386
+ created?: string[];
1387
+ deleted?: string[];
1388
+ updated?: string[];
1519
1389
  }
1520
1390
  /**
1521
1391
  * Request to obtain the list of files that should be regenerated if target file is recompiled.
1522
1392
  * NOTE: this us query-only operation and does not generate any output on disk.
1523
1393
  */
1524
- interface CompileOnSaveAffectedFileListRequest extends FileRequest {
1394
+ export interface CompileOnSaveAffectedFileListRequest extends FileRequest {
1525
1395
  command: CommandTypes.CompileOnSaveAffectedFileList;
1526
1396
  }
1527
1397
  /**
1528
1398
  * Contains a list of files that should be regenerated in a project
1529
1399
  */
1530
- interface CompileOnSaveAffectedFileListSingleProject {
1400
+ export interface CompileOnSaveAffectedFileListSingleProject {
1531
1401
  /**
1532
1402
  * Project name
1533
1403
  */
@@ -1544,20 +1414,20 @@ declare namespace ts {
1544
1414
  /**
1545
1415
  * Response for CompileOnSaveAffectedFileListRequest request;
1546
1416
  */
1547
- interface CompileOnSaveAffectedFileListResponse extends Response {
1417
+ export interface CompileOnSaveAffectedFileListResponse extends Response {
1548
1418
  body: CompileOnSaveAffectedFileListSingleProject[];
1549
1419
  }
1550
1420
  /**
1551
1421
  * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk.
1552
1422
  */
1553
- interface CompileOnSaveEmitFileRequest extends FileRequest {
1423
+ export interface CompileOnSaveEmitFileRequest extends FileRequest {
1554
1424
  command: CommandTypes.CompileOnSaveEmitFile;
1555
1425
  arguments: CompileOnSaveEmitFileRequestArgs;
1556
1426
  }
1557
1427
  /**
1558
1428
  * Arguments for CompileOnSaveEmitFileRequest
1559
1429
  */
1560
- interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
1430
+ export interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs {
1561
1431
  /**
1562
1432
  * if true - then file should be recompiled even if it does not have any changes.
1563
1433
  */
@@ -1566,10 +1436,10 @@ declare namespace ts {
1566
1436
  /** if true - return response as object with emitSkipped and diagnostics */
1567
1437
  richResponse?: boolean;
1568
1438
  }
1569
- interface CompileOnSaveEmitFileResponse extends Response {
1439
+ export interface CompileOnSaveEmitFileResponse extends Response {
1570
1440
  body: boolean | EmitResult;
1571
1441
  }
1572
- interface EmitResult {
1442
+ export interface EmitResult {
1573
1443
  emitSkipped: boolean;
1574
1444
  diagnostics: Diagnostic[] | DiagnosticWithLinePosition[];
1575
1445
  }
@@ -1579,14 +1449,14 @@ declare namespace ts {
1579
1449
  * documentation string for the symbol found in file at location
1580
1450
  * line, col.
1581
1451
  */
1582
- interface QuickInfoRequest extends FileLocationRequest {
1452
+ export interface QuickInfoRequest extends FileLocationRequest {
1583
1453
  command: CommandTypes.Quickinfo;
1584
1454
  arguments: FileLocationRequestArgs;
1585
1455
  }
1586
1456
  /**
1587
1457
  * Body of QuickInfoResponse.
1588
1458
  */
1589
- interface QuickInfoResponseBody {
1459
+ export interface QuickInfoResponseBody {
1590
1460
  /**
1591
1461
  * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
1592
1462
  */
@@ -1620,13 +1490,13 @@ declare namespace ts {
1620
1490
  /**
1621
1491
  * Quickinfo response message.
1622
1492
  */
1623
- interface QuickInfoResponse extends Response {
1493
+ export interface QuickInfoResponse extends Response {
1624
1494
  body?: QuickInfoResponseBody;
1625
1495
  }
1626
1496
  /**
1627
1497
  * Arguments for format messages.
1628
1498
  */
1629
- interface FormatRequestArgs extends FileLocationRequestArgs {
1499
+ export interface FormatRequestArgs extends FileLocationRequestArgs {
1630
1500
  /**
1631
1501
  * Last line of range for which to format text in file.
1632
1502
  */
@@ -1647,7 +1517,7 @@ declare namespace ts {
1647
1517
  * instructions in reverse to file will result in correctly
1648
1518
  * reformatted text.
1649
1519
  */
1650
- interface FormatRequest extends FileLocationRequest {
1520
+ export interface FormatRequest extends FileLocationRequest {
1651
1521
  command: CommandTypes.Format;
1652
1522
  arguments: FormatRequestArgs;
1653
1523
  }
@@ -1658,7 +1528,7 @@ declare namespace ts {
1658
1528
  * ending one character before end with newText. For an insertion,
1659
1529
  * the text span is empty. For a deletion, newText is empty.
1660
1530
  */
1661
- interface CodeEdit {
1531
+ export interface CodeEdit {
1662
1532
  /**
1663
1533
  * First character of the text span to edit.
1664
1534
  */
@@ -1673,15 +1543,15 @@ declare namespace ts {
1673
1543
  */
1674
1544
  newText: string;
1675
1545
  }
1676
- interface FileCodeEdits {
1546
+ export interface FileCodeEdits {
1677
1547
  fileName: string;
1678
1548
  textChanges: CodeEdit[];
1679
1549
  }
1680
- interface CodeFixResponse extends Response {
1550
+ export interface CodeFixResponse extends Response {
1681
1551
  /** The code actions that are available */
1682
1552
  body?: CodeFixAction[];
1683
1553
  }
1684
- interface CodeAction {
1554
+ export interface CodeAction {
1685
1555
  /** Description of the code action to display in the UI of the editor */
1686
1556
  description: string;
1687
1557
  /** Text changes to apply to each file as part of the code action */
@@ -1689,11 +1559,11 @@ declare namespace ts {
1689
1559
  /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
1690
1560
  commands?: {}[];
1691
1561
  }
1692
- interface CombinedCodeActions {
1562
+ export interface CombinedCodeActions {
1693
1563
  changes: readonly FileCodeEdits[];
1694
1564
  commands?: readonly {}[];
1695
1565
  }
1696
- interface CodeFixAction extends CodeAction {
1566
+ export interface CodeFixAction extends CodeAction {
1697
1567
  /** Short name to identify the fix, for use by telemetry. */
1698
1568
  fixName: string;
1699
1569
  /**
@@ -1707,13 +1577,13 @@ declare namespace ts {
1707
1577
  /**
1708
1578
  * Format and format on key response message.
1709
1579
  */
1710
- interface FormatResponse extends Response {
1580
+ export interface FormatResponse extends Response {
1711
1581
  body?: CodeEdit[];
1712
1582
  }
1713
1583
  /**
1714
1584
  * Arguments for format on key messages.
1715
1585
  */
1716
- interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
1586
+ export interface FormatOnKeyRequestArgs extends FileLocationRequestArgs {
1717
1587
  /**
1718
1588
  * Key pressed (';', '\n', or '}').
1719
1589
  */
@@ -1728,23 +1598,14 @@ declare namespace ts {
1728
1598
  * edit instructions in reverse to file will result in correctly
1729
1599
  * reformatted text.
1730
1600
  */
1731
- interface FormatOnKeyRequest extends FileLocationRequest {
1601
+ export interface FormatOnKeyRequest extends FileLocationRequest {
1732
1602
  command: CommandTypes.Formatonkey;
1733
1603
  arguments: FormatOnKeyRequestArgs;
1734
1604
  }
1735
- type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<" | "#" | " ";
1736
- enum CompletionTriggerKind {
1737
- /** Completion was triggered by typing an identifier, manual invocation (e.g Ctrl+Space) or via API. */
1738
- Invoked = 1,
1739
- /** Completion was triggered by a trigger character. */
1740
- TriggerCharacter = 2,
1741
- /** Completion was re-triggered as the current completion list is incomplete. */
1742
- TriggerForIncompleteCompletions = 3,
1743
- }
1744
1605
  /**
1745
1606
  * Arguments for completions messages.
1746
1607
  */
1747
- interface CompletionsRequestArgs extends FileLocationRequestArgs {
1608
+ export interface CompletionsRequestArgs extends FileLocationRequestArgs {
1748
1609
  /**
1749
1610
  * Optional prefix to apply to possible completions.
1750
1611
  */
@@ -1770,20 +1631,20 @@ declare namespace ts {
1770
1631
  * be the empty string), return the possible completions that
1771
1632
  * begin with prefix.
1772
1633
  */
1773
- interface CompletionsRequest extends FileLocationRequest {
1634
+ export interface CompletionsRequest extends FileLocationRequest {
1774
1635
  command: CommandTypes.Completions | CommandTypes.CompletionInfo;
1775
1636
  arguments: CompletionsRequestArgs;
1776
1637
  }
1777
1638
  /**
1778
1639
  * Arguments for completion details request.
1779
1640
  */
1780
- interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
1641
+ export interface CompletionDetailsRequestArgs extends FileLocationRequestArgs {
1781
1642
  /**
1782
1643
  * Names of one or more entries for which to obtain details.
1783
1644
  */
1784
1645
  entryNames: (string | CompletionEntryIdentifier)[];
1785
1646
  }
1786
- interface CompletionEntryIdentifier {
1647
+ export interface CompletionEntryIdentifier {
1787
1648
  name: string;
1788
1649
  source?: string;
1789
1650
  data?: unknown;
@@ -1794,252 +1655,50 @@ declare namespace ts {
1794
1655
  * col) and an array of completion entry names return more
1795
1656
  * detailed information for each completion entry.
1796
1657
  */
1797
- interface CompletionDetailsRequest extends FileLocationRequest {
1658
+ export interface CompletionDetailsRequest extends FileLocationRequest {
1798
1659
  command: CommandTypes.CompletionDetails;
1799
1660
  arguments: CompletionDetailsRequestArgs;
1800
1661
  }
1801
- /**
1802
- * Part of a symbol description.
1803
- */
1804
- interface SymbolDisplayPart {
1805
- /**
1806
- * Text of an item describing the symbol.
1807
- */
1808
- text: string;
1809
- /**
1810
- * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
1811
- */
1812
- kind: string;
1813
- }
1814
1662
  /** A part of a symbol description that links from a jsdoc @link tag to a declaration */
1815
- interface JSDocLinkDisplayPart extends SymbolDisplayPart {
1663
+ export interface JSDocLinkDisplayPart extends SymbolDisplayPart {
1816
1664
  /** The location of the declaration that the @link tag links to. */
1817
1665
  target: FileSpan;
1818
1666
  }
1819
- /**
1820
- * An item found in a completion response.
1821
- */
1822
- interface CompletionEntry {
1823
- /**
1824
- * The symbol's name.
1825
- */
1826
- name: string;
1827
- /**
1828
- * The symbol's kind (such as 'className' or 'parameterName').
1829
- */
1830
- kind: ScriptElementKind;
1831
- /**
1832
- * Optional modifiers for the kind (such as 'public').
1833
- */
1834
- kindModifiers?: string;
1835
- /**
1836
- * A string that is used for comparing completion items so that they can be ordered. This
1837
- * is often the same as the name but may be different in certain circumstances.
1838
- */
1839
- sortText: string;
1840
- /**
1841
- * Text to insert instead of `name`.
1842
- * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
1843
- * coupled with `replacementSpan` to replace a dotted access with a bracket access.
1844
- */
1845
- insertText?: string;
1846
- /**
1847
- * A string that should be used when filtering a set of
1848
- * completion items.
1849
- */
1850
- filterText?: string;
1851
- /**
1852
- * `insertText` should be interpreted as a snippet if true.
1853
- */
1854
- isSnippet?: true;
1855
- /**
1856
- * An optional span that indicates the text to be replaced by this completion item.
1857
- * If present, this span should be used instead of the default one.
1858
- * It will be set if the required span differs from the one generated by the default replacement behavior.
1859
- */
1860
- replacementSpan?: TextSpan;
1861
- /**
1862
- * Indicates whether commiting this completion entry will require additional code actions to be
1863
- * made to avoid errors. The CompletionEntryDetails will have these actions.
1864
- */
1865
- hasAction?: true;
1866
- /**
1867
- * Identifier (not necessarily human-readable) identifying where this completion came from.
1868
- */
1869
- source?: string;
1870
- /**
1871
- * Human-readable description of the `source`.
1872
- */
1873
- sourceDisplay?: SymbolDisplayPart[];
1874
- /**
1875
- * Additional details for the label.
1876
- */
1877
- labelDetails?: CompletionEntryLabelDetails;
1878
- /**
1879
- * If true, this completion should be highlighted as recommended. There will only be one of these.
1880
- * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
1881
- * Then either that enum/class or a namespace containing it will be the recommended symbol.
1882
- */
1883
- isRecommended?: true;
1884
- /**
1885
- * If true, this completion was generated from traversing the name table of an unchecked JS file,
1886
- * and therefore may not be accurate.
1887
- */
1888
- isFromUncheckedFile?: true;
1889
- /**
1890
- * If true, this completion was for an auto-import of a module not yet in the program, but listed
1891
- * in the project package.json. Used for telemetry reporting.
1892
- */
1893
- isPackageJsonImport?: true;
1894
- /**
1895
- * If true, this completion was an auto-import-style completion of an import statement (i.e., the
1896
- * module specifier was inserted along with the imported identifier). Used for telemetry reporting.
1897
- */
1898
- isImportStatementCompletion?: true;
1899
- /**
1900
- * A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
1901
- * that allows TS Server to look up the symbol represented by the completion item, disambiguating
1902
- * items with the same name.
1903
- */
1904
- data?: unknown;
1905
- }
1906
- interface CompletionEntryLabelDetails {
1907
- /**
1908
- * An optional string which is rendered less prominently directly after
1909
- * {@link CompletionEntry.name name}, without any spacing. Should be
1910
- * used for function signatures or type annotations.
1911
- */
1912
- detail?: string;
1913
- /**
1914
- * An optional string which is rendered less prominently after
1915
- * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
1916
- * names or file path.
1917
- */
1918
- description?: string;
1919
- }
1667
+ export type CompletionEntry = ChangePropertyTypes<Omit<ts.CompletionEntry, "symbol">, {
1668
+ replacementSpan: TextSpan;
1669
+ data: unknown;
1670
+ }>;
1920
1671
  /**
1921
1672
  * Additional completion entry details, available on demand
1922
1673
  */
1923
- interface CompletionEntryDetails {
1924
- /**
1925
- * The symbol's name.
1926
- */
1927
- name: string;
1928
- /**
1929
- * The symbol's kind (such as 'className' or 'parameterName').
1930
- */
1931
- kind: ScriptElementKind;
1932
- /**
1933
- * Optional modifiers for the kind (such as 'public').
1934
- */
1935
- kindModifiers: string;
1936
- /**
1937
- * Display parts of the symbol (similar to quick info).
1938
- */
1939
- displayParts: SymbolDisplayPart[];
1940
- /**
1941
- * Documentation strings for the symbol.
1942
- */
1943
- documentation?: SymbolDisplayPart[];
1944
- /**
1945
- * JSDoc tags for the symbol.
1946
- */
1947
- tags?: JSDocTagInfo[];
1948
- /**
1949
- * The associated code actions for this entry
1950
- */
1951
- codeActions?: CodeAction[];
1952
- /**
1953
- * @deprecated Use `sourceDisplay` instead.
1954
- */
1955
- source?: SymbolDisplayPart[];
1956
- /**
1957
- * Human-readable description of the `source` from the CompletionEntry.
1958
- */
1959
- sourceDisplay?: SymbolDisplayPart[];
1960
- }
1674
+ export type CompletionEntryDetails = ChangePropertyTypes<ts.CompletionEntryDetails, {
1675
+ tags: JSDocTagInfo[];
1676
+ codeActions: CodeAction[];
1677
+ }>;
1961
1678
  /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */
1962
- interface CompletionsResponse extends Response {
1679
+ export interface CompletionsResponse extends Response {
1963
1680
  body?: CompletionEntry[];
1964
1681
  }
1965
- interface CompletionInfoResponse extends Response {
1682
+ export interface CompletionInfoResponse extends Response {
1966
1683
  body?: CompletionInfo;
1967
1684
  }
1968
- interface CompletionInfo {
1969
- readonly flags?: number;
1970
- readonly isGlobalCompletion: boolean;
1971
- readonly isMemberCompletion: boolean;
1972
- readonly isNewIdentifierLocation: boolean;
1973
- /**
1974
- * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use
1975
- * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span
1976
- * must be used to commit that completion entry.
1977
- */
1978
- readonly optionalReplacementSpan?: TextSpan;
1979
- readonly isIncomplete?: boolean;
1980
- readonly entries: readonly CompletionEntry[];
1981
- }
1982
- interface CompletionDetailsResponse extends Response {
1685
+ export type CompletionInfo = ChangePropertyTypes<ts.CompletionInfo, {
1686
+ entries: readonly CompletionEntry[];
1687
+ optionalReplacementSpan: TextSpan;
1688
+ }>;
1689
+ export interface CompletionDetailsResponse extends Response {
1983
1690
  body?: CompletionEntryDetails[];
1984
1691
  }
1985
- /**
1986
- * Signature help information for a single parameter
1987
- */
1988
- interface SignatureHelpParameter {
1989
- /**
1990
- * The parameter's name
1991
- */
1992
- name: string;
1993
- /**
1994
- * Documentation of the parameter.
1995
- */
1996
- documentation: SymbolDisplayPart[];
1997
- /**
1998
- * Display parts of the parameter.
1999
- */
2000
- displayParts: SymbolDisplayPart[];
2001
- /**
2002
- * Whether the parameter is optional or not.
2003
- */
2004
- isOptional: boolean;
2005
- }
2006
1692
  /**
2007
1693
  * Represents a single signature to show in signature help.
2008
1694
  */
2009
- interface SignatureHelpItem {
2010
- /**
2011
- * Whether the signature accepts a variable number of arguments.
2012
- */
2013
- isVariadic: boolean;
2014
- /**
2015
- * The prefix display parts.
2016
- */
2017
- prefixDisplayParts: SymbolDisplayPart[];
2018
- /**
2019
- * The suffix display parts.
2020
- */
2021
- suffixDisplayParts: SymbolDisplayPart[];
2022
- /**
2023
- * The separator display parts.
2024
- */
2025
- separatorDisplayParts: SymbolDisplayPart[];
2026
- /**
2027
- * The signature helps items for the parameters.
2028
- */
2029
- parameters: SignatureHelpParameter[];
2030
- /**
2031
- * The signature's documentation
2032
- */
2033
- documentation: SymbolDisplayPart[];
2034
- /**
2035
- * The signature's JSDoc tags
2036
- */
1695
+ export type SignatureHelpItem = ChangePropertyTypes<ts.SignatureHelpItem, {
2037
1696
  tags: JSDocTagInfo[];
2038
- }
1697
+ }>;
2039
1698
  /**
2040
1699
  * Signature help items found in the response of a signature help request.
2041
1700
  */
2042
- interface SignatureHelpItems {
1701
+ export interface SignatureHelpItems {
2043
1702
  /**
2044
1703
  * The signature help items.
2045
1704
  */
@@ -2061,68 +1720,32 @@ declare namespace ts {
2061
1720
  */
2062
1721
  argumentCount: number;
2063
1722
  }
2064
- type SignatureHelpTriggerCharacter = "," | "(" | "<";
2065
- type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
2066
1723
  /**
2067
1724
  * Arguments of a signature help request.
2068
1725
  */
2069
- interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
1726
+ export interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
2070
1727
  /**
2071
1728
  * Reason why signature help was invoked.
2072
1729
  * See each individual possible
2073
1730
  */
2074
1731
  triggerReason?: SignatureHelpTriggerReason;
2075
1732
  }
2076
- type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
2077
- /**
2078
- * Signals that the user manually requested signature help.
2079
- * The language service will unconditionally attempt to provide a result.
2080
- */
2081
- interface SignatureHelpInvokedReason {
2082
- kind: "invoked";
2083
- triggerCharacter?: undefined;
2084
- }
2085
- /**
2086
- * Signals that the signature help request came from a user typing a character.
2087
- * Depending on the character and the syntactic context, the request may or may not be served a result.
2088
- */
2089
- interface SignatureHelpCharacterTypedReason {
2090
- kind: "characterTyped";
2091
- /**
2092
- * Character that was responsible for triggering signature help.
2093
- */
2094
- triggerCharacter: SignatureHelpTriggerCharacter;
2095
- }
2096
- /**
2097
- * Signals that this signature help request came from typing a character or moving the cursor.
2098
- * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
2099
- * The language service will unconditionally attempt to provide a result.
2100
- * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
2101
- */
2102
- interface SignatureHelpRetriggeredReason {
2103
- kind: "retrigger";
2104
- /**
2105
- * Character that was responsible for triggering signature help.
2106
- */
2107
- triggerCharacter?: SignatureHelpRetriggerCharacter;
2108
- }
2109
1733
  /**
2110
1734
  * Signature help request; value of command field is "signatureHelp".
2111
1735
  * Given a file location (file, line, col), return the signature
2112
1736
  * help.
2113
1737
  */
2114
- interface SignatureHelpRequest extends FileLocationRequest {
1738
+ export interface SignatureHelpRequest extends FileLocationRequest {
2115
1739
  command: CommandTypes.SignatureHelp;
2116
1740
  arguments: SignatureHelpRequestArgs;
2117
1741
  }
2118
1742
  /**
2119
1743
  * Response object for a SignatureHelpRequest.
2120
1744
  */
2121
- interface SignatureHelpResponse extends Response {
1745
+ export interface SignatureHelpResponse extends Response {
2122
1746
  body?: SignatureHelpItems;
2123
1747
  }
2124
- type InlayHintKind = "Type" | "Parameter" | "Enum";
2125
- interface InlayHintsRequestArgs extends FileRequestArgs {
1748
+ export interface InlayHintsRequestArgs extends FileRequestArgs {
2126
1749
  /**
2127
1750
  * Start position of the span.
2128
1751
  */
@@ -2132,68 +1755,90 @@ declare namespace ts {
2132
1755
  */
2133
1756
  length: number;
2134
1757
  }
2135
- interface InlayHintsRequest extends Request {
1758
+ export interface InlayHintsRequest extends Request {
2136
1759
  command: CommandTypes.ProvideInlayHints;
2137
1760
  arguments: InlayHintsRequestArgs;
2138
1761
  }
2139
- interface InlayHintItem {
2140
- /** This property will be the empty string when displayParts is set. */
2141
- text: string;
1762
+ export type InlayHintItem = ChangePropertyTypes<ts.InlayHint, {
2142
1763
  position: Location;
2143
- kind: InlayHintKind;
2144
- whitespaceBefore?: boolean;
2145
- whitespaceAfter?: boolean;
2146
- displayParts?: InlayHintItemDisplayPart[];
2147
- }
2148
- interface InlayHintItemDisplayPart {
1764
+ displayParts: InlayHintItemDisplayPart[];
1765
+ }>;
1766
+ export interface InlayHintItemDisplayPart {
2149
1767
  text: string;
2150
1768
  span?: FileSpan;
2151
1769
  }
2152
- interface InlayHintsResponse extends Response {
1770
+ export interface InlayHintsResponse extends Response {
2153
1771
  body?: InlayHintItem[];
2154
1772
  }
1773
+ export interface MapCodeRequestArgs extends FileRequestArgs {
1774
+ /**
1775
+ * The files and changes to try and apply/map.
1776
+ */
1777
+ mapping: MapCodeRequestDocumentMapping;
1778
+ }
1779
+ export interface MapCodeRequestDocumentMapping {
1780
+ /**
1781
+ * The specific code to map/insert/replace in the file.
1782
+ */
1783
+ contents: string[];
1784
+ /**
1785
+ * Areas of "focus" to inform the code mapper with. For example, cursor
1786
+ * location, current selection, viewport, etc. Nested arrays denote
1787
+ * priority: toplevel arrays are more important than inner arrays, and
1788
+ * inner array priorities are based on items within that array. Items
1789
+ * earlier in the arrays have higher priority.
1790
+ */
1791
+ focusLocations?: TextSpan[][];
1792
+ }
1793
+ export interface MapCodeRequest extends FileRequest {
1794
+ command: CommandTypes.MapCode;
1795
+ arguments: MapCodeRequestArgs;
1796
+ }
1797
+ export interface MapCodeResponse extends Response {
1798
+ body: readonly FileCodeEdits[];
1799
+ }
2155
1800
  /**
2156
1801
  * Synchronous request for semantic diagnostics of one file.
2157
1802
  */
2158
- interface SemanticDiagnosticsSyncRequest extends FileRequest {
1803
+ export interface SemanticDiagnosticsSyncRequest extends FileRequest {
2159
1804
  command: CommandTypes.SemanticDiagnosticsSync;
2160
1805
  arguments: SemanticDiagnosticsSyncRequestArgs;
2161
1806
  }
2162
- interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
1807
+ export interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs {
2163
1808
  includeLinePosition?: boolean;
2164
1809
  }
2165
1810
  /**
2166
1811
  * Response object for synchronous sematic diagnostics request.
2167
1812
  */
2168
- interface SemanticDiagnosticsSyncResponse extends Response {
1813
+ export interface SemanticDiagnosticsSyncResponse extends Response {
2169
1814
  body?: Diagnostic[] | DiagnosticWithLinePosition[];
2170
1815
  }
2171
- interface SuggestionDiagnosticsSyncRequest extends FileRequest {
1816
+ export interface SuggestionDiagnosticsSyncRequest extends FileRequest {
2172
1817
  command: CommandTypes.SuggestionDiagnosticsSync;
2173
1818
  arguments: SuggestionDiagnosticsSyncRequestArgs;
2174
1819
  }
2175
- type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
2176
- type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
1820
+ export type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs;
1821
+ export type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse;
2177
1822
  /**
2178
1823
  * Synchronous request for syntactic diagnostics of one file.
2179
1824
  */
2180
- interface SyntacticDiagnosticsSyncRequest extends FileRequest {
1825
+ export interface SyntacticDiagnosticsSyncRequest extends FileRequest {
2181
1826
  command: CommandTypes.SyntacticDiagnosticsSync;
2182
1827
  arguments: SyntacticDiagnosticsSyncRequestArgs;
2183
1828
  }
2184
- interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
1829
+ export interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs {
2185
1830
  includeLinePosition?: boolean;
2186
1831
  }
2187
1832
  /**
2188
1833
  * Response object for synchronous syntactic diagnostics request.
2189
1834
  */
2190
- interface SyntacticDiagnosticsSyncResponse extends Response {
1835
+ export interface SyntacticDiagnosticsSyncResponse extends Response {
2191
1836
  body?: Diagnostic[] | DiagnosticWithLinePosition[];
2192
1837
  }
2193
1838
  /**
2194
1839
  * Arguments for GeterrForProject request.
2195
1840
  */
2196
- interface GeterrForProjectRequestArgs {
1841
+ export interface GeterrForProjectRequestArgs {
2197
1842
  /**
2198
1843
  * the file requesting project error list
2199
1844
  */
@@ -2209,14 +1854,14 @@ declare namespace ts {
2209
1854
  * "geterrForProject". It works similarly with 'Geterr', only
2210
1855
  * it request for every file in this project.
2211
1856
  */
2212
- interface GeterrForProjectRequest extends Request {
1857
+ export interface GeterrForProjectRequest extends Request {
2213
1858
  command: CommandTypes.GeterrForProject;
2214
1859
  arguments: GeterrForProjectRequestArgs;
2215
1860
  }
2216
1861
  /**
2217
1862
  * Arguments for geterr messages.
2218
1863
  */
2219
- interface GeterrRequestArgs {
1864
+ export interface GeterrRequestArgs {
2220
1865
  /**
2221
1866
  * List of file names for which to compute compiler errors.
2222
1867
  * The files will be checked in list order.
@@ -2238,25 +1883,25 @@ declare namespace ts {
2238
1883
  * practice for an editor is to send a file list containing each
2239
1884
  * file that is currently visible, in most-recently-used order.
2240
1885
  */
2241
- interface GeterrRequest extends Request {
1886
+ export interface GeterrRequest extends Request {
2242
1887
  command: CommandTypes.Geterr;
2243
1888
  arguments: GeterrRequestArgs;
2244
1889
  }
2245
- type RequestCompletedEventName = "requestCompleted";
1890
+ export type RequestCompletedEventName = "requestCompleted";
2246
1891
  /**
2247
1892
  * Event that is sent when server have finished processing request with specified id.
2248
1893
  */
2249
- interface RequestCompletedEvent extends Event {
1894
+ export interface RequestCompletedEvent extends Event {
2250
1895
  event: RequestCompletedEventName;
2251
1896
  body: RequestCompletedEventBody;
2252
1897
  }
2253
- interface RequestCompletedEventBody {
1898
+ export interface RequestCompletedEventBody {
2254
1899
  request_seq: number;
2255
1900
  }
2256
1901
  /**
2257
1902
  * Item of diagnostic information found in a DiagnosticEvent message.
2258
1903
  */
2259
- interface Diagnostic {
1904
+ export interface Diagnostic {
2260
1905
  /**
2261
1906
  * Starting file location at which text applies.
2262
1907
  */
@@ -2288,7 +1933,7 @@ declare namespace ts {
2288
1933
  */
2289
1934
  source?: string;
2290
1935
  }
2291
- interface DiagnosticWithFileName extends Diagnostic {
1936
+ export interface DiagnosticWithFileName extends Diagnostic {
2292
1937
  /**
2293
1938
  * Name of the file the diagnostic is in
2294
1939
  */
@@ -2297,7 +1942,7 @@ declare namespace ts {
2297
1942
  /**
2298
1943
  * Represents additional spans returned with a diagnostic which are relevant to it
2299
1944
  */
2300
- interface DiagnosticRelatedInformation {
1945
+ export interface DiagnosticRelatedInformation {
2301
1946
  /**
2302
1947
  * The category of the related information message, e.g. "error", "warning", or "suggestion".
2303
1948
  */
@@ -2315,7 +1960,7 @@ declare namespace ts {
2315
1960
  */
2316
1961
  span?: FileSpan;
2317
1962
  }
2318
- interface DiagnosticEventBody {
1963
+ export interface DiagnosticEventBody {
2319
1964
  /**
2320
1965
  * The file for which diagnostic information is reported.
2321
1966
  */
@@ -2325,16 +1970,16 @@ declare namespace ts {
2325
1970
  */
2326
1971
  diagnostics: Diagnostic[];
2327
1972
  }
2328
- type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
1973
+ export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
2329
1974
  /**
2330
1975
  * Event message for DiagnosticEventKind event types.
2331
1976
  * These events provide syntactic and semantic errors for a file.
2332
1977
  */
2333
- interface DiagnosticEvent extends Event {
1978
+ export interface DiagnosticEvent extends Event {
2334
1979
  body?: DiagnosticEventBody;
2335
1980
  event: DiagnosticEventKind;
2336
1981
  }
2337
- interface ConfigFileDiagnosticEventBody {
1982
+ export interface ConfigFileDiagnosticEventBody {
2338
1983
  /**
2339
1984
  * The file which trigged the searching and error-checking of the config file
2340
1985
  */
@@ -2352,16 +1997,16 @@ declare namespace ts {
2352
1997
  * Event message for "configFileDiag" event type.
2353
1998
  * This event provides errors for a found config file.
2354
1999
  */
2355
- interface ConfigFileDiagnosticEvent extends Event {
2000
+ export interface ConfigFileDiagnosticEvent extends Event {
2356
2001
  body?: ConfigFileDiagnosticEventBody;
2357
2002
  event: "configFileDiag";
2358
2003
  }
2359
- type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
2360
- interface ProjectLanguageServiceStateEvent extends Event {
2004
+ export type ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
2005
+ export interface ProjectLanguageServiceStateEvent extends Event {
2361
2006
  event: ProjectLanguageServiceStateEventName;
2362
2007
  body?: ProjectLanguageServiceStateEventBody;
2363
2008
  }
2364
- interface ProjectLanguageServiceStateEventBody {
2009
+ export interface ProjectLanguageServiceStateEventBody {
2365
2010
  /**
2366
2011
  * Project name that has changes in the state of language service.
2367
2012
  * For configured projects this will be the config file path.
@@ -2375,52 +2020,52 @@ declare namespace ts {
2375
2020
  */
2376
2021
  languageServiceEnabled: boolean;
2377
2022
  }
2378
- type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
2379
- interface ProjectsUpdatedInBackgroundEvent extends Event {
2023
+ export type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground";
2024
+ export interface ProjectsUpdatedInBackgroundEvent extends Event {
2380
2025
  event: ProjectsUpdatedInBackgroundEventName;
2381
2026
  body: ProjectsUpdatedInBackgroundEventBody;
2382
2027
  }
2383
- interface ProjectsUpdatedInBackgroundEventBody {
2028
+ export interface ProjectsUpdatedInBackgroundEventBody {
2384
2029
  /**
2385
2030
  * Current set of open files
2386
2031
  */
2387
2032
  openFiles: string[];
2388
2033
  }
2389
- type ProjectLoadingStartEventName = "projectLoadingStart";
2390
- interface ProjectLoadingStartEvent extends Event {
2034
+ export type ProjectLoadingStartEventName = "projectLoadingStart";
2035
+ export interface ProjectLoadingStartEvent extends Event {
2391
2036
  event: ProjectLoadingStartEventName;
2392
2037
  body: ProjectLoadingStartEventBody;
2393
2038
  }
2394
- interface ProjectLoadingStartEventBody {
2039
+ export interface ProjectLoadingStartEventBody {
2395
2040
  /** name of the project */
2396
2041
  projectName: string;
2397
2042
  /** reason for loading */
2398
2043
  reason: string;
2399
2044
  }
2400
- type ProjectLoadingFinishEventName = "projectLoadingFinish";
2401
- interface ProjectLoadingFinishEvent extends Event {
2045
+ export type ProjectLoadingFinishEventName = "projectLoadingFinish";
2046
+ export interface ProjectLoadingFinishEvent extends Event {
2402
2047
  event: ProjectLoadingFinishEventName;
2403
2048
  body: ProjectLoadingFinishEventBody;
2404
2049
  }
2405
- interface ProjectLoadingFinishEventBody {
2050
+ export interface ProjectLoadingFinishEventBody {
2406
2051
  /** name of the project */
2407
2052
  projectName: string;
2408
2053
  }
2409
- type SurveyReadyEventName = "surveyReady";
2410
- interface SurveyReadyEvent extends Event {
2054
+ export type SurveyReadyEventName = "surveyReady";
2055
+ export interface SurveyReadyEvent extends Event {
2411
2056
  event: SurveyReadyEventName;
2412
2057
  body: SurveyReadyEventBody;
2413
2058
  }
2414
- interface SurveyReadyEventBody {
2059
+ export interface SurveyReadyEventBody {
2415
2060
  /** Name of the survey. This is an internal machine- and programmer-friendly name */
2416
2061
  surveyId: string;
2417
2062
  }
2418
- type LargeFileReferencedEventName = "largeFileReferenced";
2419
- interface LargeFileReferencedEvent extends Event {
2063
+ export type LargeFileReferencedEventName = "largeFileReferenced";
2064
+ export interface LargeFileReferencedEvent extends Event {
2420
2065
  event: LargeFileReferencedEventName;
2421
2066
  body: LargeFileReferencedEventBody;
2422
2067
  }
2423
- interface LargeFileReferencedEventBody {
2068
+ export interface LargeFileReferencedEventBody {
2424
2069
  /**
2425
2070
  * name of the large file being loaded
2426
2071
  */
@@ -2434,37 +2079,38 @@ declare namespace ts {
2434
2079
  */
2435
2080
  maxFileSize: number;
2436
2081
  }
2437
- type CreateFileWatcherEventName = "createFileWatcher";
2438
- interface CreateFileWatcherEvent extends Event {
2082
+ export type CreateFileWatcherEventName = "createFileWatcher";
2083
+ export interface CreateFileWatcherEvent extends Event {
2439
2084
  readonly event: CreateFileWatcherEventName;
2440
2085
  readonly body: CreateFileWatcherEventBody;
2441
2086
  }
2442
- interface CreateFileWatcherEventBody {
2087
+ export interface CreateFileWatcherEventBody {
2443
2088
  readonly id: number;
2444
2089
  readonly path: string;
2445
2090
  }
2446
- type CreateDirectoryWatcherEventName = "createDirectoryWatcher";
2447
- interface CreateDirectoryWatcherEvent extends Event {
2091
+ export type CreateDirectoryWatcherEventName = "createDirectoryWatcher";
2092
+ export interface CreateDirectoryWatcherEvent extends Event {
2448
2093
  readonly event: CreateDirectoryWatcherEventName;
2449
2094
  readonly body: CreateDirectoryWatcherEventBody;
2450
2095
  }
2451
- interface CreateDirectoryWatcherEventBody {
2096
+ export interface CreateDirectoryWatcherEventBody {
2452
2097
  readonly id: number;
2453
2098
  readonly path: string;
2454
2099
  readonly recursive: boolean;
2100
+ readonly ignoreUpdate?: boolean;
2455
2101
  }
2456
- type CloseFileWatcherEventName = "closeFileWatcher";
2457
- interface CloseFileWatcherEvent extends Event {
2102
+ export type CloseFileWatcherEventName = "closeFileWatcher";
2103
+ export interface CloseFileWatcherEvent extends Event {
2458
2104
  readonly event: CloseFileWatcherEventName;
2459
2105
  readonly body: CloseFileWatcherEventBody;
2460
2106
  }
2461
- interface CloseFileWatcherEventBody {
2107
+ export interface CloseFileWatcherEventBody {
2462
2108
  readonly id: number;
2463
2109
  }
2464
2110
  /**
2465
2111
  * Arguments for reload request.
2466
2112
  */
2467
- interface ReloadRequestArgs extends FileRequestArgs {
2113
+ export interface ReloadRequestArgs extends FileRequestArgs {
2468
2114
  /**
2469
2115
  * Name of temporary file from which to reload file
2470
2116
  * contents. May be same as file.
@@ -2477,7 +2123,7 @@ declare namespace ts {
2477
2123
  * from temporary file with name given by the 'tmpfile' argument.
2478
2124
  * The two names can be identical.
2479
2125
  */
2480
- interface ReloadRequest extends FileRequest {
2126
+ export interface ReloadRequest extends FileRequest {
2481
2127
  command: CommandTypes.Reload;
2482
2128
  arguments: ReloadRequestArgs;
2483
2129
  }
@@ -2485,12 +2131,12 @@ declare namespace ts {
2485
2131
  * Response to "reload" request. This is just an acknowledgement, so
2486
2132
  * no body field is required.
2487
2133
  */
2488
- interface ReloadResponse extends Response {
2134
+ export interface ReloadResponse extends Response {
2489
2135
  }
2490
2136
  /**
2491
2137
  * Arguments for saveto request.
2492
2138
  */
2493
- interface SavetoRequestArgs extends FileRequestArgs {
2139
+ export interface SavetoRequestArgs extends FileRequestArgs {
2494
2140
  /**
2495
2141
  * Name of temporary file into which to save server's view of
2496
2142
  * file contents.
@@ -2504,14 +2150,14 @@ declare namespace ts {
2504
2150
  * 'file'. The server does not currently send a response to a
2505
2151
  * "saveto" request.
2506
2152
  */
2507
- interface SavetoRequest extends FileRequest {
2153
+ export interface SavetoRequest extends FileRequest {
2508
2154
  command: CommandTypes.Saveto;
2509
2155
  arguments: SavetoRequestArgs;
2510
2156
  }
2511
2157
  /**
2512
2158
  * Arguments for navto request message.
2513
2159
  */
2514
- interface NavtoRequestArgs {
2160
+ export interface NavtoRequestArgs {
2515
2161
  /**
2516
2162
  * Search term to navigate to from current location; term can
2517
2163
  * be '.*' or an identifier prefix.
@@ -2538,14 +2184,14 @@ declare namespace ts {
2538
2184
  * match the search term given in argument 'searchTerm'. The
2539
2185
  * context for the search is given by the named file.
2540
2186
  */
2541
- interface NavtoRequest extends Request {
2187
+ export interface NavtoRequest extends Request {
2542
2188
  command: CommandTypes.Navto;
2543
2189
  arguments: NavtoRequestArgs;
2544
2190
  }
2545
2191
  /**
2546
2192
  * An item found in a navto response.
2547
2193
  */
2548
- interface NavtoItem extends FileSpan {
2194
+ export interface NavtoItem extends FileSpan {
2549
2195
  /**
2550
2196
  * The symbol's name.
2551
2197
  */
@@ -2580,13 +2226,13 @@ declare namespace ts {
2580
2226
  * Navto response message. Body is an array of navto items. Each
2581
2227
  * item gives a symbol that matched the search term.
2582
2228
  */
2583
- interface NavtoResponse extends Response {
2229
+ export interface NavtoResponse extends Response {
2584
2230
  body?: NavtoItem[];
2585
2231
  }
2586
2232
  /**
2587
2233
  * Arguments for change request message.
2588
2234
  */
2589
- interface ChangeRequestArgs extends FormatRequestArgs {
2235
+ export interface ChangeRequestArgs extends FormatRequestArgs {
2590
2236
  /**
2591
2237
  * Optional string to insert at location (file, line, offset).
2592
2238
  */
@@ -2597,14 +2243,14 @@ declare namespace ts {
2597
2243
  * Update the server's view of the file named by argument 'file'.
2598
2244
  * Server does not currently send a response to a change request.
2599
2245
  */
2600
- interface ChangeRequest extends FileLocationRequest {
2246
+ export interface ChangeRequest extends FileLocationRequest {
2601
2247
  command: CommandTypes.Change;
2602
2248
  arguments: ChangeRequestArgs;
2603
2249
  }
2604
2250
  /**
2605
2251
  * Response to "brace" request.
2606
2252
  */
2607
- interface BraceResponse extends Response {
2253
+ export interface BraceResponse extends Response {
2608
2254
  body?: TextSpan[];
2609
2255
  }
2610
2256
  /**
@@ -2612,7 +2258,7 @@ declare namespace ts {
2612
2258
  * Return response giving the file locations of matching braces
2613
2259
  * found in file at location line, offset.
2614
2260
  */
2615
- interface BraceRequest extends FileLocationRequest {
2261
+ export interface BraceRequest extends FileLocationRequest {
2616
2262
  command: CommandTypes.Brace;
2617
2263
  }
2618
2264
  /**
@@ -2620,17 +2266,17 @@ declare namespace ts {
2620
2266
  * Return response giving the list of navigation bar entries
2621
2267
  * extracted from the requested file.
2622
2268
  */
2623
- interface NavBarRequest extends FileRequest {
2269
+ export interface NavBarRequest extends FileRequest {
2624
2270
  command: CommandTypes.NavBar;
2625
2271
  }
2626
2272
  /**
2627
2273
  * NavTree request; value of command field is "navtree".
2628
2274
  * Return response giving the navigation tree of the requested file.
2629
2275
  */
2630
- interface NavTreeRequest extends FileRequest {
2276
+ export interface NavTreeRequest extends FileRequest {
2631
2277
  command: CommandTypes.NavTree;
2632
2278
  }
2633
- interface NavigationBarItem {
2279
+ export interface NavigationBarItem {
2634
2280
  /**
2635
2281
  * The item's display text.
2636
2282
  */
@@ -2657,7 +2303,7 @@ declare namespace ts {
2657
2303
  indent: number;
2658
2304
  }
2659
2305
  /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */
2660
- interface NavigationTree {
2306
+ export interface NavigationTree {
2661
2307
  text: string;
2662
2308
  kind: ScriptElementKind;
2663
2309
  kindModifiers: string;
@@ -2665,29 +2311,29 @@ declare namespace ts {
2665
2311
  nameSpan: TextSpan | undefined;
2666
2312
  childItems?: NavigationTree[];
2667
2313
  }
2668
- type TelemetryEventName = "telemetry";
2669
- interface TelemetryEvent extends Event {
2314
+ export type TelemetryEventName = "telemetry";
2315
+ export interface TelemetryEvent extends Event {
2670
2316
  event: TelemetryEventName;
2671
2317
  body: TelemetryEventBody;
2672
2318
  }
2673
- interface TelemetryEventBody {
2319
+ export interface TelemetryEventBody {
2674
2320
  telemetryEventName: string;
2675
2321
  payload: any;
2676
2322
  }
2677
- type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
2678
- interface TypesInstallerInitializationFailedEvent extends Event {
2323
+ export type TypesInstallerInitializationFailedEventName = "typesInstallerInitializationFailed";
2324
+ export interface TypesInstallerInitializationFailedEvent extends Event {
2679
2325
  event: TypesInstallerInitializationFailedEventName;
2680
2326
  body: TypesInstallerInitializationFailedEventBody;
2681
2327
  }
2682
- interface TypesInstallerInitializationFailedEventBody {
2328
+ export interface TypesInstallerInitializationFailedEventBody {
2683
2329
  message: string;
2684
2330
  }
2685
- type TypingsInstalledTelemetryEventName = "typingsInstalled";
2686
- interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
2331
+ export type TypingsInstalledTelemetryEventName = "typingsInstalled";
2332
+ export interface TypingsInstalledTelemetryEventBody extends TelemetryEventBody {
2687
2333
  telemetryEventName: TypingsInstalledTelemetryEventName;
2688
2334
  payload: TypingsInstalledTelemetryEventPayload;
2689
2335
  }
2690
- interface TypingsInstalledTelemetryEventPayload {
2336
+ export interface TypingsInstalledTelemetryEventPayload {
2691
2337
  /**
2692
2338
  * Comma separated list of installed typing packages
2693
2339
  */
@@ -2701,17 +2347,17 @@ declare namespace ts {
2701
2347
  */
2702
2348
  typingsInstallerVersion: string;
2703
2349
  }
2704
- type BeginInstallTypesEventName = "beginInstallTypes";
2705
- type EndInstallTypesEventName = "endInstallTypes";
2706
- interface BeginInstallTypesEvent extends Event {
2350
+ export type BeginInstallTypesEventName = "beginInstallTypes";
2351
+ export type EndInstallTypesEventName = "endInstallTypes";
2352
+ export interface BeginInstallTypesEvent extends Event {
2707
2353
  event: BeginInstallTypesEventName;
2708
2354
  body: BeginInstallTypesEventBody;
2709
2355
  }
2710
- interface EndInstallTypesEvent extends Event {
2356
+ export interface EndInstallTypesEvent extends Event {
2711
2357
  event: EndInstallTypesEventName;
2712
2358
  body: EndInstallTypesEventBody;
2713
2359
  }
2714
- interface InstallTypesEventBody {
2360
+ export interface InstallTypesEventBody {
2715
2361
  /**
2716
2362
  * correlation id to match begin and end events
2717
2363
  */
@@ -2721,425 +2367,254 @@ declare namespace ts {
2721
2367
  */
2722
2368
  packages: readonly string[];
2723
2369
  }
2724
- interface BeginInstallTypesEventBody extends InstallTypesEventBody {
2370
+ export interface BeginInstallTypesEventBody extends InstallTypesEventBody {
2725
2371
  }
2726
- interface EndInstallTypesEventBody extends InstallTypesEventBody {
2372
+ export interface EndInstallTypesEventBody extends InstallTypesEventBody {
2727
2373
  /**
2728
2374
  * true if installation succeeded, otherwise false
2729
2375
  */
2730
2376
  success: boolean;
2731
2377
  }
2732
- interface NavBarResponse extends Response {
2378
+ export interface NavBarResponse extends Response {
2733
2379
  body?: NavigationBarItem[];
2734
2380
  }
2735
- interface NavTreeResponse extends Response {
2381
+ export interface NavTreeResponse extends Response {
2736
2382
  body?: NavigationTree;
2737
2383
  }
2738
- interface CallHierarchyItem {
2739
- name: string;
2740
- kind: ScriptElementKind;
2741
- kindModifiers?: string;
2742
- file: string;
2384
+ export type CallHierarchyItem = ChangePropertyTypes<ts.CallHierarchyItem, {
2743
2385
  span: TextSpan;
2744
2386
  selectionSpan: TextSpan;
2745
- containerName?: string;
2746
- }
2747
- interface CallHierarchyIncomingCall {
2387
+ }>;
2388
+ export interface CallHierarchyIncomingCall {
2748
2389
  from: CallHierarchyItem;
2749
2390
  fromSpans: TextSpan[];
2750
2391
  }
2751
- interface CallHierarchyOutgoingCall {
2392
+ export interface CallHierarchyOutgoingCall {
2752
2393
  to: CallHierarchyItem;
2753
2394
  fromSpans: TextSpan[];
2754
2395
  }
2755
- interface PrepareCallHierarchyRequest extends FileLocationRequest {
2396
+ export interface PrepareCallHierarchyRequest extends FileLocationRequest {
2756
2397
  command: CommandTypes.PrepareCallHierarchy;
2757
2398
  }
2758
- interface PrepareCallHierarchyResponse extends Response {
2399
+ export interface PrepareCallHierarchyResponse extends Response {
2759
2400
  readonly body: CallHierarchyItem | CallHierarchyItem[];
2760
2401
  }
2761
- interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
2402
+ export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
2762
2403
  command: CommandTypes.ProvideCallHierarchyIncomingCalls;
2763
2404
  }
2764
- interface ProvideCallHierarchyIncomingCallsResponse extends Response {
2405
+ export interface ProvideCallHierarchyIncomingCallsResponse extends Response {
2765
2406
  readonly body: CallHierarchyIncomingCall[];
2766
2407
  }
2767
- interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
2408
+ export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
2768
2409
  command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
2769
2410
  }
2770
- interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
2411
+ export interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
2771
2412
  readonly body: CallHierarchyOutgoingCall[];
2772
2413
  }
2773
- enum IndentStyle {
2414
+ export enum IndentStyle {
2774
2415
  None = "None",
2775
2416
  Block = "Block",
2776
2417
  Smart = "Smart",
2777
2418
  }
2778
- enum SemicolonPreference {
2779
- Ignore = "ignore",
2780
- Insert = "insert",
2781
- Remove = "remove",
2782
- }
2783
- interface EditorSettings {
2784
- baseIndentSize?: number;
2785
- indentSize?: number;
2786
- tabSize?: number;
2787
- newLineCharacter?: string;
2788
- convertTabsToSpaces?: boolean;
2789
- indentStyle?: IndentStyle | ts.IndentStyle;
2790
- trimTrailingWhitespace?: boolean;
2791
- }
2792
- interface FormatCodeSettings extends EditorSettings {
2793
- insertSpaceAfterCommaDelimiter?: boolean;
2794
- insertSpaceAfterSemicolonInForStatements?: boolean;
2795
- insertSpaceBeforeAndAfterBinaryOperators?: boolean;
2796
- insertSpaceAfterConstructor?: boolean;
2797
- insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
2798
- insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
2799
- insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
2800
- insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
2801
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
2802
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
2803
- insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
2804
- insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
2805
- insertSpaceAfterTypeAssertion?: boolean;
2806
- insertSpaceBeforeFunctionParenthesis?: boolean;
2807
- placeOpenBraceOnNewLineForFunctions?: boolean;
2808
- placeOpenBraceOnNewLineForControlBlocks?: boolean;
2809
- insertSpaceBeforeTypeAnnotation?: boolean;
2810
- semicolons?: SemicolonPreference;
2811
- indentSwitchCase?: boolean;
2812
- }
2813
- interface UserPreferences {
2814
- readonly disableSuggestions?: boolean;
2815
- readonly quotePreference?: "auto" | "double" | "single";
2816
- /**
2817
- * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
2818
- * This affects lone identifier completions but not completions on the right hand side of `obj.`.
2819
- */
2820
- readonly includeCompletionsForModuleExports?: boolean;
2821
- /**
2822
- * Enables auto-import-style completions on partially-typed import statements. E.g., allows
2823
- * `import write|` to be completed to `import { writeFile } from "fs"`.
2824
- */
2825
- readonly includeCompletionsForImportStatements?: boolean;
2826
- /**
2827
- * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
2828
- */
2829
- readonly includeCompletionsWithSnippetText?: boolean;
2830
- /**
2831
- * If enabled, the completion list will include completions with invalid identifier names.
2832
- * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
2833
- */
2834
- readonly includeCompletionsWithInsertText?: boolean;
2835
- /**
2836
- * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
2837
- * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
2838
- * values, with insertion text to replace preceding `.` tokens with `?.`.
2839
- */
2840
- readonly includeAutomaticOptionalChainCompletions?: boolean;
2841
- /**
2842
- * If enabled, completions for class members (e.g. methods and properties) will include
2843
- * a whole declaration for the member.
2844
- * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
2845
- * `class A { foo }`.
2846
- */
2847
- readonly includeCompletionsWithClassMemberSnippets?: boolean;
2848
- /**
2849
- * If enabled, object literal methods will have a method declaration completion entry in addition
2850
- * to the regular completion entry containing just the method name.
2851
- * E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
2852
- * in addition to `const objectLiteral: T = { foo }`.
2853
- */
2854
- readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
2855
- /**
2856
- * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
2857
- * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
2858
- */
2859
- readonly useLabelDetailsInCompletionEntries?: boolean;
2860
- readonly allowIncompleteCompletions?: boolean;
2861
- readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
2862
- /** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
2863
- readonly importModuleSpecifierEnding?: "auto" | "minimal" | "index" | "js";
2864
- readonly allowTextChangesInNewFiles?: boolean;
2865
- readonly lazyConfiguredProjectsFromExternalProject?: boolean;
2866
- readonly providePrefixAndSuffixTextForRename?: boolean;
2867
- readonly provideRefactorNotApplicableReason?: boolean;
2868
- readonly allowRenameOfImportPath?: boolean;
2869
- readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
2870
- readonly jsxAttributeCompletionStyle?: "auto" | "braces" | "none";
2871
- readonly displayPartsForJSDoc?: boolean;
2872
- readonly generateReturnInDocTemplate?: boolean;
2873
- readonly includeInlayParameterNameHints?: "none" | "literals" | "all";
2874
- readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
2875
- readonly includeInlayFunctionParameterTypeHints?: boolean;
2876
- readonly includeInlayVariableTypeHints?: boolean;
2877
- readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
2878
- readonly includeInlayPropertyDeclarationTypeHints?: boolean;
2879
- readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
2880
- readonly includeInlayEnumMemberValueHints?: boolean;
2881
- readonly interactiveInlayHints?: boolean;
2882
- readonly autoImportFileExcludePatterns?: string[];
2883
- /**
2884
- * Indicates whether imports should be organized in a case-insensitive manner.
2885
- */
2886
- readonly organizeImportsIgnoreCase?: "auto" | boolean;
2887
- /**
2888
- * Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value
2889
- * of their code points, or via "unicode" collation (via the
2890
- * [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale
2891
- * specified in {@link organizeImportsCollationLocale}.
2892
- *
2893
- * Default: `"ordinal"`.
2894
- */
2895
- readonly organizeImportsCollation?: "ordinal" | "unicode";
2896
- /**
2897
- * Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant
2898
- * for the sake of consistent sorting. Use `"auto"` to use the detected UI locale.
2899
- *
2900
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
2901
- *
2902
- * Default: `"en"`
2903
- */
2904
- readonly organizeImportsCollationLocale?: string;
2905
- /**
2906
- * Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate
2907
- * strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`.
2908
- *
2909
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
2910
- *
2911
- * Default: `false`
2912
- */
2913
- readonly organizeImportsNumericCollation?: boolean;
2914
- /**
2915
- * Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When
2916
- * `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified
2917
- * in {@link organizeImportsCollationLocale}.
2918
- *
2919
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
2920
- *
2921
- * Default: `true`
2922
- */
2923
- readonly organizeImportsAccentCollation?: boolean;
2924
- /**
2925
- * Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale
2926
- * specified in {@link organizeImportsCollationLocale} is used.
2927
- *
2928
- * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. This preference is also
2929
- * ignored if we are using case-insensitive sorting, which occurs when {@link organizeImportsIgnoreCase} is `true`,
2930
- * or if {@link organizeImportsIgnoreCase} is `"auto"` and the auto-detected case sensitivity is determined to be
2931
- * case-insensitive.
2932
- *
2933
- * Default: `false`
2934
- */
2935
- readonly organizeImportsCaseFirst?: "upper" | "lower" | false;
2936
- /**
2937
- * Indicates where named type-only imports should sort. "inline" sorts named imports without regard to if the import is
2938
- * type-only.
2939
- *
2940
- * Default: `last`
2941
- */
2942
- readonly organizeImportsTypeOrder?: "last" | "first" | "inline";
2943
- /**
2944
- * Indicates whether {@link ReferencesResponseItem.lineText} is supported.
2945
- */
2946
- readonly disableLineTextInReferences?: boolean;
2947
- /**
2948
- * Indicates whether to exclude standard library and node_modules file symbols from navTo results.
2949
- */
2950
- readonly excludeLibrarySymbolsInNavTo?: boolean;
2951
- }
2952
- interface CompilerOptions {
2953
- allowJs?: boolean;
2954
- allowSyntheticDefaultImports?: boolean;
2955
- allowUnreachableCode?: boolean;
2956
- allowUnusedLabels?: boolean;
2957
- alwaysStrict?: boolean;
2958
- baseUrl?: string;
2959
- charset?: string;
2960
- checkJs?: boolean;
2961
- declaration?: boolean;
2962
- declarationDir?: string;
2963
- disableSizeLimit?: boolean;
2964
- downlevelIteration?: boolean;
2965
- emitBOM?: boolean;
2966
- emitDecoratorMetadata?: boolean;
2967
- experimentalDecorators?: boolean;
2968
- forceConsistentCasingInFileNames?: boolean;
2969
- importHelpers?: boolean;
2970
- inlineSourceMap?: boolean;
2971
- inlineSources?: boolean;
2972
- isolatedModules?: boolean;
2973
- jsx?: JsxEmit | ts.JsxEmit;
2974
- lib?: string[];
2975
- locale?: string;
2976
- mapRoot?: string;
2977
- maxNodeModuleJsDepth?: number;
2978
- module?: ModuleKind | ts.ModuleKind;
2979
- moduleResolution?: ModuleResolutionKind | ts.ModuleResolutionKind;
2980
- newLine?: NewLineKind | ts.NewLineKind;
2981
- noEmit?: boolean;
2982
- noEmitHelpers?: boolean;
2983
- noEmitOnError?: boolean;
2984
- noErrorTruncation?: boolean;
2985
- noFallthroughCasesInSwitch?: boolean;
2986
- noImplicitAny?: boolean;
2987
- noImplicitReturns?: boolean;
2988
- noImplicitThis?: boolean;
2989
- noUnusedLocals?: boolean;
2990
- noUnusedParameters?: boolean;
2991
- noImplicitUseStrict?: boolean;
2992
- noLib?: boolean;
2993
- noResolve?: boolean;
2994
- out?: string;
2995
- outDir?: string;
2996
- outFile?: string;
2997
- paths?: MapLike<string[]>;
2998
- plugins?: PluginImport[];
2999
- preserveConstEnums?: boolean;
3000
- preserveSymlinks?: boolean;
3001
- project?: string;
3002
- reactNamespace?: string;
3003
- removeComments?: boolean;
3004
- references?: ProjectReference[];
3005
- rootDir?: string;
3006
- rootDirs?: string[];
3007
- skipLibCheck?: boolean;
3008
- skipDefaultLibCheck?: boolean;
3009
- sourceMap?: boolean;
3010
- sourceRoot?: string;
3011
- strict?: boolean;
3012
- strictNullChecks?: boolean;
3013
- suppressExcessPropertyErrors?: boolean;
3014
- suppressImplicitAnyIndexErrors?: boolean;
3015
- useDefineForClassFields?: boolean;
3016
- target?: ScriptTarget | ts.ScriptTarget;
3017
- traceResolution?: boolean;
3018
- resolveJsonModule?: boolean;
3019
- types?: string[];
3020
- /** Paths used to used to compute primary types search locations */
3021
- typeRoots?: string[];
3022
- [option: string]: CompilerOptionsValue | undefined;
3023
- }
3024
- enum JsxEmit {
3025
- None = "None",
3026
- Preserve = "Preserve",
3027
- ReactNative = "ReactNative",
3028
- React = "React",
3029
- }
3030
- enum ModuleKind {
3031
- None = "None",
3032
- CommonJS = "CommonJS",
3033
- AMD = "AMD",
3034
- UMD = "UMD",
3035
- System = "System",
3036
- ES6 = "ES6",
3037
- ES2015 = "ES2015",
3038
- ESNext = "ESNext",
3039
- Node16 = "Node16",
3040
- NodeNext = "NodeNext",
3041
- Preserve = "Preserve",
3042
- }
3043
- enum ModuleResolutionKind {
3044
- Classic = "Classic",
2419
+ export type EditorSettings = ChangePropertyTypes<ts.EditorSettings, {
2420
+ indentStyle: IndentStyle | ts.IndentStyle;
2421
+ }>;
2422
+ export type FormatCodeSettings = ChangePropertyTypes<ts.FormatCodeSettings, {
2423
+ indentStyle: IndentStyle | ts.IndentStyle;
2424
+ }>;
2425
+ export type CompilerOptions = ChangePropertyTypes<ChangeStringIndexSignature<ts.CompilerOptions, CompilerOptionsValue>, {
2426
+ jsx: JsxEmit | ts.JsxEmit;
2427
+ module: ModuleKind | ts.ModuleKind;
2428
+ moduleResolution: ModuleResolutionKind | ts.ModuleResolutionKind;
2429
+ newLine: NewLineKind | ts.NewLineKind;
2430
+ target: ScriptTarget | ts.ScriptTarget;
2431
+ }>;
2432
+ export enum JsxEmit {
2433
+ None = "none",
2434
+ Preserve = "preserve",
2435
+ ReactNative = "react-native",
2436
+ React = "react",
2437
+ ReactJSX = "react-jsx",
2438
+ ReactJSXDev = "react-jsxdev",
2439
+ }
2440
+ export enum ModuleKind {
2441
+ None = "none",
2442
+ CommonJS = "commonjs",
2443
+ AMD = "amd",
2444
+ UMD = "umd",
2445
+ System = "system",
2446
+ ES6 = "es6",
2447
+ ES2015 = "es2015",
2448
+ ES2020 = "es2020",
2449
+ ES2022 = "es2022",
2450
+ ESNext = "esnext",
2451
+ Node16 = "node16",
2452
+ NodeNext = "nodenext",
2453
+ Preserve = "preserve",
2454
+ }
2455
+ export enum ModuleResolutionKind {
2456
+ Classic = "classic",
2457
+ /** @deprecated Renamed to `Node10` */
2458
+ Node = "node",
3045
2459
  /** @deprecated Renamed to `Node10` */
3046
- Node = "Node",
3047
- Node10 = "Node10",
3048
- Node16 = "Node16",
3049
- NodeNext = "NodeNext",
3050
- Bundler = "Bundler",
2460
+ NodeJs = "node",
2461
+ Node10 = "node10",
2462
+ Node16 = "node16",
2463
+ NodeNext = "nodenext",
2464
+ Bundler = "bundler",
3051
2465
  }
3052
- enum NewLineKind {
2466
+ export enum NewLineKind {
3053
2467
  Crlf = "Crlf",
3054
2468
  Lf = "Lf",
3055
2469
  }
3056
- enum ScriptTarget {
3057
- ES3 = "ES3",
3058
- ES5 = "ES5",
3059
- ES6 = "ES6",
3060
- ES2015 = "ES2015",
3061
- ES2016 = "ES2016",
3062
- ES2017 = "ES2017",
3063
- ES2018 = "ES2018",
3064
- ES2019 = "ES2019",
3065
- ES2020 = "ES2020",
3066
- ES2021 = "ES2021",
3067
- ES2022 = "ES2022",
3068
- ESNext = "ESNext",
3069
- }
3070
- enum ClassificationType {
3071
- comment = 1,
3072
- identifier = 2,
3073
- keyword = 3,
3074
- numericLiteral = 4,
3075
- operator = 5,
3076
- stringLiteral = 6,
3077
- regularExpressionLiteral = 7,
3078
- whiteSpace = 8,
3079
- text = 9,
3080
- punctuation = 10,
3081
- className = 11,
3082
- enumName = 12,
3083
- interfaceName = 13,
3084
- moduleName = 14,
3085
- typeParameterName = 15,
3086
- typeAliasName = 16,
3087
- parameterName = 17,
3088
- docCommentTagName = 18,
3089
- jsxOpenTagName = 19,
3090
- jsxCloseTagName = 20,
3091
- jsxSelfClosingTagName = 21,
3092
- jsxAttribute = 22,
3093
- jsxText = 23,
3094
- jsxAttributeStringLiteralValue = 24,
3095
- bigintLiteral = 25,
2470
+ export enum ScriptTarget {
2471
+ /** @deprecated */
2472
+ ES3 = "es3",
2473
+ ES5 = "es5",
2474
+ ES6 = "es6",
2475
+ ES2015 = "es2015",
2476
+ ES2016 = "es2016",
2477
+ ES2017 = "es2017",
2478
+ ES2018 = "es2018",
2479
+ ES2019 = "es2019",
2480
+ ES2020 = "es2020",
2481
+ ES2021 = "es2021",
2482
+ ES2022 = "es2022",
2483
+ ES2023 = "es2023",
2484
+ ESNext = "esnext",
2485
+ JSON = "json",
2486
+ Latest = "esnext",
2487
+ }
2488
+ }
2489
+ namespace typingsInstaller {
2490
+ interface Log {
2491
+ isEnabled(): boolean;
2492
+ writeLine(text: string): void;
3096
2493
  }
2494
+ type RequestCompletedAction = (success: boolean) => void;
2495
+ interface PendingRequest {
2496
+ requestId: number;
2497
+ packageNames: string[];
2498
+ cwd: string;
2499
+ onRequestCompleted: RequestCompletedAction;
2500
+ }
2501
+ abstract class TypingsInstaller {
2502
+ protected readonly installTypingHost: InstallTypingHost;
2503
+ private readonly globalCachePath;
2504
+ private readonly safeListPath;
2505
+ private readonly typesMapLocation;
2506
+ private readonly throttleLimit;
2507
+ protected readonly log: Log;
2508
+ private readonly packageNameToTypingLocation;
2509
+ private readonly missingTypingsSet;
2510
+ private readonly knownCachesSet;
2511
+ private readonly projectWatchers;
2512
+ private safeList;
2513
+ private installRunCount;
2514
+ private inFlightRequestCount;
2515
+ abstract readonly typesRegistry: Map<string, MapLike<string>>;
2516
+ constructor(installTypingHost: InstallTypingHost, globalCachePath: string, safeListPath: Path, typesMapLocation: Path, throttleLimit: number, log?: Log);
2517
+ closeProject(req: CloseProject): void;
2518
+ private closeWatchers;
2519
+ install(req: DiscoverTypings): void;
2520
+ private initializeSafeList;
2521
+ private processCacheLocation;
2522
+ private filterTypings;
2523
+ protected ensurePackageDirectoryExists(directory: string): void;
2524
+ private installTypings;
2525
+ private ensureDirectoryExists;
2526
+ private watchFiles;
2527
+ private createSetTypings;
2528
+ private installTypingsAsync;
2529
+ private executeWithThrottling;
2530
+ protected abstract installWorker(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void;
2531
+ protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | WatchTypingLocations): void;
2532
+ protected readonly latestDistTag = "latest";
2533
+ }
2534
+ }
2535
+ type ActionSet = "action::set";
2536
+ type ActionInvalidate = "action::invalidate";
2537
+ type ActionPackageInstalled = "action::packageInstalled";
2538
+ type EventTypesRegistry = "event::typesRegistry";
2539
+ type EventBeginInstallTypes = "event::beginInstallTypes";
2540
+ type EventEndInstallTypes = "event::endInstallTypes";
2541
+ type EventInitializationFailed = "event::initializationFailed";
2542
+ type ActionWatchTypingLocations = "action::watchTypingLocations";
2543
+ interface TypingInstallerResponse {
2544
+ readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed | ActionWatchTypingLocations;
2545
+ }
2546
+ interface TypingInstallerRequestWithProjectName {
2547
+ readonly projectName: string;
2548
+ }
2549
+ interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
2550
+ readonly fileNames: string[];
2551
+ readonly projectRootPath: Path;
2552
+ readonly compilerOptions: CompilerOptions;
2553
+ readonly typeAcquisition: TypeAcquisition;
2554
+ readonly unresolvedImports: SortedReadonlyArray<string>;
2555
+ readonly cachePath?: string;
2556
+ readonly kind: "discover";
2557
+ }
2558
+ interface CloseProject extends TypingInstallerRequestWithProjectName {
2559
+ readonly kind: "closeProject";
2560
+ }
2561
+ interface TypesRegistryRequest {
2562
+ readonly kind: "typesRegistry";
2563
+ }
2564
+ interface InstallPackageRequest extends TypingInstallerRequestWithProjectName {
2565
+ readonly kind: "installPackage";
2566
+ readonly fileName: Path;
2567
+ readonly packageName: string;
2568
+ readonly projectRootPath: Path;
2569
+ readonly id: number;
2570
+ }
2571
+ interface PackageInstalledResponse extends ProjectResponse {
2572
+ readonly kind: ActionPackageInstalled;
2573
+ readonly id: number;
2574
+ readonly success: boolean;
2575
+ readonly message: string;
2576
+ }
2577
+ interface InitializationFailedResponse extends TypingInstallerResponse {
2578
+ readonly kind: EventInitializationFailed;
2579
+ readonly message: string;
2580
+ readonly stack?: string;
2581
+ }
2582
+ interface ProjectResponse extends TypingInstallerResponse {
2583
+ readonly projectName: string;
2584
+ }
2585
+ interface InvalidateCachedTypings extends ProjectResponse {
2586
+ readonly kind: ActionInvalidate;
2587
+ }
2588
+ interface InstallTypes extends ProjectResponse {
2589
+ readonly kind: EventBeginInstallTypes | EventEndInstallTypes;
2590
+ readonly eventId: number;
2591
+ readonly typingsInstallerVersion: string;
2592
+ readonly packagesToInstall: readonly string[];
2593
+ }
2594
+ interface BeginInstallTypes extends InstallTypes {
2595
+ readonly kind: EventBeginInstallTypes;
2596
+ }
2597
+ interface EndInstallTypes extends InstallTypes {
2598
+ readonly kind: EventEndInstallTypes;
2599
+ readonly installSuccess: boolean;
3097
2600
  }
3098
- namespace typingsInstaller {
3099
- interface Log {
3100
- isEnabled(): boolean;
3101
- writeLine(text: string): void;
3102
- }
3103
- type RequestCompletedAction = (success: boolean) => void;
3104
- interface PendingRequest {
3105
- requestId: number;
3106
- packageNames: string[];
3107
- cwd: string;
3108
- onRequestCompleted: RequestCompletedAction;
3109
- }
3110
- abstract class TypingsInstaller {
3111
- protected readonly installTypingHost: InstallTypingHost;
3112
- private readonly globalCachePath;
3113
- private readonly safeListPath;
3114
- private readonly typesMapLocation;
3115
- private readonly throttleLimit;
3116
- protected readonly log: Log;
3117
- private readonly packageNameToTypingLocation;
3118
- private readonly missingTypingsSet;
3119
- private readonly knownCachesSet;
3120
- private readonly projectWatchers;
3121
- private safeList;
3122
- private installRunCount;
3123
- private inFlightRequestCount;
3124
- abstract readonly typesRegistry: Map<string, MapLike<string>>;
3125
- constructor(installTypingHost: InstallTypingHost, globalCachePath: string, safeListPath: Path, typesMapLocation: Path, throttleLimit: number, log?: Log);
3126
- closeProject(req: CloseProject): void;
3127
- private closeWatchers;
3128
- install(req: DiscoverTypings): void;
3129
- private initializeSafeList;
3130
- private processCacheLocation;
3131
- private filterTypings;
3132
- protected ensurePackageDirectoryExists(directory: string): void;
3133
- private installTypings;
3134
- private ensureDirectoryExists;
3135
- private watchFiles;
3136
- private createSetTypings;
3137
- private installTypingsAsync;
3138
- private executeWithThrottling;
3139
- protected abstract installWorker(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void;
3140
- protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | WatchTypingLocations): void;
3141
- protected readonly latestDistTag = "latest";
3142
- }
2601
+ interface InstallTypingHost extends JsTyping.TypingResolutionHost {
2602
+ useCaseSensitiveFileNames: boolean;
2603
+ writeFile(path: string, content: string): void;
2604
+ createDirectory(path: string): void;
2605
+ getCurrentDirectory?(): string;
2606
+ }
2607
+ interface SetTypings extends ProjectResponse {
2608
+ readonly typeAcquisition: TypeAcquisition;
2609
+ readonly compilerOptions: CompilerOptions;
2610
+ readonly typings: string[];
2611
+ readonly unresolvedImports: SortedReadonlyArray<string>;
2612
+ readonly kind: ActionSet;
2613
+ }
2614
+ interface WatchTypingLocations extends ProjectResponse {
2615
+ /** if files is undefined, retain same set of watchers */
2616
+ readonly files: readonly string[] | undefined;
2617
+ readonly kind: ActionWatchTypingLocations;
3143
2618
  }
3144
2619
  interface CompressedData {
3145
2620
  length: number;
@@ -3309,7 +2784,6 @@ declare namespace ts {
3309
2784
  private compilerOptions;
3310
2785
  compileOnSaveEnabled: boolean;
3311
2786
  protected watchOptions: WatchOptions | undefined;
3312
- private rootFiles;
3313
2787
  private rootFilesMap;
3314
2788
  private program;
3315
2789
  private externalFiles;
@@ -3390,7 +2864,7 @@ declare namespace ts {
3390
2864
  private detachScriptInfoIfNotRoot;
3391
2865
  isClosed(): boolean;
3392
2866
  hasRoots(): boolean;
3393
- getRootFiles(): ts.server.NormalizedPath[];
2867
+ getRootFiles(): NormalizedPath[];
3394
2868
  getRootScriptInfos(): ts.server.ScriptInfo[];
3395
2869
  getScriptInfos(): ScriptInfo[];
3396
2870
  getExcludedFiles(): readonly NormalizedPath[];
@@ -3403,7 +2877,6 @@ declare namespace ts {
3403
2877
  addMissingFileRoot(fileName: NormalizedPath): void;
3404
2878
  removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void;
3405
2879
  registerFileUpdate(fileName: string): void;
3406
- markAsDirty(): void;
3407
2880
  /**
3408
2881
  * Updates set of files that contribute to this project
3409
2882
  * @returns: true if set of files in the project stays the same and false - otherwise.
@@ -3448,10 +2921,8 @@ declare namespace ts {
3448
2921
  class AutoImportProviderProject extends Project {
3449
2922
  private hostProject;
3450
2923
  private rootFileNames;
3451
- isOrphan(): boolean;
3452
2924
  updateGraph(): boolean;
3453
2925
  hasRoots(): boolean;
3454
- markAsDirty(): void;
3455
2926
  getScriptFileNames(): string[];
3456
2927
  getLanguageService(): never;
3457
2928
  getHostForAutoImportProvider(): never;
@@ -3464,8 +2935,6 @@ declare namespace ts {
3464
2935
  */
3465
2936
  class ConfiguredProject extends Project {
3466
2937
  readonly canonicalConfigFilePath: NormalizedPath;
3467
- /** Ref count to the project when opened from external project */
3468
- private externalProjectRefCount;
3469
2938
  private projectReferences;
3470
2939
  /**
3471
2940
  * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
@@ -3708,7 +3177,11 @@ declare namespace ts {
3708
3177
  /**
3709
3178
  * Open files: with value being project root path, and key being Path of the file that is open
3710
3179
  */
3711
- readonly openFiles: Map<string, NormalizedPath | undefined>;
3180
+ readonly openFiles: Map<Path, NormalizedPath | undefined>;
3181
+ /** Config files looked up and cached config files for open script info */
3182
+ private readonly configFileForOpenFiles;
3183
+ /** Set of open script infos that are root of inferred project */
3184
+ private rootOfInferredProjects;
3712
3185
  /**
3713
3186
  * Map of open files that are opened without complete path but have projectRoot as current directory
3714
3187
  */
@@ -3727,6 +3200,11 @@ declare namespace ts {
3727
3200
  private safelist;
3728
3201
  private readonly legacySafelist;
3729
3202
  private pendingProjectUpdates;
3203
+ /**
3204
+ * All the open script info that needs recalculation of the default project,
3205
+ * this also caches config file info before config file change was detected to use it in case projects are not updated yet
3206
+ */
3207
+ private pendingOpenFileProjectUpdates?;
3730
3208
  readonly currentDirectory: NormalizedPath;
3731
3209
  readonly toCanonicalFileName: (f: string) => string;
3732
3210
  readonly host: ServerHost;
@@ -3758,6 +3236,11 @@ declare namespace ts {
3758
3236
  setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
3759
3237
  findProject(projectName: string): Project | undefined;
3760
3238
  getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
3239
+ /**
3240
+ * If there is default project calculation pending for this file,
3241
+ * then it completes that calculation so that correct default project is used for the project
3242
+ */
3243
+ private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
3761
3244
  private doEnsureDefaultProjectForFile;
3762
3245
  getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
3763
3246
  /**
@@ -3786,14 +3269,6 @@ declare namespace ts {
3786
3269
  private closeOpenFile;
3787
3270
  private deleteScriptInfo;
3788
3271
  private configFileExists;
3789
- /**
3790
- * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
3791
- */
3792
- private configFileExistenceImpactsRootOfInferredProject;
3793
- /**
3794
- * This is called on file close, so that we stop watching the config file for this script info
3795
- */
3796
- private stopWatchingConfigFilesForClosedScriptInfo;
3797
3272
  /**
3798
3273
  * This function tries to search for a tsconfig.json for the given file.
3799
3274
  * This is different from the method the compiler uses because
@@ -3803,17 +3278,10 @@ declare namespace ts {
3803
3278
  * the newly opened file.
3804
3279
  */
3805
3280
  private forEachConfigFileLocation;
3806
- /**
3807
- * This function tries to search for a tsconfig.json for the given file.
3808
- * This is different from the method the compiler uses because
3809
- * the compiler can assume it will always start searching in the
3810
- * current directory (the directory in which tsc was invoked).
3811
- * The server must start searching from the directory containing
3812
- * the newly opened file.
3813
- * If script info is passed in, it is asserted to be open script info
3814
- * otherwise just file name
3815
- */
3816
- private getConfigFileNameForFile;
3281
+ /** Get cached configFileName for scriptInfo or ancestor of open script info */
3282
+ private getConfigFileNameForFileFromCache;
3283
+ /** Caches the configFilename for script info or ancestor of open script info */
3284
+ private setConfigFileNameForFileInCache;
3817
3285
  private printProjects;
3818
3286
  private getConfiguredProjectByCanonicalConfigFilePath;
3819
3287
  private findExternalProjectByProjectName;
@@ -3823,7 +3291,6 @@ declare namespace ts {
3823
3291
  private addFilesToNonInferredProject;
3824
3292
  private updateNonInferredProjectFiles;
3825
3293
  private updateRootAndOptionsOfNonInferredProject;
3826
- private sendConfigFileDiagEvent;
3827
3294
  private getOrCreateInferredProjectForProjectRootPathIfEnabled;
3828
3295
  private getOrCreateSingleInferredProjectIfEnabled;
3829
3296
  private getOrCreateSingleInferredWithoutProjectRoot;
@@ -3837,7 +3304,6 @@ declare namespace ts {
3837
3304
  private refreshScriptInfosInDirectory;
3838
3305
  private stopWatchingScriptInfo;
3839
3306
  private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath;
3840
- private getOrCreateScriptInfoOpenedByClientForNormalizedPath;
3841
3307
  getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: {
3842
3308
  fileExists(path: string): boolean;
3843
3309
  }): ScriptInfo | undefined;
@@ -3856,14 +3322,6 @@ declare namespace ts {
3856
3322
  * This does not reload contents of open files from disk. But we could do that if needed
3857
3323
  */
3858
3324
  reloadProjects(): void;
3859
- /**
3860
- * This function goes through all the openFiles and tries to file the config file for them.
3861
- * If the config file is found and it refers to existing project, it reloads it either immediately
3862
- * or schedules it for reload depending on delayReload option
3863
- * If there is no existing project it just opens the configured project for the config file
3864
- * reloadForInfo provides a way to filter out files to reload configured project for
3865
- */
3866
- private reloadConfiguredProjectForFiles;
3867
3325
  /**
3868
3326
  * Remove the root of inferred project if script info is part of another project
3869
3327
  */
@@ -3885,11 +3343,21 @@ declare namespace ts {
3885
3343
  private findExternalProjectContainingOpenScriptInfo;
3886
3344
  private getOrCreateOpenScriptInfo;
3887
3345
  private assignProjectToOpenedScriptInfo;
3888
- private createAncestorProjects;
3346
+ /**
3347
+ * Finds the default configured project for given info
3348
+ * For any tsconfig found, it looks into that project, if not then all its references,
3349
+ * The search happens for all tsconfigs till projectRootPath
3350
+ */
3351
+ private tryFindDefaultConfiguredProjectForOpenScriptInfo;
3352
+ /**
3353
+ * Finds the default configured project, if found, it creates the solution projects (does not load them right away)
3354
+ * with Find: finds the projects even if the project is deferredClosed
3355
+ */
3356
+ private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
3889
3357
  private ensureProjectChildren;
3890
- private cleanupAfterOpeningFile;
3358
+ private cleanupConfiguredProjects;
3359
+ private cleanupProjectsAndScriptInfos;
3891
3360
  openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
3892
- private removeOrphanConfiguredProjects;
3893
3361
  private removeOrphanScriptInfos;
3894
3362
  private telemetryOnOpenFile;
3895
3363
  /**
@@ -3898,7 +3366,6 @@ declare namespace ts {
3898
3366
  */
3899
3367
  closeClientFile(uncheckedFileName: string): void;
3900
3368
  private collectChanges;
3901
- private closeConfiguredProjectReferencedFromExternalProject;
3902
3369
  closeExternalProject(uncheckedFileName: string): void;
3903
3370
  openExternalProjects(projects: protocol.ExternalProject[]): void;
3904
3371
  /** Makes a filename safe to insert in a RegExp */
@@ -3911,7 +3378,6 @@ declare namespace ts {
3911
3378
  hasDeferredExtension(): boolean;
3912
3379
  private enableRequestedPluginsAsync;
3913
3380
  private enableRequestedPluginsWorker;
3914
- private enableRequestedPluginsForProjectAsync;
3915
3381
  configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
3916
3382
  }
3917
3383
  function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string;
@@ -4030,6 +3496,7 @@ declare namespace ts {
4030
3496
  private getLinkedEditingRange;
4031
3497
  private getDocumentHighlights;
4032
3498
  private provideInlayHints;
3499
+ private mapCode;
4033
3500
  private setCompilerOptionsForInferredProjects;
4034
3501
  private getProjectInfo;
4035
3502
  private getProjectInfoWorker;
@@ -4089,6 +3556,7 @@ declare namespace ts {
4089
3556
  private getApplicableRefactors;
4090
3557
  private getEditsForRefactor;
4091
3558
  private getMoveToRefactoringFileSuggestions;
3559
+ private getPasteEdits;
4092
3560
  private organizeImports;
4093
3561
  private getEditsForFileRename;
4094
3562
  private getCodeFixes;
@@ -4097,6 +3565,7 @@ declare namespace ts {
4097
3565
  private getStartAndEndPosition;
4098
3566
  private mapCodeAction;
4099
3567
  private mapCodeFixAction;
3568
+ private mapPasteEditsAction;
4100
3569
  private mapTextChangesToCodeEdits;
4101
3570
  private mapTextChangeToCodeEdit;
4102
3571
  private convertTextChangeToCodeEdit;
@@ -4139,7 +3608,15 @@ declare namespace ts {
4139
3608
  responseRequired?: boolean;
4140
3609
  }
4141
3610
  }
4142
- const versionMajorMinor = "5.4";
3611
+ namespace JsTyping {
3612
+ interface TypingResolutionHost {
3613
+ directoryExists(path: string): boolean;
3614
+ fileExists(fileName: string): boolean;
3615
+ readFile(path: string, encoding?: string): string | undefined;
3616
+ readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
3617
+ }
3618
+ }
3619
+ const versionMajorMinor = "5.5";
4143
3620
  /** The version of the TypeScript compiler release */
4144
3621
  const version: string;
4145
3622
  /**
@@ -4478,65 +3955,59 @@ declare namespace ts {
4478
3955
  ShorthandPropertyAssignment = 304,
4479
3956
  SpreadAssignment = 305,
4480
3957
  EnumMember = 306,
4481
- /** @deprecated */ UnparsedPrologue = 307,
4482
- /** @deprecated */ UnparsedPrepend = 308,
4483
- /** @deprecated */ UnparsedText = 309,
4484
- /** @deprecated */ UnparsedInternalText = 310,
4485
- /** @deprecated */ UnparsedSyntheticReference = 311,
4486
- SourceFile = 312,
4487
- Bundle = 313,
4488
- /** @deprecated */ UnparsedSource = 314,
4489
- /** @deprecated */ InputFiles = 315,
4490
- JSDocTypeExpression = 316,
4491
- JSDocNameReference = 317,
4492
- JSDocMemberName = 318,
4493
- JSDocAllType = 319,
4494
- JSDocUnknownType = 320,
4495
- JSDocNullableType = 321,
4496
- JSDocNonNullableType = 322,
4497
- JSDocOptionalType = 323,
4498
- JSDocFunctionType = 324,
4499
- JSDocVariadicType = 325,
4500
- JSDocNamepathType = 326,
4501
- JSDoc = 327,
3958
+ SourceFile = 307,
3959
+ Bundle = 308,
3960
+ JSDocTypeExpression = 309,
3961
+ JSDocNameReference = 310,
3962
+ JSDocMemberName = 311,
3963
+ JSDocAllType = 312,
3964
+ JSDocUnknownType = 313,
3965
+ JSDocNullableType = 314,
3966
+ JSDocNonNullableType = 315,
3967
+ JSDocOptionalType = 316,
3968
+ JSDocFunctionType = 317,
3969
+ JSDocVariadicType = 318,
3970
+ JSDocNamepathType = 319,
3971
+ JSDoc = 320,
4502
3972
  /** @deprecated Use SyntaxKind.JSDoc */
4503
- JSDocComment = 327,
4504
- JSDocText = 328,
4505
- JSDocTypeLiteral = 329,
4506
- JSDocSignature = 330,
4507
- JSDocLink = 331,
4508
- JSDocLinkCode = 332,
4509
- JSDocLinkPlain = 333,
4510
- JSDocTag = 334,
4511
- JSDocAugmentsTag = 335,
4512
- JSDocImplementsTag = 336,
4513
- JSDocAuthorTag = 337,
4514
- JSDocDeprecatedTag = 338,
4515
- JSDocClassTag = 339,
4516
- JSDocPublicTag = 340,
4517
- JSDocPrivateTag = 341,
4518
- JSDocProtectedTag = 342,
4519
- JSDocReadonlyTag = 343,
4520
- JSDocOverrideTag = 344,
4521
- JSDocCallbackTag = 345,
4522
- JSDocOverloadTag = 346,
4523
- JSDocEnumTag = 347,
4524
- JSDocParameterTag = 348,
4525
- JSDocReturnTag = 349,
4526
- JSDocThisTag = 350,
4527
- JSDocTypeTag = 351,
4528
- JSDocTemplateTag = 352,
4529
- JSDocTypedefTag = 353,
4530
- JSDocSeeTag = 354,
4531
- JSDocPropertyTag = 355,
4532
- JSDocThrowsTag = 356,
4533
- JSDocSatisfiesTag = 357,
4534
- SyntaxList = 358,
4535
- NotEmittedStatement = 359,
4536
- PartiallyEmittedExpression = 360,
4537
- CommaListExpression = 361,
4538
- SyntheticReferenceExpression = 362,
4539
- Count = 363,
3973
+ JSDocComment = 320,
3974
+ JSDocText = 321,
3975
+ JSDocTypeLiteral = 322,
3976
+ JSDocSignature = 323,
3977
+ JSDocLink = 324,
3978
+ JSDocLinkCode = 325,
3979
+ JSDocLinkPlain = 326,
3980
+ JSDocTag = 327,
3981
+ JSDocAugmentsTag = 328,
3982
+ JSDocImplementsTag = 329,
3983
+ JSDocAuthorTag = 330,
3984
+ JSDocDeprecatedTag = 331,
3985
+ JSDocClassTag = 332,
3986
+ JSDocPublicTag = 333,
3987
+ JSDocPrivateTag = 334,
3988
+ JSDocProtectedTag = 335,
3989
+ JSDocReadonlyTag = 336,
3990
+ JSDocOverrideTag = 337,
3991
+ JSDocCallbackTag = 338,
3992
+ JSDocOverloadTag = 339,
3993
+ JSDocEnumTag = 340,
3994
+ JSDocParameterTag = 341,
3995
+ JSDocReturnTag = 342,
3996
+ JSDocThisTag = 343,
3997
+ JSDocTypeTag = 344,
3998
+ JSDocTemplateTag = 345,
3999
+ JSDocTypedefTag = 346,
4000
+ JSDocSeeTag = 347,
4001
+ JSDocPropertyTag = 348,
4002
+ JSDocThrowsTag = 349,
4003
+ JSDocSatisfiesTag = 350,
4004
+ JSDocImportTag = 351,
4005
+ SyntaxList = 352,
4006
+ NotEmittedStatement = 353,
4007
+ PartiallyEmittedExpression = 354,
4008
+ CommaListExpression = 355,
4009
+ SyntheticReferenceExpression = 356,
4010
+ Count = 357,
4540
4011
  FirstAssignment = 64,
4541
4012
  LastAssignment = 79,
4542
4013
  FirstCompoundAssignment = 65,
@@ -4564,10 +4035,10 @@ declare namespace ts {
4564
4035
  FirstStatement = 243,
4565
4036
  LastStatement = 259,
4566
4037
  FirstNode = 166,
4567
- FirstJSDocNode = 316,
4568
- LastJSDocNode = 357,
4569
- FirstJSDocTagNode = 334,
4570
- LastJSDocTagNode = 357,
4038
+ FirstJSDocNode = 309,
4039
+ LastJSDocNode = 351,
4040
+ FirstJSDocTagNode = 327,
4041
+ LastJSDocTagNode = 351,
4571
4042
  }
4572
4043
  type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
4573
4044
  type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
@@ -4722,7 +4193,7 @@ declare namespace ts {
4722
4193
  type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
4723
4194
  type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
4724
4195
  type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
4725
- type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind;
4196
+ type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind;
4726
4197
  enum NodeFlags {
4727
4198
  None = 0,
4728
4199
  Let = 1,
@@ -4803,7 +4274,7 @@ declare namespace ts {
4803
4274
  getSourceFile(): SourceFile;
4804
4275
  getChildCount(sourceFile?: SourceFile): number;
4805
4276
  getChildAt(index: number, sourceFile?: SourceFile): Node;
4806
- getChildren(sourceFile?: SourceFile): Node[];
4277
+ getChildren(sourceFile?: SourceFile): readonly Node[];
4807
4278
  getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
4808
4279
  getFullStart(): number;
4809
4280
  getEnd(): number;
@@ -4966,12 +4437,6 @@ declare namespace ts {
4966
4437
  interface Identifier {
4967
4438
  readonly text: string;
4968
4439
  }
4969
- interface Identifier {
4970
- /** @deprecated Use `idKeyword(identifier)` instead. */
4971
- readonly originalKeywordKind?: SyntaxKind;
4972
- /** @deprecated Use `.parent` or the surrounding context to determine this instead. */
4973
- readonly isInJSDocNamespace?: boolean;
4974
- }
4975
4440
  interface TransientIdentifier extends Identifier {
4976
4441
  resolvedSymbol: Symbol;
4977
4442
  }
@@ -6017,7 +5482,7 @@ declare namespace ts {
6017
5482
  type NamedExportBindings = NamespaceExport | NamedExports;
6018
5483
  interface ImportClause extends NamedDeclaration {
6019
5484
  readonly kind: SyntaxKind.ImportClause;
6020
- readonly parent: ImportDeclaration;
5485
+ readonly parent: ImportDeclaration | JSDocImportTag;
6021
5486
  readonly isTypeOnly: boolean;
6022
5487
  readonly name?: Identifier;
6023
5488
  readonly namedBindings?: NamedImportBindings;
@@ -6156,6 +5621,7 @@ declare namespace ts {
6156
5621
  interface FileReference extends TextRange {
6157
5622
  fileName: string;
6158
5623
  resolutionMode?: ResolutionMode;
5624
+ preserve?: boolean;
6159
5625
  }
6160
5626
  interface CheckJsDirective extends TextRange {
6161
5627
  enabled: boolean;
@@ -6373,60 +5839,12 @@ declare namespace ts {
6373
5839
  readonly kind: SyntaxKind.JSDocSatisfiesTag;
6374
5840
  readonly typeExpression: JSDocTypeExpression;
6375
5841
  }
6376
- enum FlowFlags {
6377
- Unreachable = 1,
6378
- Start = 2,
6379
- BranchLabel = 4,
6380
- LoopLabel = 8,
6381
- Assignment = 16,
6382
- TrueCondition = 32,
6383
- FalseCondition = 64,
6384
- SwitchClause = 128,
6385
- ArrayMutation = 256,
6386
- Call = 512,
6387
- ReduceLabel = 1024,
6388
- Referenced = 2048,
6389
- Shared = 4096,
6390
- Label = 12,
6391
- Condition = 96,
6392
- }
6393
- type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel;
6394
- interface FlowNodeBase {
6395
- flags: FlowFlags;
6396
- id?: number;
6397
- }
6398
- interface FlowStart extends FlowNodeBase {
6399
- node?: FunctionExpression | ArrowFunction | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;
6400
- }
6401
- interface FlowLabel extends FlowNodeBase {
6402
- antecedents: FlowNode[] | undefined;
6403
- }
6404
- interface FlowAssignment extends FlowNodeBase {
6405
- node: Expression | VariableDeclaration | BindingElement;
6406
- antecedent: FlowNode;
6407
- }
6408
- interface FlowCall extends FlowNodeBase {
6409
- node: CallExpression;
6410
- antecedent: FlowNode;
6411
- }
6412
- interface FlowCondition extends FlowNodeBase {
6413
- node: Expression;
6414
- antecedent: FlowNode;
6415
- }
6416
- interface FlowSwitchClause extends FlowNodeBase {
6417
- switchStatement: SwitchStatement;
6418
- clauseStart: number;
6419
- clauseEnd: number;
6420
- antecedent: FlowNode;
6421
- }
6422
- interface FlowArrayMutation extends FlowNodeBase {
6423
- node: CallExpression | BinaryExpression;
6424
- antecedent: FlowNode;
6425
- }
6426
- interface FlowReduceLabel extends FlowNodeBase {
6427
- target: FlowLabel;
6428
- antecedents: FlowNode[];
6429
- antecedent: FlowNode;
5842
+ interface JSDocImportTag extends JSDocTag {
5843
+ readonly kind: SyntaxKind.JSDocImportTag;
5844
+ readonly parent: JSDoc;
5845
+ readonly importClause?: ImportClause;
5846
+ readonly moduleSpecifier: Expression;
5847
+ readonly attributes?: ImportAttributes;
6430
5848
  }
6431
5849
  type FlowType = Type | IncompleteType;
6432
5850
  interface IncompleteType {
@@ -6498,70 +5916,8 @@ declare namespace ts {
6498
5916
  }
6499
5917
  interface Bundle extends Node {
6500
5918
  readonly kind: SyntaxKind.Bundle;
6501
- /** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[];
6502
5919
  readonly sourceFiles: readonly SourceFile[];
6503
5920
  }
6504
- /** @deprecated */
6505
- interface InputFiles extends Node {
6506
- readonly kind: SyntaxKind.InputFiles;
6507
- javascriptPath?: string;
6508
- javascriptText: string;
6509
- javascriptMapPath?: string;
6510
- javascriptMapText?: string;
6511
- declarationPath?: string;
6512
- declarationText: string;
6513
- declarationMapPath?: string;
6514
- declarationMapText?: string;
6515
- }
6516
- /** @deprecated */
6517
- interface UnparsedSource extends Node {
6518
- readonly kind: SyntaxKind.UnparsedSource;
6519
- fileName: string;
6520
- text: string;
6521
- readonly prologues: readonly UnparsedPrologue[];
6522
- helpers: readonly UnscopedEmitHelper[] | undefined;
6523
- referencedFiles: readonly FileReference[];
6524
- typeReferenceDirectives: readonly FileReference[] | undefined;
6525
- libReferenceDirectives: readonly FileReference[];
6526
- hasNoDefaultLib?: boolean;
6527
- sourceMapPath?: string;
6528
- sourceMapText?: string;
6529
- readonly syntheticReferences?: readonly UnparsedSyntheticReference[];
6530
- readonly texts: readonly UnparsedSourceText[];
6531
- }
6532
- /** @deprecated */
6533
- type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike;
6534
- /** @deprecated */
6535
- type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference;
6536
- /** @deprecated */
6537
- interface UnparsedSection extends Node {
6538
- readonly kind: SyntaxKind;
6539
- readonly parent: UnparsedSource;
6540
- readonly data?: string;
6541
- }
6542
- /** @deprecated */
6543
- interface UnparsedPrologue extends UnparsedSection {
6544
- readonly kind: SyntaxKind.UnparsedPrologue;
6545
- readonly parent: UnparsedSource;
6546
- readonly data: string;
6547
- }
6548
- /** @deprecated */
6549
- interface UnparsedPrepend extends UnparsedSection {
6550
- readonly kind: SyntaxKind.UnparsedPrepend;
6551
- readonly parent: UnparsedSource;
6552
- readonly data: string;
6553
- readonly texts: readonly UnparsedTextLike[];
6554
- }
6555
- /** @deprecated */
6556
- interface UnparsedTextLike extends UnparsedSection {
6557
- readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText;
6558
- readonly parent: UnparsedSource;
6559
- }
6560
- /** @deprecated */
6561
- interface UnparsedSyntheticReference extends UnparsedSection {
6562
- readonly kind: SyntaxKind.UnparsedSyntheticReference;
6563
- readonly parent: UnparsedSource;
6564
- }
6565
5921
  interface JsonSourceFile extends SourceFile {
6566
5922
  readonly statements: NodeArray<JsonObjectExpressionStatement>;
6567
5923
  }
@@ -6658,19 +6014,67 @@ declare namespace ts {
6658
6014
  isSourceFileFromExternalLibrary(file: SourceFile): boolean;
6659
6015
  isSourceFileDefaultLibrary(file: SourceFile): boolean;
6660
6016
  /**
6661
- * Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
6662
- * attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
6663
- * depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
6664
- * `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
6665
- * impact on module resolution, emit, or type checking.
6017
+ * Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
6018
+ * settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
6019
+ * which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
6020
+ * overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
6021
+ * Some examples:
6022
+ *
6023
+ * ```ts
6024
+ * // tsc foo.mts --module nodenext
6025
+ * import {} from "mod";
6026
+ * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
6027
+ *
6028
+ * // tsc foo.cts --module nodenext
6029
+ * import {} from "mod";
6030
+ * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
6031
+ *
6032
+ * // tsc foo.ts --module preserve --moduleResolution bundler
6033
+ * import {} from "mod";
6034
+ * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
6035
+ * // supports conditional imports/exports
6036
+ *
6037
+ * // tsc foo.ts --module preserve --moduleResolution node10
6038
+ * import {} from "mod";
6039
+ * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
6040
+ * // does not support conditional imports/exports
6041
+ *
6042
+ * // tsc foo.ts --module commonjs --moduleResolution node10
6043
+ * import type {} from "mod" with { "resolution-mode": "import" };
6044
+ * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
6045
+ * ```
6666
6046
  */
6667
6047
  getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike): ResolutionMode;
6668
6048
  /**
6669
- * Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode
6670
- * explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In
6671
- * `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the
6672
- * input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns
6673
- * `undefined`, as the result would have no impact on module resolution, emit, or type checking.
6049
+ * Calculates the final resolution mode for an import at some index within a file's `imports` list. This function only returns a result
6050
+ * when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided
6051
+ * via import attributes, which cause an `import` or `require` condition to be used during resolution regardless of module resolution
6052
+ * settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the
6053
+ * usage would emit to JavaScript. Some examples:
6054
+ *
6055
+ * ```ts
6056
+ * // tsc foo.mts --module nodenext
6057
+ * import {} from "mod";
6058
+ * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
6059
+ *
6060
+ * // tsc foo.cts --module nodenext
6061
+ * import {} from "mod";
6062
+ * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
6063
+ *
6064
+ * // tsc foo.ts --module preserve --moduleResolution bundler
6065
+ * import {} from "mod";
6066
+ * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
6067
+ * // supports conditional imports/exports
6068
+ *
6069
+ * // tsc foo.ts --module preserve --moduleResolution node10
6070
+ * import {} from "mod";
6071
+ * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
6072
+ * // does not support conditional imports/exports
6073
+ *
6074
+ * // tsc foo.ts --module commonjs --moduleResolution node10
6075
+ * import type {} from "mod" with { "resolution-mode": "import" };
6076
+ * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
6077
+ * ```
6674
6078
  */
6675
6079
  getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
6676
6080
  getProjectReferences(): readonly ProjectReference[] | undefined;
@@ -7242,6 +6646,7 @@ declare namespace ts {
7242
6646
  ContainsSpread = 2097152,
7243
6647
  ObjectRestType = 4194304,
7244
6648
  InstantiationExpressionType = 8388608,
6649
+ SingleSignatureType = 134217728,
7245
6650
  }
7246
6651
  interface ObjectType extends Type {
7247
6652
  objectFlags: ObjectFlags;
@@ -7496,7 +6901,7 @@ declare namespace ts {
7496
6901
  path: string;
7497
6902
  /** The path as the user originally wrote it */
7498
6903
  originalPath?: string;
7499
- /** True if the output of this reference should be prepended to the output of this project. Only valid for --outFile compilations */
6904
+ /** @deprecated */
7500
6905
  prepend?: boolean;
7501
6906
  /** True if it is intended that this reference form a circularity */
7502
6907
  circular?: boolean;
@@ -7532,6 +6937,7 @@ declare namespace ts {
7532
6937
  allowUnusedLabels?: boolean;
7533
6938
  alwaysStrict?: boolean;
7534
6939
  baseUrl?: string;
6940
+ /** @deprecated */
7535
6941
  charset?: string;
7536
6942
  checkJs?: boolean;
7537
6943
  customConditions?: string[];
@@ -7551,11 +6957,14 @@ declare namespace ts {
7551
6957
  forceConsistentCasingInFileNames?: boolean;
7552
6958
  ignoreDeprecations?: string;
7553
6959
  importHelpers?: boolean;
6960
+ /** @deprecated */
7554
6961
  importsNotUsedAsValues?: ImportsNotUsedAsValues;
7555
6962
  inlineSourceMap?: boolean;
7556
6963
  inlineSources?: boolean;
7557
6964
  isolatedModules?: boolean;
6965
+ isolatedDeclarations?: boolean;
7558
6966
  jsx?: JsxEmit;
6967
+ /** @deprecated */
7559
6968
  keyofStringsOnly?: boolean;
7560
6969
  lib?: string[];
7561
6970
  locale?: string;
@@ -7574,15 +6983,18 @@ declare namespace ts {
7574
6983
  noImplicitAny?: boolean;
7575
6984
  noImplicitReturns?: boolean;
7576
6985
  noImplicitThis?: boolean;
6986
+ /** @deprecated */
7577
6987
  noStrictGenericChecks?: boolean;
7578
6988
  noUnusedLocals?: boolean;
7579
6989
  noUnusedParameters?: boolean;
6990
+ /** @deprecated */
7580
6991
  noImplicitUseStrict?: boolean;
7581
6992
  noPropertyAccessFromIndexSignature?: boolean;
7582
6993
  assumeChangesOnlyAffectDirectDependencies?: boolean;
7583
6994
  noLib?: boolean;
7584
6995
  noResolve?: boolean;
7585
6996
  noUncheckedIndexedAccess?: boolean;
6997
+ /** @deprecated */
7586
6998
  out?: string;
7587
6999
  outDir?: string;
7588
7000
  outFile?: string;
@@ -7590,6 +7002,7 @@ declare namespace ts {
7590
7002
  preserveConstEnums?: boolean;
7591
7003
  noImplicitOverride?: boolean;
7592
7004
  preserveSymlinks?: boolean;
7005
+ /** @deprecated */
7593
7006
  preserveValueImports?: boolean;
7594
7007
  project?: string;
7595
7008
  reactNamespace?: string;
@@ -7614,7 +7027,9 @@ declare namespace ts {
7614
7027
  strictNullChecks?: boolean;
7615
7028
  strictPropertyInitialization?: boolean;
7616
7029
  stripInternal?: boolean;
7030
+ /** @deprecated */
7617
7031
  suppressExcessPropertyErrors?: boolean;
7032
+ /** @deprecated */
7618
7033
  suppressImplicitAnyIndexErrors?: boolean;
7619
7034
  target?: ScriptTarget;
7620
7035
  traceResolution?: boolean;
@@ -7666,6 +7081,7 @@ declare namespace ts {
7666
7081
  ReactJSX = 4,
7667
7082
  ReactJSXDev = 5,
7668
7083
  }
7084
+ /** @deprecated */
7669
7085
  enum ImportsNotUsedAsValues {
7670
7086
  Remove = 0,
7671
7087
  Preserve = 1,
@@ -7695,6 +7111,7 @@ declare namespace ts {
7695
7111
  Deferred = 7,
7696
7112
  }
7697
7113
  enum ScriptTarget {
7114
+ /** @deprecated */
7698
7115
  ES3 = 0,
7699
7116
  ES5 = 1,
7700
7117
  ES2015 = 2,
@@ -7705,6 +7122,7 @@ declare namespace ts {
7705
7122
  ES2020 = 7,
7706
7123
  ES2021 = 8,
7707
7124
  ES2022 = 9,
7125
+ ES2023 = 10,
7708
7126
  ESNext = 99,
7709
7127
  JSON = 100,
7710
7128
  Latest = 99,
@@ -8337,6 +7755,8 @@ declare namespace ts {
8337
7755
  updateJSDocThrowsTag(node: JSDocThrowsTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment> | undefined): JSDocThrowsTag;
8338
7756
  createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocSatisfiesTag;
8339
7757
  updateJSDocSatisfiesTag(node: JSDocSatisfiesTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | NodeArray<JSDocComment> | undefined): JSDocSatisfiesTag;
7758
+ createJSDocImportTag(tagName: Identifier | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes, comment?: string | NodeArray<JSDocComment>): JSDocImportTag;
7759
+ updateJSDocImportTag(node: JSDocImportTag, tagName: Identifier | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocImportTag;
8340
7760
  createJSDocText(text: string): JSDocText;
8341
7761
  updateJSDocText(node: JSDocText, text: string): JSDocText;
8342
7762
  createJSDocComment(comment?: string | NodeArray<JSDocComment> | undefined, tags?: readonly JSDocTag[] | undefined): JSDoc;
@@ -8389,9 +7809,7 @@ declare namespace ts {
8389
7809
  createCommaListExpression(elements: readonly Expression[]): CommaListExpression;
8390
7810
  updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression;
8391
7811
  createBundle(sourceFiles: readonly SourceFile[]): Bundle;
8392
- /** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
8393
7812
  updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle;
8394
- /** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle;
8395
7813
  createComma(left: Expression, right: Expression): BinaryExpression;
8396
7814
  createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment;
8397
7815
  createAssignment(left: Expression, right: Expression): AssignmentExpression<EqualsToken>;
@@ -8670,7 +8088,6 @@ declare namespace ts {
8670
8088
  }
8671
8089
  interface SyntaxList extends Node {
8672
8090
  kind: SyntaxKind.SyntaxList;
8673
- _children: Node[];
8674
8091
  }
8675
8092
  enum ListFormat {
8676
8093
  None = 0,
@@ -8773,13 +8190,49 @@ declare namespace ts {
8773
8190
  interface UserPreferences {
8774
8191
  readonly disableSuggestions?: boolean;
8775
8192
  readonly quotePreference?: "auto" | "double" | "single";
8193
+ /**
8194
+ * If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
8195
+ * This affects lone identifier completions but not completions on the right hand side of `obj.`.
8196
+ */
8776
8197
  readonly includeCompletionsForModuleExports?: boolean;
8198
+ /**
8199
+ * Enables auto-import-style completions on partially-typed import statements. E.g., allows
8200
+ * `import write|` to be completed to `import { writeFile } from "fs"`.
8201
+ */
8777
8202
  readonly includeCompletionsForImportStatements?: boolean;
8203
+ /**
8204
+ * Allows completions to be formatted with snippet text, indicated by `CompletionItem["isSnippet"]`.
8205
+ */
8778
8206
  readonly includeCompletionsWithSnippetText?: boolean;
8207
+ /**
8208
+ * Unless this option is `false`, or `includeCompletionsWithInsertText` is not enabled,
8209
+ * member completion lists triggered with `.` will include entries on potentially-null and potentially-undefined
8210
+ * values, with insertion text to replace preceding `.` tokens with `?.`.
8211
+ */
8779
8212
  readonly includeAutomaticOptionalChainCompletions?: boolean;
8213
+ /**
8214
+ * If enabled, the completion list will include completions with invalid identifier names.
8215
+ * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`.
8216
+ */
8780
8217
  readonly includeCompletionsWithInsertText?: boolean;
8218
+ /**
8219
+ * If enabled, completions for class members (e.g. methods and properties) will include
8220
+ * a whole declaration for the member.
8221
+ * E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
8222
+ * `class A { foo }`.
8223
+ */
8781
8224
  readonly includeCompletionsWithClassMemberSnippets?: boolean;
8225
+ /**
8226
+ * If enabled, object literal methods will have a method declaration completion entry in addition
8227
+ * to the regular completion entry containing just the method name.
8228
+ * E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
8229
+ * in addition to `const objectLiteral: T = { foo }`.
8230
+ */
8782
8231
  readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
8232
+ /**
8233
+ * Indicates whether {@link CompletionEntry.labelDetails completion entry label details} are supported.
8234
+ * If not, contents of `labelDetails` may be included in the {@link CompletionEntry.name} property.
8235
+ */
8783
8236
  readonly useLabelDetailsInCompletionEntries?: boolean;
8784
8237
  readonly allowIncompleteCompletions?: boolean;
8785
8238
  readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
@@ -8802,15 +8255,76 @@ declare namespace ts {
8802
8255
  readonly allowRenameOfImportPath?: boolean;
8803
8256
  readonly autoImportFileExcludePatterns?: string[];
8804
8257
  readonly preferTypeOnlyAutoImports?: boolean;
8258
+ /**
8259
+ * Indicates whether imports should be organized in a case-insensitive manner.
8260
+ */
8805
8261
  readonly organizeImportsIgnoreCase?: "auto" | boolean;
8262
+ /**
8263
+ * Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value
8264
+ * of their code points, or via "unicode" collation (via the
8265
+ * [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale
8266
+ * specified in {@link organizeImportsCollationLocale}.
8267
+ *
8268
+ * Default: `"ordinal"`.
8269
+ */
8806
8270
  readonly organizeImportsCollation?: "ordinal" | "unicode";
8271
+ /**
8272
+ * Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant
8273
+ * for the sake of consistent sorting. Use `"auto"` to use the detected UI locale.
8274
+ *
8275
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
8276
+ *
8277
+ * Default: `"en"`
8278
+ */
8807
8279
  readonly organizeImportsLocale?: string;
8280
+ /**
8281
+ * Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate
8282
+ * strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`.
8283
+ *
8284
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
8285
+ *
8286
+ * Default: `false`
8287
+ */
8808
8288
  readonly organizeImportsNumericCollation?: boolean;
8289
+ /**
8290
+ * Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When
8291
+ * `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified
8292
+ * in {@link organizeImportsCollationLocale}.
8293
+ *
8294
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
8295
+ *
8296
+ * Default: `true`
8297
+ */
8809
8298
  readonly organizeImportsAccentCollation?: boolean;
8299
+ /**
8300
+ * Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale
8301
+ * specified in {@link organizeImportsCollationLocale} is used.
8302
+ *
8303
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. This preference is also
8304
+ * ignored if we are using case-insensitive sorting, which occurs when {@link organizeImportsIgnoreCase} is `true`,
8305
+ * or if {@link organizeImportsIgnoreCase} is `"auto"` and the auto-detected case sensitivity is determined to be
8306
+ * case-insensitive.
8307
+ *
8308
+ * Default: `false`
8309
+ */
8810
8310
  readonly organizeImportsCaseFirst?: "upper" | "lower" | false;
8811
- readonly organizeImportsTypeOrder?: "first" | "last" | "inline";
8311
+ /**
8312
+ * Indicates where named type-only imports should sort. "inline" sorts named imports without regard to if the import is
8313
+ * type-only.
8314
+ *
8315
+ * Default: `last`
8316
+ */
8317
+ readonly organizeImportsTypeOrder?: OrganizeImportsTypeOrder;
8318
+ /**
8319
+ * Indicates whether to exclude standard library and node_modules file symbols from navTo results.
8320
+ */
8812
8321
  readonly excludeLibrarySymbolsInNavTo?: boolean;
8322
+ readonly lazyConfiguredProjectsFromExternalProject?: boolean;
8323
+ readonly displayPartsForJSDoc?: boolean;
8324
+ readonly generateReturnInDocTemplate?: boolean;
8325
+ readonly disableLineTextInReferences?: boolean;
8813
8326
  }
8327
+ type OrganizeImportsTypeOrder = "last" | "inline" | "first";
8814
8328
  /** Represents a bigint literal value without requiring bigint support */
8815
8329
  interface PseudoBigInt {
8816
8330
  negative: boolean;
@@ -9150,10 +8664,6 @@ declare namespace ts {
9150
8664
  function isNonNullChain(node: Node): node is NonNullChain;
9151
8665
  function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement;
9152
8666
  function isNamedExportBindings(node: Node): node is NamedExportBindings;
9153
- /** @deprecated */
9154
- function isUnparsedTextLike(node: Node): node is UnparsedTextLike;
9155
- /** @deprecated */
9156
- function isUnparsedNode(node: Node): node is UnparsedNode;
9157
8667
  function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag;
9158
8668
  /**
9159
8669
  * True if kind is of some token syntax kind.
@@ -9261,18 +8771,6 @@ declare namespace ts {
9261
8771
  * ```
9262
8772
  */
9263
8773
  function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[];
9264
- /** @deprecated */
9265
- function createUnparsedSourceFile(text: string): UnparsedSource;
9266
- /** @deprecated */
9267
- function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource;
9268
- /** @deprecated */
9269
- function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource;
9270
- /** @deprecated */
9271
- function createInputFiles(javascriptText: string, declarationText: string): InputFiles;
9272
- /** @deprecated */
9273
- function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles;
9274
- /** @deprecated */
9275
- function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles;
9276
8774
  /**
9277
8775
  * Create an external source map source file reference
9278
8776
  */
@@ -9517,12 +9015,8 @@ declare namespace ts {
9517
9015
  function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment;
9518
9016
  function isSpreadAssignment(node: Node): node is SpreadAssignment;
9519
9017
  function isEnumMember(node: Node): node is EnumMember;
9520
- /** @deprecated */
9521
- function isUnparsedPrepend(node: Node): node is UnparsedPrepend;
9522
9018
  function isSourceFile(node: Node): node is SourceFile;
9523
9019
  function isBundle(node: Node): node is Bundle;
9524
- /** @deprecated */
9525
- function isUnparsedSource(node: Node): node is UnparsedSource;
9526
9020
  function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression;
9527
9021
  function isJSDocNameReference(node: Node): node is JSDocNameReference;
9528
9022
  function isJSDocMemberName(node: Node): node is JSDocMemberName;
@@ -9564,6 +9058,7 @@ declare namespace ts {
9564
9058
  function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag;
9565
9059
  function isJSDocSatisfiesTag(node: Node): node is JSDocSatisfiesTag;
9566
9060
  function isJSDocThrowsTag(node: Node): node is JSDocThrowsTag;
9061
+ function isJSDocImportTag(node: Node): node is JSDocImportTag;
9567
9062
  function isQuestionOrExclamationToken(node: Node): node is QuestionToken | ExclamationToken;
9568
9063
  function isIdentifierOrThisTypeNode(node: Node): node is Identifier | ThisTypeNode;
9569
9064
  function isReadonlyKeywordOrPlusOrMinusToken(node: Node): node is ReadonlyKeyword | PlusToken | MinusToken;
@@ -9932,24 +9427,43 @@ declare namespace ts {
9932
9427
  function getModeForResolutionAtIndex(file: SourceFile, index: number, compilerOptions: CompilerOptions): ResolutionMode;
9933
9428
  /**
9934
9429
  * Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible.
9935
- * Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
9936
- * attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
9937
- * depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
9938
- * `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
9939
- * impact on module resolution, emit, or type checking.
9430
+ * Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
9431
+ * settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
9432
+ * which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
9433
+ * overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
9434
+ * Some examples:
9435
+ *
9436
+ * ```ts
9437
+ * // tsc foo.mts --module nodenext
9438
+ * import {} from "mod";
9439
+ * // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
9440
+ *
9441
+ * // tsc foo.cts --module nodenext
9442
+ * import {} from "mod";
9443
+ * // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
9444
+ *
9445
+ * // tsc foo.ts --module preserve --moduleResolution bundler
9446
+ * import {} from "mod";
9447
+ * // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
9448
+ * // supports conditional imports/exports
9449
+ *
9450
+ * // tsc foo.ts --module preserve --moduleResolution node10
9451
+ * import {} from "mod";
9452
+ * // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
9453
+ * // does not support conditional imports/exports
9454
+ *
9455
+ * // tsc foo.ts --module commonjs --moduleResolution node10
9456
+ * import type {} from "mod" with { "resolution-mode": "import" };
9457
+ * // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
9458
+ * ```
9459
+ *
9940
9460
  * @param file The file the import or import-like reference is contained within
9941
9461
  * @param usage The module reference string
9942
9462
  * @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
9943
9463
  * should be the options of the referenced project, not the referencing project.
9944
9464
  * @returns The final resolution mode of the import
9945
9465
  */
9946
- function getModeForUsageLocation(
9947
- file: {
9948
- impliedNodeFormat?: ResolutionMode;
9949
- },
9950
- usage: StringLiteralLike,
9951
- compilerOptions: CompilerOptions,
9952
- ): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
9466
+ function getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike, compilerOptions: CompilerOptions): ResolutionMode;
9953
9467
  function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
9954
9468
  /**
9955
9469
  * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
@@ -10001,6 +9515,7 @@ declare namespace ts {
10001
9515
  interface EmitOutput {
10002
9516
  outputFiles: OutputFile[];
10003
9517
  emitSkipped: boolean;
9518
+ diagnostics: readonly Diagnostic[];
10004
9519
  }
10005
9520
  interface OutputFile {
10006
9521
  name: string;
@@ -10341,8 +9856,7 @@ declare namespace ts {
10341
9856
  }
10342
9857
  enum InvalidatedProjectKind {
10343
9858
  Build = 0,
10344
- /** @deprecated */ UpdateBundle = 1,
10345
- UpdateOutputFileStamps = 2,
9859
+ UpdateOutputFileStamps = 1,
10346
9860
  }
10347
9861
  interface InvalidatedProjectBase {
10348
9862
  readonly kind: InvalidatedProjectKind;
@@ -10373,20 +9887,7 @@ declare namespace ts {
10373
9887
  getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult<readonly Diagnostic[]>;
10374
9888
  emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined;
10375
9889
  }
10376
- /** @deprecated */
10377
- interface UpdateBundleProject<T extends BuilderProgram> extends InvalidatedProjectBase {
10378
- readonly kind: InvalidatedProjectKind.UpdateBundle;
10379
- emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject<T> | undefined;
10380
- }
10381
- type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T> | UpdateBundleProject<T>;
10382
- namespace JsTyping {
10383
- interface TypingResolutionHost {
10384
- directoryExists(path: string): boolean;
10385
- fileExists(fileName: string): boolean;
10386
- readFile(path: string, encoding?: string): string | undefined;
10387
- readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
10388
- }
10389
- }
9890
+ type InvalidatedProject<T extends BuilderProgram> = UpdateOutputFileStampsProject | BuildInvalidedProject<T>;
10390
9891
  function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings;
10391
9892
  /**
10392
9893
  * Represents an immutable snapshot of a script at a specified time.Once acquired, the
@@ -10661,6 +10162,7 @@ declare namespace ts {
10661
10162
  uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
10662
10163
  getSupportedCodeFixes(fileName?: string): readonly string[];
10663
10164
  dispose(): void;
10165
+ getPasteEdits(args: PasteEditsArgs, formatOptions: FormatCodeSettings): PasteEdits;
10664
10166
  }
10665
10167
  interface JsxClosingTagInfo {
10666
10168
  readonly newText: string;
@@ -10678,6 +10180,20 @@ declare namespace ts {
10678
10180
  SortAndCombine = "SortAndCombine",
10679
10181
  RemoveUnused = "RemoveUnused",
10680
10182
  }
10183
+ interface PasteEdits {
10184
+ edits: readonly FileTextChanges[];
10185
+ fixId?: {};
10186
+ }
10187
+ interface PasteEditsArgs {
10188
+ targetFile: string;
10189
+ pastedText: string[];
10190
+ pasteLocations: TextRange[];
10191
+ copiedFrom: {
10192
+ file: string;
10193
+ range: TextRange[];
10194
+ } | undefined;
10195
+ preferences: UserPreferences;
10196
+ }
10681
10197
  interface OrganizeImportsArgs extends CombinedCodeFixScope {
10682
10198
  /** @deprecated Use `mode` instead */
10683
10199
  skipDestructiveCodeActions?: boolean;
@@ -10933,6 +10449,19 @@ declare namespace ts {
10933
10449
  * when calling `getEditsForRefactor`.
10934
10450
  */
10935
10451
  isInteractive?: boolean;
10452
+ /**
10453
+ * Range of code the refactoring will be applied to.
10454
+ */
10455
+ range?: {
10456
+ start: {
10457
+ line: number;
10458
+ offset: number;
10459
+ };
10460
+ end: {
10461
+ line: number;
10462
+ offset: number;
10463
+ };
10464
+ };
10936
10465
  }
10937
10466
  /**
10938
10467
  * A set of edits to make in response to a refactor action, plus an optional
@@ -11121,7 +10650,13 @@ declare namespace ts {
11121
10650
  linkText = 24,
11122
10651
  }
11123
10652
  interface SymbolDisplayPart {
10653
+ /**
10654
+ * Text of an item describing the symbol.
10655
+ */
11124
10656
  text: string;
10657
+ /**
10658
+ * The symbol's kind (such as 'className' or 'parameterName' or plain 'text').
10659
+ */
11125
10660
  kind: string;
11126
10661
  }
11127
10662
  interface JSDocLinkDisplayPart extends SymbolDisplayPart {
@@ -11173,6 +10708,9 @@ declare namespace ts {
11173
10708
  interface InteractiveRefactorArguments {
11174
10709
  targetFile: string;
11175
10710
  }
10711
+ /**
10712
+ * Signature help information for a single parameter
10713
+ */
11176
10714
  interface SignatureHelpParameter {
11177
10715
  name: string;
11178
10716
  documentation: SymbolDisplayPart[];
@@ -11267,9 +10805,25 @@ declare namespace ts {
11267
10805
  name: string;
11268
10806
  kind: ScriptElementKind;
11269
10807
  kindModifiers?: string;
10808
+ /**
10809
+ * A string that is used for comparing completion items so that they can be ordered. This
10810
+ * is often the same as the name but may be different in certain circumstances.
10811
+ */
11270
10812
  sortText: string;
10813
+ /**
10814
+ * Text to insert instead of `name`.
10815
+ * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`,
10816
+ * coupled with `replacementSpan` to replace a dotted access with a bracket access.
10817
+ */
11271
10818
  insertText?: string;
10819
+ /**
10820
+ * A string that should be used when filtering a set of
10821
+ * completion items.
10822
+ */
11272
10823
  filterText?: string;
10824
+ /**
10825
+ * `insertText` should be interpreted as a snippet if true.
10826
+ */
11273
10827
  isSnippet?: true;
11274
10828
  /**
11275
10829
  * An optional span that indicates the text to be replaced by this completion item.
@@ -11277,13 +10831,43 @@ declare namespace ts {
11277
10831
  * It will be set if the required span differs from the one generated by the default replacement behavior.
11278
10832
  */
11279
10833
  replacementSpan?: TextSpan;
10834
+ /**
10835
+ * Indicates whether commiting this completion entry will require additional code actions to be
10836
+ * made to avoid errors. The CompletionEntryDetails will have these actions.
10837
+ */
11280
10838
  hasAction?: true;
10839
+ /**
10840
+ * Identifier (not necessarily human-readable) identifying where this completion came from.
10841
+ */
11281
10842
  source?: string;
10843
+ /**
10844
+ * Human-readable description of the `source`.
10845
+ */
11282
10846
  sourceDisplay?: SymbolDisplayPart[];
10847
+ /**
10848
+ * Additional details for the label.
10849
+ */
11283
10850
  labelDetails?: CompletionEntryLabelDetails;
10851
+ /**
10852
+ * If true, this completion should be highlighted as recommended. There will only be one of these.
10853
+ * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class.
10854
+ * Then either that enum/class or a namespace containing it will be the recommended symbol.
10855
+ */
11284
10856
  isRecommended?: true;
10857
+ /**
10858
+ * If true, this completion was generated from traversing the name table of an unchecked JS file,
10859
+ * and therefore may not be accurate.
10860
+ */
11285
10861
  isFromUncheckedFile?: true;
10862
+ /**
10863
+ * If true, this completion was for an auto-import of a module not yet in the program, but listed
10864
+ * in the project package.json. Used for telemetry reporting.
10865
+ */
11286
10866
  isPackageJsonImport?: true;
10867
+ /**
10868
+ * If true, this completion was an auto-import-style completion of an import statement (i.e., the
10869
+ * module specifier was inserted along with the imported identifier). Used for telemetry reporting.
10870
+ */
11287
10871
  isImportStatementCompletion?: true;
11288
10872
  /**
11289
10873
  * For API purposes.
@@ -11302,7 +10886,17 @@ declare namespace ts {
11302
10886
  data?: CompletionEntryData;
11303
10887
  }
11304
10888
  interface CompletionEntryLabelDetails {
10889
+ /**
10890
+ * An optional string which is rendered less prominently directly after
10891
+ * {@link CompletionEntry.name name}, without any spacing. Should be
10892
+ * used for function signatures or type annotations.
10893
+ */
11305
10894
  detail?: string;
10895
+ /**
10896
+ * An optional string which is rendered less prominently after
10897
+ * {@link CompletionEntryLabelDetails.detail}. Should be used for fully qualified
10898
+ * names or file path.
10899
+ */
11306
10900
  description?: string;
11307
10901
  }
11308
10902
  interface CompletionEntryDetails {
@@ -11671,6 +11265,7 @@ declare namespace ts {
11671
11265
  };
11672
11266
  function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo;
11673
11267
  function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
11268
+ function transpileDeclaration(input: string, transpileOptions: TranspileOptions): TranspileOutput;
11674
11269
  function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
11675
11270
  interface TranspileOptions {
11676
11271
  compilerOptions?: CompilerOptions;