@babel/traverse 8.0.0-alpha.10 → 8.0.0-alpha.12

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.
package/lib/index.d.ts CHANGED
@@ -211,6 +211,17 @@ declare class Scope {
211
211
  moveBindingTo(name: string, scope: Scope): void;
212
212
  removeOwnBinding(name: string): void;
213
213
  removeBinding(name: string): void;
214
+ /**
215
+ * Hoist all the `var` variable to the beginning of the function/program
216
+ * scope where their binding will be actually defined. For exmaple,
217
+ * { var x = 2 }
218
+ * will be transformed to
219
+ * var x; { x = 2 }
220
+ *
221
+ * @param emit A custom function to emit `var` declarations, for example to
222
+ * emit them in a different scope.
223
+ */
224
+ hoistVariables(emit?: (id: t.Identifier, hasInit: boolean) => void): void;
214
225
  }
215
226
  declare namespace Scope {
216
227
  type Binding = _Binding;
@@ -956,10 +967,6 @@ declare function inType(this: NodePath_Final, ...candidateTypes: string[]): bool
956
967
  * Infer the type of the current `NodePath`.
957
968
  */
958
969
  declare function getTypeAnnotation(this: NodePath_Final): t.FlowType | t.TSType;
959
- /**
960
- * todo: split up this method
961
- */
962
- declare function _getTypeAnnotation(this: NodePath_Final): any;
963
970
  declare function isBaseType(this: NodePath_Final, baseName: string, soft?: boolean): boolean;
964
971
  declare function couldBeBaseType(this: NodePath_Final, name: string): boolean;
965
972
  declare function baseTypeStrictlyMatches(this: NodePath_Final, rightArg: NodePath_Final): boolean;
@@ -986,16 +993,12 @@ declare function replaceWithSourceString(this: NodePath_Final, replacement: stri
986
993
  */
987
994
  declare function replaceWith<R extends t.Node>(this: NodePath_Final, replacementPath: R): [NodePath_Final<R>];
988
995
  declare function replaceWith<R extends NodePath_Final>(this: NodePath_Final, replacementPath: R): [R];
989
- /**
990
- * Description
991
- */
992
- declare function _replaceWith(this: NodePath_Final, node: t.Node): void;
993
996
  /**
994
997
  * This method takes an array of statements nodes and then explodes it
995
998
  * into expressions. This method retains completion records which is
996
999
  * extremely important to retain original semantics.
997
1000
  */
998
- declare function replaceExpressionWithStatements(this: NodePath_Final, nodes: Array<t.Statement>): (NodePath<t.ArrayExpression> | NodePath<t.ArrowFunctionExpression> | NodePath<t.AssignmentExpression> | NodePath<t.AwaitExpression> | NodePath<t.BigIntLiteral> | NodePath<t.BinaryExpression> | NodePath<t.BindExpression> | NodePath<t.BooleanLiteral> | NodePath<t.CallExpression> | NodePath<t.ClassExpression> | NodePath<t.ConditionalExpression> | NodePath<t.DecimalLiteral> | NodePath<t.DoExpression> | NodePath<t.FunctionExpression> | NodePath<t.Identifier> | NodePath<t.Import> | NodePath<t.ImportExpression> | NodePath<t.JSXElement> | NodePath<t.JSXFragment> | NodePath<t.LogicalExpression> | NodePath<t.MemberExpression> | NodePath<t.MetaProperty> | NodePath<t.ModuleExpression> | NodePath<t.NewExpression> | NodePath<t.NullLiteral> | NodePath<t.NumericLiteral> | NodePath<t.ObjectExpression> | NodePath<t.OptionalCallExpression> | NodePath<t.OptionalMemberExpression> | NodePath<t.ParenthesizedExpression> | NodePath<t.PipelineBareFunction> | NodePath<t.PipelinePrimaryTopicReference> | NodePath<t.PipelineTopicExpression> | NodePath<t.RecordExpression> | NodePath<t.RegExpLiteral> | NodePath<t.SequenceExpression> | NodePath<t.StringLiteral> | NodePath<t.TSAnyKeyword> | NodePath<t.TSArrayType> | NodePath<t.TSAsExpression> | NodePath<t.TSBigIntKeyword> | NodePath<t.TSBooleanKeyword> | NodePath<t.TSConditionalType> | NodePath<t.TSConstructorType> | NodePath<t.TSExpressionWithTypeArguments> | NodePath<t.TSFunctionType> | NodePath<t.TSImportType> | NodePath<t.TSIndexedAccessType> | NodePath<t.TSInferType> | NodePath<t.TSInstantiationExpression> | NodePath<t.TSIntersectionType> | NodePath<t.TSIntrinsicKeyword> | NodePath<t.TSLiteralType> | NodePath<t.TSMappedType> | NodePath<t.TSNeverKeyword> | NodePath<t.TSNonNullExpression> | NodePath<t.TSNullKeyword> | NodePath<t.TSNumberKeyword> | NodePath<t.TSObjectKeyword> | NodePath<t.TSOptionalType> | NodePath<t.TSParenthesizedType> | NodePath<t.TSRestType> | NodePath<t.TSSatisfiesExpression> | NodePath<t.TSStringKeyword> | NodePath<t.TSSymbolKeyword> | NodePath<t.TSThisType> | NodePath<t.TSTupleType> | NodePath<t.TSTypeAssertion> | NodePath<t.TSTypeLiteral> | NodePath<t.TSTypeOperator> | NodePath<t.TSTypePredicate> | NodePath<t.TSTypeQuery> | NodePath<t.TSTypeReference> | NodePath<t.TSUndefinedKeyword> | NodePath<t.TSUnionType> | NodePath<t.TSUnknownKeyword> | NodePath<t.TSVoidKeyword> | NodePath<t.TaggedTemplateExpression> | NodePath<t.TemplateLiteral> | NodePath<t.ThisExpression> | NodePath<t.TopicReference> | NodePath<t.TupleExpression> | NodePath<t.TypeCastExpression> | NodePath<t.UnaryExpression> | NodePath<t.UpdateExpression> | NodePath<t.YieldExpression>)[] | (NodePath<t.BlockStatement> | NodePath<t.BreakStatement> | NodePath<t.ClassDeclaration> | NodePath<t.ContinueStatement> | NodePath<t.DebuggerStatement> | NodePath<t.DeclareClass> | NodePath<t.DeclareExportAllDeclaration> | NodePath<t.DeclareExportDeclaration> | NodePath<t.DeclareFunction> | NodePath<t.DeclareInterface> | NodePath<t.DeclareModule> | NodePath<t.DeclareModuleExports> | NodePath<t.DeclareOpaqueType> | NodePath<t.DeclareTypeAlias> | NodePath<t.DeclareVariable> | NodePath<t.DoWhileStatement> | NodePath<t.EmptyStatement> | NodePath<t.EnumDeclaration> | NodePath<t.ExportAllDeclaration> | NodePath<t.ExportDefaultDeclaration> | NodePath<t.ExportNamedDeclaration> | NodePath<t.ExpressionStatement> | NodePath<t.ForInStatement> | NodePath<t.ForOfStatement> | NodePath<t.ForStatement> | NodePath<t.FunctionDeclaration> | NodePath<t.IfStatement> | NodePath<t.ImportDeclaration> | NodePath<t.InterfaceDeclaration> | NodePath<t.LabeledStatement> | NodePath<t.OpaqueType> | NodePath<t.ReturnStatement> | NodePath<t.SwitchStatement> | NodePath<t.TSDeclareFunction> | NodePath<t.TSEnumDeclaration> | NodePath<t.TSExportAssignment> | NodePath<t.TSImportEqualsDeclaration> | NodePath<t.TSInterfaceDeclaration> | NodePath<t.TSModuleDeclaration> | NodePath<t.TSNamespaceExportDeclaration> | NodePath<t.TSTypeAliasDeclaration> | NodePath<t.ThrowStatement> | NodePath<t.TryStatement> | NodePath<t.TypeAlias> | NodePath<t.VariableDeclaration> | NodePath<t.WhileStatement> | NodePath<t.WithStatement>)[];
1001
+ declare function replaceExpressionWithStatements(this: NodePath_Final, nodes: Array<t.Statement>): (NodePath<t.BlockStatement> | NodePath<t.BreakStatement> | NodePath<t.ClassDeclaration> | NodePath<t.ContinueStatement> | NodePath<t.DebuggerStatement> | NodePath<t.DeclareClass> | NodePath<t.DeclareExportAllDeclaration> | NodePath<t.DeclareExportDeclaration> | NodePath<t.DeclareFunction> | NodePath<t.DeclareInterface> | NodePath<t.DeclareModule> | NodePath<t.DeclareModuleExports> | NodePath<t.DeclareOpaqueType> | NodePath<t.DeclareTypeAlias> | NodePath<t.DeclareVariable> | NodePath<t.DoWhileStatement> | NodePath<t.EmptyStatement> | NodePath<t.EnumDeclaration> | NodePath<t.ExportAllDeclaration> | NodePath<t.ExportDefaultDeclaration> | NodePath<t.ExportNamedDeclaration> | NodePath<t.ExpressionStatement> | NodePath<t.ForInStatement> | NodePath<t.ForOfStatement> | NodePath<t.ForStatement> | NodePath<t.FunctionDeclaration> | NodePath<t.IfStatement> | NodePath<t.ImportDeclaration> | NodePath<t.InterfaceDeclaration> | NodePath<t.LabeledStatement> | NodePath<t.OpaqueType> | NodePath<t.ReturnStatement> | NodePath<t.SwitchStatement> | NodePath<t.TSDeclareFunction> | NodePath<t.TSEnumDeclaration> | NodePath<t.TSExportAssignment> | NodePath<t.TSImportEqualsDeclaration> | NodePath<t.TSInterfaceDeclaration> | NodePath<t.TSModuleDeclaration> | NodePath<t.TSNamespaceExportDeclaration> | NodePath<t.TSTypeAliasDeclaration> | NodePath<t.ThrowStatement> | NodePath<t.TryStatement> | NodePath<t.TypeAlias> | NodePath<t.VariableDeclaration> | NodePath<t.WhileStatement> | NodePath<t.WithStatement>)[] | (NodePath<t.ArrayExpression> | NodePath<t.ArrowFunctionExpression> | NodePath<t.AssignmentExpression> | NodePath<t.AwaitExpression> | NodePath<t.BigIntLiteral> | NodePath<t.BinaryExpression> | NodePath<t.BindExpression> | NodePath<t.BooleanLiteral> | NodePath<t.CallExpression> | NodePath<t.ClassExpression> | NodePath<t.ConditionalExpression> | NodePath<t.DecimalLiteral> | NodePath<t.DoExpression> | NodePath<t.FunctionExpression> | NodePath<t.Identifier> | NodePath<t.Import> | NodePath<t.ImportExpression> | NodePath<t.JSXElement> | NodePath<t.JSXFragment> | NodePath<t.LogicalExpression> | NodePath<t.MemberExpression> | NodePath<t.MetaProperty> | NodePath<t.ModuleExpression> | NodePath<t.NewExpression> | NodePath<t.NullLiteral> | NodePath<t.NumericLiteral> | NodePath<t.ObjectExpression> | NodePath<t.OptionalCallExpression> | NodePath<t.OptionalMemberExpression> | NodePath<t.ParenthesizedExpression> | NodePath<t.PipelineBareFunction> | NodePath<t.PipelinePrimaryTopicReference> | NodePath<t.PipelineTopicExpression> | NodePath<t.RecordExpression> | NodePath<t.RegExpLiteral> | NodePath<t.SequenceExpression> | NodePath<t.StringLiteral> | NodePath<t.TSAnyKeyword> | NodePath<t.TSArrayType> | NodePath<t.TSAsExpression> | NodePath<t.TSBigIntKeyword> | NodePath<t.TSBooleanKeyword> | NodePath<t.TSConditionalType> | NodePath<t.TSConstructorType> | NodePath<t.TSExpressionWithTypeArguments> | NodePath<t.TSFunctionType> | NodePath<t.TSImportType> | NodePath<t.TSIndexedAccessType> | NodePath<t.TSInferType> | NodePath<t.TSInstantiationExpression> | NodePath<t.TSIntersectionType> | NodePath<t.TSIntrinsicKeyword> | NodePath<t.TSLiteralType> | NodePath<t.TSMappedType> | NodePath<t.TSNeverKeyword> | NodePath<t.TSNonNullExpression> | NodePath<t.TSNullKeyword> | NodePath<t.TSNumberKeyword> | NodePath<t.TSObjectKeyword> | NodePath<t.TSOptionalType> | NodePath<t.TSParenthesizedType> | NodePath<t.TSRestType> | NodePath<t.TSSatisfiesExpression> | NodePath<t.TSStringKeyword> | NodePath<t.TSSymbolKeyword> | NodePath<t.TSThisType> | NodePath<t.TSTupleType> | NodePath<t.TSTypeAssertion> | NodePath<t.TSTypeLiteral> | NodePath<t.TSTypeOperator> | NodePath<t.TSTypePredicate> | NodePath<t.TSTypeQuery> | NodePath<t.TSTypeReference> | NodePath<t.TSUndefinedKeyword> | NodePath<t.TSUnionType> | NodePath<t.TSUnknownKeyword> | NodePath<t.TSVoidKeyword> | NodePath<t.TaggedTemplateExpression> | NodePath<t.TemplateLiteral> | NodePath<t.ThisExpression> | NodePath<t.TopicReference> | NodePath<t.TupleExpression> | NodePath<t.TypeCastExpression> | NodePath<t.UnaryExpression> | NodePath<t.UpdateExpression> | NodePath<t.YieldExpression>)[];
999
1002
  declare function replaceInline(this: NodePath_Final, nodes: t.Node | Array<t.Node>): NodePath_Final[];
1000
1003
 
1001
1004
  /**
@@ -1054,6 +1057,8 @@ declare function arrowFunctionToExpression(this: NodePath_Final<t.ArrowFunctionE
1054
1057
  allowInsertArrowWithRest?: boolean | void;
1055
1058
  noNewArrows?: boolean;
1056
1059
  }): NodePath_Final<Exclude<t.Function, t.Method | t.ArrowFunctionExpression> | t.CallExpression>;
1060
+ declare function splitExportDeclaration(this: NodePath_Final<t.ExportDefaultDeclaration | t.ExportNamedDeclaration>): NodePath_Final<t.Declaration>;
1061
+ declare function ensureFunctionName<N extends t.FunctionExpression | t.ClassExpression>(this: NodePath_Final<N>, supportUnicodeId: boolean): null | NodePath_Final<N>;
1057
1062
 
1058
1063
  /**
1059
1064
  * Match the current node if it matches the provided `pattern`.
@@ -1132,12 +1137,10 @@ declare function _guessExecutionStatusRelativeTo(this: NodePath_Final, target: N
1132
1137
  * Resolve a "pointer" `NodePath` to it's absolute path.
1133
1138
  */
1134
1139
  declare function resolve(this: NodePath_Final, dangerous?: boolean, resolved?: NodePath_Final[]): NodePath_Final;
1135
- declare function _resolve(this: NodePath_Final, dangerous?: boolean, resolved?: NodePath_Final[]): NodePath_Final | undefined | null;
1136
1140
  declare function isConstantExpression(this: NodePath_Final): boolean;
1137
1141
  declare function isInStrictMode(this: NodePath_Final): boolean;
1138
1142
 
1139
1143
  declare function call(this: NodePath_Final, key: VisitPhase): boolean;
1140
- declare function _call(this: NodePath_Final, fns?: Array<Function>): boolean;
1141
1144
  declare function isDenylisted(this: NodePath_Final): boolean;
1142
1145
 
1143
1146
  declare function visit(this: NodePath_Final): boolean;
@@ -1152,31 +1155,19 @@ declare function setContext<S = unknown>(this: NodePath_Final, context?: Travers
1152
1155
  * for the new values.
1153
1156
  */
1154
1157
  declare function resync(this: NodePath_Final): void;
1155
- declare function _resyncParent(this: NodePath_Final): void;
1156
- declare function _resyncKey(this: NodePath_Final): void;
1157
- declare function _resyncList(this: NodePath_Final): void;
1158
- declare function _resyncRemoved(this: NodePath_Final): void;
1159
1158
  declare function popContext(this: NodePath_Final): void;
1160
1159
  declare function pushContext(this: NodePath_Final, context: TraversalContext): void;
1161
1160
  declare function setup(this: NodePath_Final, parentPath: NodePath_Final | undefined, container: t.Node | t.Node[], listKey: string, key: string | number): void;
1162
1161
  declare function setKey(this: NodePath_Final, key: string | number): void;
1163
1162
  declare function requeue(this: NodePath_Final, pathToQueue?: NodePath_Final): void;
1164
- declare function _getQueueContexts(this: NodePath_Final): TraversalContext<unknown>[];
1163
+ declare function requeueComputedKeyAndDecorators(this: NodePath_Final<t.Method | t.Property>): void;
1165
1164
 
1166
1165
  declare function remove(this: NodePath_Final): void;
1167
- declare function _removeFromScope(this: NodePath_Final): void;
1168
- declare function _callRemovalHooks(this: NodePath_Final): boolean;
1169
- declare function _remove(this: NodePath_Final): void;
1170
- declare function _markRemoved(this: NodePath_Final): void;
1171
- declare function _assertUnremoved(this: NodePath_Final): void;
1172
1166
 
1173
1167
  /**
1174
1168
  * Insert the provided nodes before the current one.
1175
1169
  */
1176
1170
  declare function insertBefore(this: NodePath_Final, nodes_: t.Node | t.Node[]): NodePath_Final[];
1177
- declare function _containerInsert<N extends t.Node>(this: NodePath_Final, from: number, nodes: N[]): NodePath_Final<N>[];
1178
- declare function _containerInsertBefore<N extends t.Node>(this: NodePath_Final, nodes: N[]): NodePath_Final<N>[];
1179
- declare function _containerInsertAfter<N extends t.Node>(this: NodePath_Final, nodes: N[]): NodePath_Final<N>[];
1180
1171
  /**
1181
1172
  * Insert the provided nodes after the current one. When inserting nodes after an
1182
1173
  * expression, ensure that the completion record is correct by pushing the current node.
@@ -1186,7 +1177,6 @@ declare function insertAfter(this: NodePath_Final, nodes_: t.Node | t.Node[]): N
1186
1177
  * Update all sibling node paths after `fromIndex` by `incrementBy`.
1187
1178
  */
1188
1179
  declare function updateSiblingKeys(this: NodePath_Final, fromIndex: number, incrementBy: number): void;
1189
- declare function _verifyNodeList<N extends t.Node>(this: NodePath_Final, nodes: N | N[]): N[];
1190
1180
  declare function unshiftContainer<N extends t.Node, K extends keyof N & string>(this: NodePath_Final<N>, listKey: K, nodes: N[K] extends (infer E)[] ? E | E[] : never): (NodePath<t.AnyTypeAnnotation> | NodePath<t.ArgumentPlaceholder> | NodePath<t.ArrayExpression> | NodePath<t.ArrayPattern> | NodePath<t.ArrayTypeAnnotation> | NodePath<t.ArrowFunctionExpression> | NodePath<t.AssignmentExpression> | NodePath<t.AssignmentPattern> | NodePath<t.AwaitExpression> | NodePath<t.BigIntLiteral> | NodePath<t.BinaryExpression> | NodePath<t.BindExpression> | NodePath<t.BlockStatement> | NodePath<t.BooleanLiteral> | NodePath<t.BooleanLiteralTypeAnnotation> | NodePath<t.BooleanTypeAnnotation> | NodePath<t.BreakStatement> | NodePath<t.CallExpression> | NodePath<t.CatchClause> | NodePath<t.ClassAccessorProperty> | NodePath<t.ClassBody> | NodePath<t.ClassDeclaration> | NodePath<t.ClassExpression> | NodePath<t.ClassImplements> | NodePath<t.ClassMethod> | NodePath<t.ClassPrivateMethod> | NodePath<t.ClassPrivateProperty> | NodePath<t.ClassProperty> | NodePath<t.ConditionalExpression> | NodePath<t.ContinueStatement> | NodePath<t.DebuggerStatement> | NodePath<t.DecimalLiteral> | NodePath<t.DeclareClass> | NodePath<t.DeclareExportAllDeclaration> | NodePath<t.DeclareExportDeclaration> | NodePath<t.DeclareFunction> | NodePath<t.DeclareInterface> | NodePath<t.DeclareModule> | NodePath<t.DeclareModuleExports> | NodePath<t.DeclareOpaqueType> | NodePath<t.DeclareTypeAlias> | NodePath<t.DeclareVariable> | NodePath<t.DeclaredPredicate> | NodePath<t.Decorator> | NodePath<t.Directive> | NodePath<t.DirectiveLiteral> | NodePath<t.DoExpression> | NodePath<t.DoWhileStatement> | NodePath<t.EmptyStatement> | NodePath<t.EmptyTypeAnnotation> | NodePath<t.EnumBooleanBody> | NodePath<t.EnumBooleanMember> | NodePath<t.EnumDeclaration> | NodePath<t.EnumDefaultedMember> | NodePath<t.EnumNumberBody> | NodePath<t.EnumNumberMember> | NodePath<t.EnumStringBody> | NodePath<t.EnumStringMember> | NodePath<t.EnumSymbolBody> | NodePath<t.ExistsTypeAnnotation> | NodePath<t.ExportAllDeclaration> | NodePath<t.ExportDefaultDeclaration> | NodePath<t.ExportDefaultSpecifier> | NodePath<t.ExportNamedDeclaration> | NodePath<t.ExportNamespaceSpecifier> | NodePath<t.ExportSpecifier> | NodePath<t.ExpressionStatement> | NodePath<t.File> | NodePath<t.ForInStatement> | NodePath<t.ForOfStatement> | NodePath<t.ForStatement> | NodePath<t.FunctionDeclaration> | NodePath<t.FunctionExpression> | NodePath<t.FunctionTypeAnnotation> | NodePath<t.FunctionTypeParam> | NodePath<t.GenericTypeAnnotation> | NodePath<t.Identifier> | NodePath<t.IfStatement> | NodePath<t.Import> | NodePath<t.ImportAttribute> | NodePath<t.ImportDeclaration> | NodePath<t.ImportDefaultSpecifier> | NodePath<t.ImportExpression> | NodePath<t.ImportNamespaceSpecifier> | NodePath<t.ImportSpecifier> | NodePath<t.IndexedAccessType> | NodePath<t.InferredPredicate> | NodePath<t.InterfaceDeclaration> | NodePath<t.InterfaceExtends> | NodePath<t.InterfaceTypeAnnotation> | NodePath<t.InterpreterDirective> | NodePath<t.IntersectionTypeAnnotation> | NodePath<t.JSXAttribute> | NodePath<t.JSXClosingElement> | NodePath<t.JSXClosingFragment> | NodePath<t.JSXElement> | NodePath<t.JSXEmptyExpression> | NodePath<t.JSXExpressionContainer> | NodePath<t.JSXFragment> | NodePath<t.JSXIdentifier> | NodePath<t.JSXMemberExpression> | NodePath<t.JSXNamespacedName> | NodePath<t.JSXOpeningElement> | NodePath<t.JSXOpeningFragment> | NodePath<t.JSXSpreadAttribute> | NodePath<t.JSXSpreadChild> | NodePath<t.JSXText> | NodePath<t.LabeledStatement> | NodePath<t.LogicalExpression> | NodePath<t.MemberExpression> | NodePath<t.MetaProperty> | NodePath<t.MixedTypeAnnotation> | NodePath<t.ModuleExpression> | NodePath<t.NewExpression> | NodePath<t.NullLiteral> | NodePath<t.NullLiteralTypeAnnotation> | NodePath<t.NullableTypeAnnotation> | NodePath<t.NumberLiteral> | NodePath<t.NumberLiteralTypeAnnotation> | NodePath<t.NumberTypeAnnotation> | NodePath<t.NumericLiteral> | NodePath<t.ObjectExpression> | NodePath<t.ObjectMethod> | NodePath<t.ObjectPattern> | NodePath<t.ObjectProperty> | NodePath<t.ObjectTypeAnnotation> | NodePath<t.ObjectTypeCallProperty> | NodePath<t.ObjectTypeIndexer> | NodePath<t.ObjectTypeInternalSlot> | NodePath<t.ObjectTypeProperty> | NodePath<t.ObjectTypeSpreadProperty> | NodePath<t.OpaqueType> | NodePath<t.OptionalCallExpression> | NodePath<t.OptionalIndexedAccessType> | NodePath<t.OptionalMemberExpression> | NodePath<t.ParenthesizedExpression> | NodePath<t.PipelineBareFunction> | NodePath<t.PipelinePrimaryTopicReference> | NodePath<t.PipelineTopicExpression> | NodePath<t.Placeholder> | NodePath<t.PrivateName> | NodePath<t.Program> | NodePath<t.QualifiedTypeIdentifier> | NodePath<t.RecordExpression> | NodePath<t.RegExpLiteral> | NodePath<t.RegexLiteral> | NodePath<t.RestElement> | NodePath<t.RestProperty> | NodePath<t.ReturnStatement> | NodePath<t.SequenceExpression> | NodePath<t.SpreadElement> | NodePath<t.SpreadProperty> | NodePath<t.StaticBlock> | NodePath<t.StringLiteral> | NodePath<t.StringLiteralTypeAnnotation> | NodePath<t.StringTypeAnnotation> | NodePath<t.Super> | NodePath<t.SwitchCase> | NodePath<t.SwitchStatement> | NodePath<t.SymbolTypeAnnotation> | NodePath<t.TSAnyKeyword> | NodePath<t.TSArrayType> | NodePath<t.TSAsExpression> | NodePath<t.TSBigIntKeyword> | NodePath<t.TSBooleanKeyword> | NodePath<t.TSCallSignatureDeclaration> | NodePath<t.TSConditionalType> | NodePath<t.TSConstructSignatureDeclaration> | NodePath<t.TSConstructorType> | NodePath<t.TSDeclareFunction> | NodePath<t.TSDeclareMethod> | NodePath<t.TSEnumDeclaration> | NodePath<t.TSEnumMember> | NodePath<t.TSExportAssignment> | NodePath<t.TSExpressionWithTypeArguments> | NodePath<t.TSExternalModuleReference> | NodePath<t.TSFunctionType> | NodePath<t.TSImportEqualsDeclaration> | NodePath<t.TSImportType> | NodePath<t.TSIndexSignature> | NodePath<t.TSIndexedAccessType> | NodePath<t.TSInferType> | NodePath<t.TSInstantiationExpression> | NodePath<t.TSInterfaceBody> | NodePath<t.TSInterfaceDeclaration> | NodePath<t.TSIntersectionType> | NodePath<t.TSIntrinsicKeyword> | NodePath<t.TSLiteralType> | NodePath<t.TSMappedType> | NodePath<t.TSMethodSignature> | NodePath<t.TSModuleBlock> | NodePath<t.TSModuleDeclaration> | NodePath<t.TSNamedTupleMember> | NodePath<t.TSNamespaceExportDeclaration> | NodePath<t.TSNeverKeyword> | NodePath<t.TSNonNullExpression> | NodePath<t.TSNullKeyword> | NodePath<t.TSNumberKeyword> | NodePath<t.TSObjectKeyword> | NodePath<t.TSOptionalType> | NodePath<t.TSParameterProperty> | NodePath<t.TSParenthesizedType> | NodePath<t.TSPropertySignature> | NodePath<t.TSQualifiedName> | NodePath<t.TSRestType> | NodePath<t.TSSatisfiesExpression> | NodePath<t.TSStringKeyword> | NodePath<t.TSSymbolKeyword> | NodePath<t.TSThisType> | NodePath<t.TSTupleType> | NodePath<t.TSTypeAliasDeclaration> | NodePath<t.TSTypeAnnotation> | NodePath<t.TSTypeAssertion> | NodePath<t.TSTypeLiteral> | NodePath<t.TSTypeOperator> | NodePath<t.TSTypeParameter> | NodePath<t.TSTypeParameterDeclaration> | NodePath<t.TSTypeParameterInstantiation> | NodePath<t.TSTypePredicate> | NodePath<t.TSTypeQuery> | NodePath<t.TSTypeReference> | NodePath<t.TSUndefinedKeyword> | NodePath<t.TSUnionType> | NodePath<t.TSUnknownKeyword> | NodePath<t.TSVoidKeyword> | NodePath<t.TaggedTemplateExpression> | NodePath<t.TemplateElement> | NodePath<t.TemplateLiteral> | NodePath<t.ThisExpression> | NodePath<t.ThisTypeAnnotation> | NodePath<t.ThrowStatement> | NodePath<t.TopicReference> | NodePath<t.TryStatement> | NodePath<t.TupleExpression> | NodePath<t.TupleTypeAnnotation> | NodePath<t.TypeAlias> | NodePath<t.TypeAnnotation> | NodePath<t.TypeCastExpression> | NodePath<t.TypeParameter> | NodePath<t.TypeParameterDeclaration> | NodePath<t.TypeParameterInstantiation> | NodePath<t.TypeofTypeAnnotation> | NodePath<t.UnaryExpression> | NodePath<t.UnionTypeAnnotation> | NodePath<t.UpdateExpression> | NodePath<t.V8IntrinsicIdentifier> | NodePath<t.VariableDeclaration> | NodePath<t.VariableDeclarator> | NodePath<t.Variance> | NodePath<t.VoidTypeAnnotation> | NodePath<t.WhileStatement> | NodePath<t.WithStatement> | NodePath<t.YieldExpression>)[];
1191
1181
  declare function pushContainer<P extends NodePath_Final, K extends string & keyof P["node"]>(this: P, listKey: K, nodes: P["node"][K] extends (infer E)[] ? E | E[] : never): NodePath_Final[];
1192
1182
  /**
@@ -1221,8 +1211,7 @@ declare function get<T extends NodePath_Final, K extends keyof T["node"]>(this:
1221
1211
  declare function get<T extends NodePath_Final, K extends string>(this: T, key: K, context?: boolean | TraversalContext): T extends any ? ToNodePath<Trav<T["node"], Split<K>>> : never;
1222
1212
  declare function get(this: NodePath_Final, key: string, context?: true | TraversalContext): NodePath_Final | NodePath_Final[];
1223
1213
 
1224
- declare function _getKey<T extends t.Node>(this: NodePath_Final<T>, key: keyof T & string, context?: TraversalContext): NodePath_Final | NodePath_Final[];
1225
- declare function _getPattern(this: NodePath_Final, parts: string[], context?: TraversalContext): NodePath_Final | NodePath_Final[];
1214
+ declare function getAssignmentIdentifiers(this: NodePath_Final): Record<string, t.Identifier>;
1226
1215
  declare function getBindingIdentifiers(duplicates: true): Record<string, t.Identifier[]>;
1227
1216
  declare function getBindingIdentifiers(duplicates?: false): Record<string, t.Identifier>;
1228
1217
  declare function getBindingIdentifiers(duplicates: boolean): Record<string, t.Identifier[] | t.Identifier>;
@@ -3354,7 +3343,6 @@ declare const methods: {
3354
3343
  isDescendant: typeof isDescendant;
3355
3344
  inType: typeof inType;
3356
3345
  getTypeAnnotation: typeof getTypeAnnotation;
3357
- _getTypeAnnotation: typeof _getTypeAnnotation;
3358
3346
  isBaseType: typeof isBaseType;
3359
3347
  couldBeBaseType: typeof couldBeBaseType;
3360
3348
  baseTypeStrictlyMatches: typeof baseTypeStrictlyMatches;
@@ -3362,7 +3350,6 @@ declare const methods: {
3362
3350
  replaceWithMultiple: typeof replaceWithMultiple;
3363
3351
  replaceWithSourceString: typeof replaceWithSourceString;
3364
3352
  replaceWith: typeof replaceWith;
3365
- _replaceWith: typeof _replaceWith;
3366
3353
  replaceExpressionWithStatements: typeof replaceExpressionWithStatements;
3367
3354
  replaceInline: typeof replaceInline;
3368
3355
  evaluateTruthy: typeof evaluateTruthy;
@@ -3371,6 +3358,8 @@ declare const methods: {
3371
3358
  ensureBlock: typeof ensureBlock;
3372
3359
  unwrapFunctionEnvironment: typeof unwrapFunctionEnvironment;
3373
3360
  arrowFunctionToExpression: typeof arrowFunctionToExpression;
3361
+ splitExportDeclaration: typeof splitExportDeclaration;
3362
+ ensureFunctionName: typeof ensureFunctionName;
3374
3363
  matchesPattern: typeof matchesPattern;
3375
3364
  has: typeof has;
3376
3365
  isStatic: typeof isStatic;
@@ -3387,11 +3376,9 @@ declare const methods: {
3387
3376
  willIMaybeExecuteBefore: typeof willIMaybeExecuteBefore;
3388
3377
  _guessExecutionStatusRelativeTo: typeof _guessExecutionStatusRelativeTo;
3389
3378
  resolve: typeof resolve;
3390
- _resolve: typeof _resolve;
3391
3379
  isConstantExpression: typeof isConstantExpression;
3392
3380
  isInStrictMode: typeof isInStrictMode;
3393
3381
  call: typeof call;
3394
- _call: typeof _call;
3395
3382
  isDenylisted: typeof isDenylisted;
3396
3383
  isBlacklisted: typeof isDenylisted;
3397
3384
  visit: typeof visit;
@@ -3401,29 +3388,16 @@ declare const methods: {
3401
3388
  setScope: typeof setScope;
3402
3389
  setContext: typeof setContext;
3403
3390
  resync: typeof resync;
3404
- _resyncParent: typeof _resyncParent;
3405
- _resyncKey: typeof _resyncKey;
3406
- _resyncList: typeof _resyncList;
3407
- _resyncRemoved: typeof _resyncRemoved;
3408
3391
  popContext: typeof popContext;
3409
3392
  pushContext: typeof pushContext;
3410
3393
  setup: typeof setup;
3411
3394
  setKey: typeof setKey;
3412
3395
  requeue: typeof requeue;
3413
- _getQueueContexts: typeof _getQueueContexts;
3396
+ requeueComputedKeyAndDecorators: typeof requeueComputedKeyAndDecorators;
3414
3397
  remove: typeof remove;
3415
- _removeFromScope: typeof _removeFromScope;
3416
- _callRemovalHooks: typeof _callRemovalHooks;
3417
- _remove: typeof _remove;
3418
- _markRemoved: typeof _markRemoved;
3419
- _assertUnremoved: typeof _assertUnremoved;
3420
3398
  insertBefore: typeof insertBefore;
3421
- _containerInsert: typeof _containerInsert;
3422
- _containerInsertBefore: typeof _containerInsertBefore;
3423
- _containerInsertAfter: typeof _containerInsertAfter;
3424
3399
  insertAfter: typeof insertAfter;
3425
3400
  updateSiblingKeys: typeof updateSiblingKeys;
3426
- _verifyNodeList: typeof _verifyNodeList;
3427
3401
  unshiftContainer: typeof unshiftContainer;
3428
3402
  pushContainer: typeof pushContainer;
3429
3403
  hoist: typeof hoist;
@@ -3435,8 +3409,7 @@ declare const methods: {
3435
3409
  getAllNextSiblings: typeof getAllNextSiblings;
3436
3410
  getAllPrevSiblings: typeof getAllPrevSiblings;
3437
3411
  get: typeof get;
3438
- _getKey: typeof _getKey;
3439
- _getPattern: typeof _getPattern;
3412
+ getAssignmentIdentifiers: typeof getAssignmentIdentifiers;
3440
3413
  getBindingIdentifiers: typeof getBindingIdentifiers;
3441
3414
  getOuterBindingIdentifiers: typeof getOuterBindingIdentifiers;
3442
3415
  getBindingIdentifierPaths: typeof getBindingIdentifierPaths;
@@ -3556,12 +3529,14 @@ declare function explode$1<S>(visitor: Visitor<S>): ExplodedVisitor<S>;
3556
3529
  declare function verify$1(visitor: Visitor): void;
3557
3530
  declare function merge<State>(visitors: Visitor<State>[]): ExplodedVisitor<State>;
3558
3531
  declare function merge(visitors: Visitor<unknown>[], states?: any[], wrapper?: Function | null): ExplodedVisitor<unknown>;
3532
+ declare function environmentVisitor<S>(visitor: Visitor<S>): Visitor<S>;
3559
3533
 
3560
3534
  type __visitors_ts_VisitWrapper<S = any> = VisitWrapper<S>;
3535
+ declare const __visitors_ts_environmentVisitor: typeof environmentVisitor;
3561
3536
  declare const __visitors_ts_isExplodedVisitor: typeof isExplodedVisitor;
3562
3537
  declare const __visitors_ts_merge: typeof merge;
3563
3538
  declare namespace __visitors_ts {
3564
- export { type __visitors_ts_VisitWrapper as VisitWrapper, explode$1 as explode, __visitors_ts_isExplodedVisitor as isExplodedVisitor, __visitors_ts_merge as merge, verify$1 as verify };
3539
+ export { type __visitors_ts_VisitWrapper as VisitWrapper, __visitors_ts_environmentVisitor as environmentVisitor, explode$1 as explode, __visitors_ts_isExplodedVisitor as isExplodedVisitor, __visitors_ts_merge as merge, verify$1 as verify };
3565
3540
  }
3566
3541
 
3567
3542
  type TraverseOptions<S = t.Node> = {
@@ -3578,10 +3553,10 @@ declare namespace traverse {
3578
3553
  var verify: typeof verify$1;
3579
3554
  var explode: typeof explode$1;
3580
3555
  var cheap: (node: t.Node, enter: (node: t.Node) => void) => void;
3581
- var node: (node: t.Node, opts: ExplodedTraverseOptions<t.Node>, scope?: Scope, state?: any, path?: NodePath_Final, skipKeys?: Record<string, boolean>) => void;
3556
+ var node: (node: t.Node, opts: ExplodedTraverseOptions, scope?: Scope, state?: any, path?: NodePath_Final, skipKeys?: Record<string, boolean>) => void;
3582
3557
  var clearNode: (node: t.Node, opts?: RemovePropertiesOptions) => void;
3583
3558
  var removeProperties: (tree: t.Node, opts?: RemovePropertiesOptions) => t.Node;
3584
- var hasType: (tree: t.Node, type: "StringLiteral" | "NumericLiteral" | "JSXText" | "JSXIdentifier" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayExpression" | "ArrayPattern" | "ArrayTypeAnnotation" | "ArrowFunctionExpression" | "AssignmentExpression" | "AssignmentPattern" | "AwaitExpression" | "BigIntLiteral" | "BinaryExpression" | "BindExpression" | "BlockStatement" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CallExpression" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassExpression" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "ConditionalExpression" | "ContinueStatement" | "DebuggerStatement" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "ExpressionStatement" | "File" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "FunctionDeclaration" | "FunctionExpression" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "Identifier" | "IfStatement" | "Import" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportExpression" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXFragment" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "LabeledStatement" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "MixedTypeAnnotation" | "ModuleExpression" | "NewExpression" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "ObjectExpression" | "ObjectMethod" | "ObjectPattern" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "Program" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "RestElement" | "RestProperty" | "ReturnStatement" | "SequenceExpression" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "Super" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TaggedTemplateExpression" | "TemplateElement" | "TemplateLiteral" | "ThisExpression" | "ThisTypeAnnotation" | "ThrowStatement" | "TopicReference" | "TryStatement" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnaryExpression" | "UnionTypeAnnotation" | "UpdateExpression" | "V8IntrinsicIdentifier" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation" | "WhileStatement" | "WithStatement" | "YieldExpression", denylistTypes?: string[]) => boolean;
3559
+ var hasType: (tree: t.Node, type: t.Node["type"], denylistTypes?: Array<string>) => boolean;
3585
3560
  var cache: typeof __cache_ts;
3586
3561
  }
3587
3562