@typescript-deploys/pr-build 5.0.0-pr-52280-2 → 5.0.0-pr-52317-9

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.
@@ -2802,7 +2802,59 @@ declare namespace ts {
2802
2802
  readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
2803
2803
  readonly includeInlayEnumMemberValueHints?: boolean;
2804
2804
  readonly autoImportFileExcludePatterns?: string[];
2805
+ /**
2806
+ * Indicates whether imports should be organized in a case-insensitive manner.
2807
+ */
2805
2808
  readonly organizeImportsIgnoreCase?: "auto" | boolean;
2809
+ /**
2810
+ * Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value
2811
+ * of their code points, or via "unicode" collation (via the
2812
+ * [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale
2813
+ * specified in {@link organizeImportsCollationLocale}.
2814
+ *
2815
+ * Default: `"ordinal"`.
2816
+ */
2817
+ readonly organizeImportsCollation?: "ordinal" | "unicode";
2818
+ /**
2819
+ * Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant
2820
+ * for the sake of consistent sorting. Use `"auto"` to use the detected UI locale.
2821
+ *
2822
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
2823
+ *
2824
+ * Default: `"en"`
2825
+ */
2826
+ readonly organizeImportsCollationLocale?: string;
2827
+ /**
2828
+ * Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate
2829
+ * strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`.
2830
+ *
2831
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
2832
+ *
2833
+ * Default: `false`
2834
+ */
2835
+ readonly organizeImportsNumericCollation?: boolean;
2836
+ /**
2837
+ * Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When
2838
+ * `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified
2839
+ * in {@link organizeImportsCollationLocale}.
2840
+ *
2841
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`.
2842
+ *
2843
+ * Default: `true`
2844
+ */
2845
+ readonly organizeImportsAccentCollation?: boolean;
2846
+ /**
2847
+ * Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale
2848
+ * specified in {@link organizeImportsCollationLocale} is used.
2849
+ *
2850
+ * This preference is ignored if {@link organizeImportsCollation} is not `"unicode"`. This preference is also
2851
+ * ignored if we are using case-insensitive sorting, which occurs when {@link organizeImportsIgnoreCase} is `true`,
2852
+ * or if {@link organizeImportsIgnoreCase} is `"auto"` and the auto-detected case sensitivity is determined to be
2853
+ * case-insensitive.
2854
+ *
2855
+ * Default: `false`
2856
+ */
2857
+ readonly organizeImportsCaseFirst?: "upper" | "lower" | false;
2806
2858
  /**
2807
2859
  * Indicates whether {@link ReferencesResponseItem.lineText} is supported.
2808
2860
  */
@@ -3729,7 +3781,7 @@ declare namespace ts {
3729
3781
  private enableRequestedPluginsForProjectAsync;
3730
3782
  configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
3731
3783
  }
3732
- function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string;
3784
+ function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string;
3733
3785
  interface ServerCancellationToken extends HostCancellationToken {
3734
3786
  setRequest(requestId: number): void;
3735
3787
  resetRequest(requestId: number): void;
@@ -3751,8 +3803,14 @@ declare namespace ts {
3751
3803
  useSingleInferredProject: boolean;
3752
3804
  useInferredProjectPerProjectRoot: boolean;
3753
3805
  typingsInstaller: ITypingsInstaller;
3754
- byteLength: (buf: string, encoding?: string) => number;
3755
- hrtime: (start?: number[]) => number[];
3806
+ byteLength: (buf: string, encoding?: BufferEncoding) => number;
3807
+ hrtime: (start?: [
3808
+ number,
3809
+ number
3810
+ ]) => [
3811
+ number,
3812
+ number
3813
+ ];
3756
3814
  logger: Logger;
3757
3815
  /**
3758
3816
  * If falsy, all events are suppressed.
@@ -3781,7 +3839,7 @@ declare namespace ts {
3781
3839
  protected host: ServerHost;
3782
3840
  private readonly cancellationToken;
3783
3841
  protected readonly typingsInstaller: ITypingsInstaller;
3784
- protected byteLength: (buf: string, encoding?: string) => number;
3842
+ protected byteLength: (buf: string, encoding?: BufferEncoding) => number;
3785
3843
  private hrtime;
3786
3844
  protected logger: Logger;
3787
3845
  protected canUseEvents: boolean;
@@ -4379,7 +4437,7 @@ declare namespace ts {
4379
4437
  type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia;
4380
4438
  type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;
4381
4439
  type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail;
4382
- type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
4440
+ type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.AmpersandAmpersandEqualsToken | SyntaxKind.BarBarToken | SyntaxKind.BarBarEqualsToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionQuestionEqualsToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.EqualsToken | SyntaxKind.PlusEqualsToken | SyntaxKind.MinusEqualsToken | SyntaxKind.AsteriskEqualsToken | SyntaxKind.AsteriskAsteriskEqualsToken | SyntaxKind.SlashEqualsToken | SyntaxKind.PercentEqualsToken | SyntaxKind.LessThanLessThanEqualsToken | SyntaxKind.GreaterThanGreaterThanEqualsToken | SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | SyntaxKind.AmpersandEqualsToken | SyntaxKind.BarEqualsToken | SyntaxKind.CaretEqualsToken;
4383
4441
  type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AssertKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SatisfiesKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword;
4384
4442
  type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
4385
4443
  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;
@@ -4531,6 +4589,9 @@ declare namespace ts {
4531
4589
  type ExclamationToken = PunctuationToken<SyntaxKind.ExclamationToken>;
4532
4590
  type ColonToken = PunctuationToken<SyntaxKind.ColonToken>;
4533
4591
  type EqualsToken = PunctuationToken<SyntaxKind.EqualsToken>;
4592
+ type AmpersandAmpersandEqualsToken = PunctuationToken<SyntaxKind.AmpersandAmpersandEqualsToken>;
4593
+ type BarBarEqualsToken = PunctuationToken<SyntaxKind.BarBarEqualsToken>;
4594
+ type QuestionQuestionEqualsToken = PunctuationToken<SyntaxKind.QuestionQuestionEqualsToken>;
4534
4595
  type AsteriskToken = PunctuationToken<SyntaxKind.AsteriskToken>;
4535
4596
  type EqualsGreaterThanToken = PunctuationToken<SyntaxKind.EqualsGreaterThanToken>;
4536
4597
  type PlusToken = PunctuationToken<SyntaxKind.PlusToken>;
@@ -4741,7 +4802,7 @@ declare namespace ts {
4741
4802
  }
4742
4803
  interface ShorthandPropertyAssignment {
4743
4804
  /** @deprecated A shorthand property assignment cannot have modifiers */
4744
- readonly modifiers?: NodeArray<Modifier> | undefined;
4805
+ readonly modifiers?: NodeArray<ModifierLike> | undefined;
4745
4806
  /** @deprecated A shorthand property assignment cannot have a question token */
4746
4807
  readonly questionToken?: QuestionToken | undefined;
4747
4808
  /** @deprecated A shorthand property assignment cannot have an exclamation token */
@@ -4785,7 +4846,7 @@ declare namespace ts {
4785
4846
  type FunctionLike = SignatureDeclaration;
4786
4847
  interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement, LocalsContainer {
4787
4848
  readonly kind: SyntaxKind.FunctionDeclaration;
4788
- readonly modifiers?: NodeArray<Modifier>;
4849
+ readonly modifiers?: NodeArray<ModifierLike>;
4789
4850
  readonly name?: Identifier;
4790
4851
  readonly body?: FunctionBody;
4791
4852
  }
@@ -4805,7 +4866,7 @@ declare namespace ts {
4805
4866
  interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer, LocalsContainer {
4806
4867
  readonly kind: SyntaxKind.Constructor;
4807
4868
  readonly parent: ClassLikeDeclaration;
4808
- readonly modifiers?: NodeArray<Modifier> | undefined;
4869
+ readonly modifiers?: NodeArray<ModifierLike> | undefined;
4809
4870
  readonly body?: FunctionBody | undefined;
4810
4871
  }
4811
4872
  /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
@@ -4831,7 +4892,7 @@ declare namespace ts {
4831
4892
  interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement, LocalsContainer {
4832
4893
  readonly kind: SyntaxKind.IndexSignature;
4833
4894
  readonly parent: ObjectTypeDeclaration;
4834
- readonly modifiers?: NodeArray<Modifier>;
4895
+ readonly modifiers?: NodeArray<ModifierLike>;
4835
4896
  readonly type: TypeNode;
4836
4897
  }
4837
4898
  interface ClassStaticBlockDeclaration extends ClassElement, JSDocContainer, LocalsContainer {
@@ -5414,7 +5475,7 @@ declare namespace ts {
5414
5475
  interface DebuggerStatement extends Statement, FlowContainer {
5415
5476
  readonly kind: SyntaxKind.DebuggerStatement;
5416
5477
  }
5417
- interface MissingDeclaration extends DeclarationStatement {
5478
+ interface MissingDeclaration extends DeclarationStatement, PrimaryExpression {
5418
5479
  readonly kind: SyntaxKind.MissingDeclaration;
5419
5480
  readonly name?: Identifier;
5420
5481
  }
@@ -5425,7 +5486,7 @@ declare namespace ts {
5425
5486
  }
5426
5487
  interface VariableStatement extends Statement, FlowContainer {
5427
5488
  readonly kind: SyntaxKind.VariableStatement;
5428
- readonly modifiers?: NodeArray<Modifier>;
5489
+ readonly modifiers?: NodeArray<ModifierLike>;
5429
5490
  readonly declarationList: VariableDeclarationList;
5430
5491
  }
5431
5492
  interface ExpressionStatement extends Statement, FlowContainer {
@@ -5562,7 +5623,7 @@ declare namespace ts {
5562
5623
  }
5563
5624
  interface InterfaceDeclaration extends DeclarationStatement, JSDocContainer {
5564
5625
  readonly kind: SyntaxKind.InterfaceDeclaration;
5565
- readonly modifiers?: NodeArray<Modifier>;
5626
+ readonly modifiers?: NodeArray<ModifierLike>;
5566
5627
  readonly name: Identifier;
5567
5628
  readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
5568
5629
  readonly heritageClauses?: NodeArray<HeritageClause>;
@@ -5576,7 +5637,7 @@ declare namespace ts {
5576
5637
  }
5577
5638
  interface TypeAliasDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer {
5578
5639
  readonly kind: SyntaxKind.TypeAliasDeclaration;
5579
- readonly modifiers?: NodeArray<Modifier>;
5640
+ readonly modifiers?: NodeArray<ModifierLike>;
5580
5641
  readonly name: Identifier;
5581
5642
  readonly typeParameters?: NodeArray<TypeParameterDeclaration>;
5582
5643
  readonly type: TypeNode;
@@ -5589,7 +5650,7 @@ declare namespace ts {
5589
5650
  }
5590
5651
  interface EnumDeclaration extends DeclarationStatement, JSDocContainer {
5591
5652
  readonly kind: SyntaxKind.EnumDeclaration;
5592
- readonly modifiers?: NodeArray<Modifier>;
5653
+ readonly modifiers?: NodeArray<ModifierLike>;
5593
5654
  readonly name: Identifier;
5594
5655
  readonly members: NodeArray<EnumMember>;
5595
5656
  }
@@ -5598,7 +5659,7 @@ declare namespace ts {
5598
5659
  interface ModuleDeclaration extends DeclarationStatement, JSDocContainer, LocalsContainer {
5599
5660
  readonly kind: SyntaxKind.ModuleDeclaration;
5600
5661
  readonly parent: ModuleBody | SourceFile;
5601
- readonly modifiers?: NodeArray<Modifier>;
5662
+ readonly modifiers?: NodeArray<ModifierLike>;
5602
5663
  readonly name: ModuleName;
5603
5664
  readonly body?: ModuleBody | JSDocNamespaceDeclaration;
5604
5665
  }
@@ -5626,7 +5687,7 @@ declare namespace ts {
5626
5687
  interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer {
5627
5688
  readonly kind: SyntaxKind.ImportEqualsDeclaration;
5628
5689
  readonly parent: SourceFile | ModuleBlock;
5629
- readonly modifiers?: NodeArray<Modifier>;
5690
+ readonly modifiers?: NodeArray<ModifierLike>;
5630
5691
  readonly name: Identifier;
5631
5692
  readonly isTypeOnly: boolean;
5632
5693
  readonly moduleReference: ModuleReference;
@@ -5639,7 +5700,7 @@ declare namespace ts {
5639
5700
  interface ImportDeclaration extends Statement {
5640
5701
  readonly kind: SyntaxKind.ImportDeclaration;
5641
5702
  readonly parent: SourceFile | ModuleBlock;
5642
- readonly modifiers?: NodeArray<Modifier>;
5703
+ readonly modifiers?: NodeArray<ModifierLike>;
5643
5704
  readonly importClause?: ImportClause;
5644
5705
  /** If this is not a StringLiteral it will be a grammar error. */
5645
5706
  readonly moduleSpecifier: Expression;
@@ -5684,7 +5745,7 @@ declare namespace ts {
5684
5745
  interface ExportDeclaration extends DeclarationStatement, JSDocContainer {
5685
5746
  readonly kind: SyntaxKind.ExportDeclaration;
5686
5747
  readonly parent: SourceFile | ModuleBlock;
5687
- readonly modifiers?: NodeArray<Modifier>;
5748
+ readonly modifiers?: NodeArray<ModifierLike>;
5688
5749
  readonly isTypeOnly: boolean;
5689
5750
  /** Will not be assigned in the case of `export * from "foo";` */
5690
5751
  readonly exportClause?: NamedExportBindings;
@@ -5752,7 +5813,7 @@ declare namespace ts {
5752
5813
  interface ExportAssignment extends DeclarationStatement, JSDocContainer {
5753
5814
  readonly kind: SyntaxKind.ExportAssignment;
5754
5815
  readonly parent: SourceFile;
5755
- readonly modifiers?: NodeArray<Modifier>;
5816
+ readonly modifiers?: NodeArray<ModifierLike>;
5756
5817
  readonly isExportEquals?: boolean;
5757
5818
  readonly expression: Expression;
5758
5819
  }
@@ -7519,8 +7580,8 @@ declare namespace ts {
7519
7580
  updateMethodSignature(node: MethodSignature, modifiers: readonly Modifier[] | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): MethodSignature;
7520
7581
  createMethodDeclaration(modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
7521
7582
  updateMethodDeclaration(node: MethodDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: PropertyName, questionToken: QuestionToken | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): MethodDeclaration;
7522
- createConstructorDeclaration(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
7523
- updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
7583
+ createConstructorDeclaration(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
7584
+ updateConstructorDeclaration(node: ConstructorDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], body: Block | undefined): ConstructorDeclaration;
7524
7585
  createGetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
7525
7586
  updateGetAccessorDeclaration(node: GetAccessorDeclaration, modifiers: readonly ModifierLike[] | undefined, name: PropertyName, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): GetAccessorDeclaration;
7526
7587
  createSetAccessorDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | PropertyName, parameters: readonly ParameterDeclaration[], body: Block | undefined): SetAccessorDeclaration;
@@ -7529,8 +7590,8 @@ declare namespace ts {
7529
7590
  updateCallSignature(node: CallSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): CallSignatureDeclaration;
7530
7591
  createConstructSignature(typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): ConstructSignatureDeclaration;
7531
7592
  updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray<TypeParameterDeclaration> | undefined, parameters: NodeArray<ParameterDeclaration>, type: TypeNode | undefined): ConstructSignatureDeclaration;
7532
- createIndexSignature(modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
7533
- updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
7593
+ createIndexSignature(modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
7594
+ updateIndexSignature(node: IndexSignatureDeclaration, modifiers: readonly ModifierLike[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
7534
7595
  createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
7535
7596
  updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
7536
7597
  createClassStaticBlockDeclaration(body: Block): ClassStaticBlockDeclaration;
@@ -7666,8 +7727,8 @@ declare namespace ts {
7666
7727
  createSemicolonClassElement(): SemicolonClassElement;
7667
7728
  createBlock(statements: readonly Statement[], multiLine?: boolean): Block;
7668
7729
  updateBlock(node: Block, statements: readonly Statement[]): Block;
7669
- createVariableStatement(modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
7670
- updateVariableStatement(node: VariableStatement, modifiers: readonly Modifier[] | undefined, declarationList: VariableDeclarationList): VariableStatement;
7730
+ createVariableStatement(modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList | readonly VariableDeclaration[]): VariableStatement;
7731
+ updateVariableStatement(node: VariableStatement, modifiers: readonly ModifierLike[] | undefined, declarationList: VariableDeclarationList): VariableStatement;
7671
7732
  createEmptyStatement(): EmptyStatement;
7672
7733
  createExpressionStatement(expression: Expression): ExpressionStatement;
7673
7734
  updateExpressionStatement(node: ExpressionStatement, expression: Expression): ExpressionStatement;
@@ -7708,24 +7769,24 @@ declare namespace ts {
7708
7769
  updateFunctionDeclaration(node: FunctionDeclaration, modifiers: readonly ModifierLike[] | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
7709
7770
  createClassDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
7710
7771
  updateClassDeclaration(node: ClassDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly ClassElement[]): ClassDeclaration;
7711
- createInterfaceDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
7712
- updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
7713
- createTypeAliasDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
7714
- updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
7715
- createEnumDeclaration(modifiers: readonly Modifier[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
7716
- updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly Modifier[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
7717
- createModuleDeclaration(modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
7718
- updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly Modifier[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
7772
+ createInterfaceDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
7773
+ updateInterfaceDeclaration(node: InterfaceDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, heritageClauses: readonly HeritageClause[] | undefined, members: readonly TypeElement[]): InterfaceDeclaration;
7774
+ createTypeAliasDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
7775
+ updateTypeAliasDeclaration(node: TypeAliasDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, typeParameters: readonly TypeParameterDeclaration[] | undefined, type: TypeNode): TypeAliasDeclaration;
7776
+ createEnumDeclaration(modifiers: readonly ModifierLike[] | undefined, name: string | Identifier, members: readonly EnumMember[]): EnumDeclaration;
7777
+ updateEnumDeclaration(node: EnumDeclaration, modifiers: readonly ModifierLike[] | undefined, name: Identifier, members: readonly EnumMember[]): EnumDeclaration;
7778
+ createModuleDeclaration(modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined, flags?: NodeFlags): ModuleDeclaration;
7779
+ updateModuleDeclaration(node: ModuleDeclaration, modifiers: readonly ModifierLike[] | undefined, name: ModuleName, body: ModuleBody | undefined): ModuleDeclaration;
7719
7780
  createModuleBlock(statements: readonly Statement[]): ModuleBlock;
7720
7781
  updateModuleBlock(node: ModuleBlock, statements: readonly Statement[]): ModuleBlock;
7721
7782
  createCaseBlock(clauses: readonly CaseOrDefaultClause[]): CaseBlock;
7722
7783
  updateCaseBlock(node: CaseBlock, clauses: readonly CaseOrDefaultClause[]): CaseBlock;
7723
7784
  createNamespaceExportDeclaration(name: string | Identifier): NamespaceExportDeclaration;
7724
7785
  updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration;
7725
- createImportEqualsDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
7726
- updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
7727
- createImportDeclaration(modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration;
7728
- updateImportDeclaration(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
7786
+ createImportEqualsDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
7787
+ updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
7788
+ createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration;
7789
+ updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
7729
7790
  createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
7730
7791
  updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
7731
7792
  createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
@@ -7742,10 +7803,10 @@ declare namespace ts {
7742
7803
  updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
7743
7804
  createImportSpecifier(isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
7744
7805
  updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
7745
- createExportAssignment(modifiers: readonly Modifier[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
7746
- updateExportAssignment(node: ExportAssignment, modifiers: readonly Modifier[] | undefined, expression: Expression): ExportAssignment;
7747
- createExportDeclaration(modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration;
7748
- updateExportDeclaration(node: ExportDeclaration, modifiers: readonly Modifier[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration;
7806
+ createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
7807
+ updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment;
7808
+ createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration;
7809
+ updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration;
7749
7810
  createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
7750
7811
  updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
7751
7812
  createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier;
@@ -7822,10 +7883,10 @@ declare namespace ts {
7822
7883
  updateJSDocReadonlyTag(node: JSDocReadonlyTag, tagName: Identifier | undefined, comment: string | NodeArray<JSDocComment> | undefined): JSDocReadonlyTag;
7823
7884
  createJSDocUnknownTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocUnknownTag;
7824
7885
  updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag;
7825
- createJSDocDeprecatedTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
7826
- updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
7827
- createJSDocOverrideTag(tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
7828
- updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
7886
+ createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
7887
+ updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
7888
+ createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
7889
+ updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
7829
7890
  createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment>): JSDocThrowsTag;
7830
7891
  updateJSDocThrowsTag(node: JSDocThrowsTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment> | undefined): JSDocThrowsTag;
7831
7892
  createJSDocSatisfiesTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string | NodeArray<JSDocComment>): JSDocSatisfiesTag;
@@ -8192,16 +8253,39 @@ declare namespace ts {
8192
8253
  /**
8193
8254
  * A function that accepts and possibly transforms a node.
8194
8255
  */
8195
- type Visitor = (node: Node) => VisitResult<Node>;
8256
+ type Visitor<TIn extends Node = Node, TOut extends Node | undefined = TIn | undefined> = (node: TIn) => VisitResult<TOut>;
8257
+ /**
8258
+ * A function that walks a node using the given visitor, lifting node arrays into single nodes,
8259
+ * returning an node which satisfies the test.
8260
+ *
8261
+ * - If the input node is undefined, then the output is undefined.
8262
+ * - If the visitor returns undefined, then the output is undefined.
8263
+ * - If the output node is not undefined, then it will satisfy the test function.
8264
+ * - In order to obtain a return type that is more specific than `Node`, a test
8265
+ * function _must_ be provided, and that function must be a type predicate.
8266
+ *
8267
+ * For the canonical implementation of this type, @see {visitNode}.
8268
+ */
8196
8269
  interface NodeVisitor {
8197
- <T extends Node>(nodes: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
8198
- <T extends Node>(nodes: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
8270
+ <TIn extends Node | undefined, TVisited extends Node | undefined, TOut extends Node>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined);
8271
+ <TIn extends Node | undefined, TVisited extends Node | undefined>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined);
8199
8272
  }
8273
+ /**
8274
+ * A function that walks a node array using the given visitor, returning an array whose contents satisfy the test.
8275
+ *
8276
+ * - If the input node array is undefined, the output is undefined.
8277
+ * - If the visitor can return undefined, the node it visits in the array will be reused.
8278
+ * - If the output node array is not undefined, then its contents will satisfy the test.
8279
+ * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test
8280
+ * function _must_ be provided, and that function must be a type predicate.
8281
+ *
8282
+ * For the canonical implementation of this type, @see {visitNodes}.
8283
+ */
8200
8284
  interface NodesVisitor {
8201
- <T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
8202
- <T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
8285
+ <TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray<TOut> | (TInArray & undefined);
8286
+ <TIn extends Node, TInArray extends NodeArray<TIn> | undefined>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<Node> | (TInArray & undefined);
8203
8287
  }
8204
- type VisitResult<T extends Node> = T | readonly T[] | undefined;
8288
+ type VisitResult<T extends Node | undefined> = T | readonly Node[];
8205
8289
  interface Printer {
8206
8290
  /**
8207
8291
  * Print a node and its subtree as-is, without any emit transformations.
@@ -8401,6 +8485,11 @@ declare namespace ts {
8401
8485
  readonly allowRenameOfImportPath?: boolean;
8402
8486
  readonly autoImportFileExcludePatterns?: string[];
8403
8487
  readonly organizeImportsIgnoreCase?: "auto" | boolean;
8488
+ readonly organizeImportsCollation?: "ordinal" | "unicode";
8489
+ readonly organizeImportsLocale?: string;
8490
+ readonly organizeImportsNumericCollation?: boolean;
8491
+ readonly organizeImportsAccentCollation?: boolean;
8492
+ readonly organizeImportsCaseFirst?: "upper" | "lower" | false;
8404
8493
  }
8405
8494
  /** Represents a bigint literal value without requiring bigint support */
8406
8495
  interface PseudoBigInt {
@@ -8415,6 +8504,7 @@ declare namespace ts {
8415
8504
  }
8416
8505
  type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, modifiedTime?: Date) => void;
8417
8506
  type DirectoryWatcherCallback = (fileName: string) => void;
8507
+ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
8418
8508
  interface System {
8419
8509
  args: string[];
8420
8510
  newLine: string;
@@ -8473,8 +8563,8 @@ declare namespace ts {
8473
8563
  function forEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
8474
8564
  function forEachTrailingCommentRange<U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
8475
8565
  function forEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
8476
- function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
8477
- function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
8566
+ function reduceEachLeadingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined;
8567
+ function reduceEachTrailingCommentRange<T, U>(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T, initial: U): U | undefined;
8478
8568
  function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
8479
8569
  function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
8480
8570
  /** Optionally, get the shebang */
@@ -8553,7 +8643,7 @@ declare namespace ts {
8553
8643
  function getTypeParameterOwner(d: Declaration): Declaration | undefined;
8554
8644
  function isParameterPropertyDeclaration(node: Node, parent: Node): node is ParameterPropertyDeclaration;
8555
8645
  function isEmptyBindingPattern(node: BindingName): node is BindingPattern;
8556
- function isEmptyBindingElement(node: BindingElement): boolean;
8646
+ function isEmptyBindingElement(node: BindingElement | ArrayBindingElement): boolean;
8557
8647
  function walkUpBindingElementsAndPatterns(binding: BindingElement): VariableDeclaration | ParameterDeclaration;
8558
8648
  function getCombinedModifierFlags(node: Declaration): ModifierFlags;
8559
8649
  function getCombinedNodeFlags(node: Node): NodeFlags;
@@ -8570,7 +8660,7 @@ declare namespace ts {
8570
8660
  function getOriginalNode(node: Node): Node;
8571
8661
  function getOriginalNode<T extends Node>(node: Node, nodeTest: (node: Node) => node is T): T;
8572
8662
  function getOriginalNode(node: Node | undefined): Node | undefined;
8573
- function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
8663
+ function getOriginalNode<T extends Node>(node: Node | undefined, nodeTest: (node: Node) => node is T): T | undefined;
8574
8664
  /**
8575
8665
  * Iterates through the parent chain of a node and performs the callback on each parent until the callback
8576
8666
  * returns a truthy value, then returns that value.
@@ -9288,41 +9378,65 @@ declare namespace ts {
9288
9378
  /**
9289
9379
  * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
9290
9380
  *
9381
+ * - If the input node is undefined, then the output is undefined.
9382
+ * - If the visitor returns undefined, then the output is undefined.
9383
+ * - If the output node is not undefined, then it will satisfy the test function.
9384
+ * - In order to obtain a return type that is more specific than `Node`, a test
9385
+ * function _must_ be provided, and that function must be a type predicate.
9386
+ *
9291
9387
  * @param node The Node to visit.
9292
9388
  * @param visitor The callback used to visit the Node.
9293
9389
  * @param test A callback to execute to verify the Node is valid.
9294
9390
  * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
9295
9391
  */
9296
- function visitNode<T extends Node>(node: T, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T;
9392
+ function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined, TOut extends Node>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test: (node: Node) => node is TOut, lift?: (node: readonly Node[]) => Node): TOut | (TIn & undefined) | (TVisited & undefined);
9297
9393
  /**
9298
9394
  * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
9299
9395
  *
9396
+ * - If the input node is undefined, then the output is undefined.
9397
+ * - If the visitor returns undefined, then the output is undefined.
9398
+ * - If the output node is not undefined, then it will satisfy the test function.
9399
+ * - In order to obtain a return type that is more specific than `Node`, a test
9400
+ * function _must_ be provided, and that function must be a type predicate.
9401
+ *
9300
9402
  * @param node The Node to visit.
9301
9403
  * @param visitor The callback used to visit the Node.
9302
9404
  * @param test A callback to execute to verify the Node is valid.
9303
9405
  * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
9304
9406
  */
9305
- function visitNode<T extends Node>(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => T): T | undefined;
9407
+ function visitNode<TIn extends Node | undefined, TVisited extends Node | undefined>(node: TIn, visitor: Visitor<NonNullable<TIn>, TVisited>, test?: (node: Node) => boolean, lift?: (node: readonly Node[]) => Node): Node | (TIn & undefined) | (TVisited & undefined);
9306
9408
  /**
9307
9409
  * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
9308
9410
  *
9411
+ * - If the input node array is undefined, the output is undefined.
9412
+ * - If the visitor can return undefined, the node it visits in the array will be reused.
9413
+ * - If the output node array is not undefined, then its contents will satisfy the test.
9414
+ * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test
9415
+ * function _must_ be provided, and that function must be a type predicate.
9416
+ *
9309
9417
  * @param nodes The NodeArray to visit.
9310
9418
  * @param visitor The callback used to visit a Node.
9311
9419
  * @param test A node test to execute for each node.
9312
9420
  * @param start An optional value indicating the starting offset at which to start visiting.
9313
9421
  * @param count An optional value indicating the maximum number of nodes to visit.
9314
9422
  */
9315
- function visitNodes<T extends Node>(nodes: NodeArray<T>, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T>;
9423
+ function visitNodes<TIn extends Node, TInArray extends NodeArray<TIn> | undefined, TOut extends Node>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test: (node: Node) => node is TOut, start?: number, count?: number): NodeArray<TOut> | (TInArray & undefined);
9316
9424
  /**
9317
9425
  * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
9318
9426
  *
9427
+ * - If the input node array is undefined, the output is undefined.
9428
+ * - If the visitor can return undefined, the node it visits in the array will be reused.
9429
+ * - If the output node array is not undefined, then its contents will satisfy the test.
9430
+ * - In order to obtain a return type that is more specific than `NodeArray<Node>`, a test
9431
+ * function _must_ be provided, and that function must be a type predicate.
9432
+ *
9319
9433
  * @param nodes The NodeArray to visit.
9320
9434
  * @param visitor The callback used to visit a Node.
9321
9435
  * @param test A node test to execute for each node.
9322
9436
  * @param start An optional value indicating the starting offset at which to start visiting.
9323
9437
  * @param count An optional value indicating the maximum number of nodes to visit.
9324
9438
  */
9325
- function visitNodes<T extends Node>(nodes: NodeArray<T> | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<T> | undefined;
9439
+ function visitNodes<TIn extends Node, TInArray extends NodeArray<TIn> | undefined>(nodes: TInArray, visitor: Visitor<TIn, Node | undefined>, test?: (node: Node) => boolean, start?: number, count?: number): NodeArray<Node> | (TInArray & undefined);
9326
9440
  /**
9327
9441
  * Starts a new lexical environment and visits a statement list, ending the lexical environment
9328
9442
  * and merging hoisted declarations upon completion.
@@ -9353,6 +9467,12 @@ declare namespace ts {
9353
9467
  * Visits an iteration body, adding any block-scoped variables required by the transformation.
9354
9468
  */
9355
9469
  function visitIterationBody(body: Statement, visitor: Visitor, context: TransformationContext): Statement;
9470
+ /**
9471
+ * Visits the elements of a {@link CommaListExpression}.
9472
+ * @param visitor The visitor to use when visiting expressions whose result will not be discarded at runtime.
9473
+ * @param discardVisitor The visitor to use when visiting expressions whose result will be discarded at runtime. Defaults to {@link visitor}.
9474
+ */
9475
+ function visitCommaListElements(elements: NodeArray<Expression>, visitor: Visitor, discardVisitor?: Visitor): NodeArray<Expression>;
9356
9476
  /**
9357
9477
  * Visits each child of a Node using the supplied visitor, possibly returning a new Node of the same kind in its place.
9358
9478
  *