1// Copyright 2020 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5import * as estree from 'estree'; 6 7declare module 'estree' { 8 interface BaseNode { 9 parent: BaseNode|null; 10 start: number; 11 end: number; 12 id?: Node|null; 13 } 14} 15 16declare global { 17 // The @types/estree do not export the types to a namespace. Since we reference 18 // these types as "ESTree.Node", we need to explicitly re-export them here. 19 export namespace ESTree { 20 type ArrayPattern = estree.ArrayPattern; 21 type CatchClause = estree.CatchClause; 22 type Class = estree.Class; 23 type Expression = estree.Expression; 24 type FunctionDeclaration = estree.FunctionDeclaration; 25 type ForStatement = estree.ForStatement; 26 type ForOfStatement = estree.ForOfStatement; 27 type ForInStatement = estree.ForInStatement; 28 type Identifier = estree.Identifier; 29 type IfStatement = estree.IfStatement; 30 type Literal = estree.Literal; 31 type MemberExpression = estree.MemberExpression; 32 type MethodDefinition = estree.MethodDefinition; 33 type Node = estree.Node; 34 type ObjectPattern = estree.ObjectPattern; 35 type Pattern = estree.Pattern; 36 type SimpleLiteral = estree.SimpleLiteral; 37 type TemplateLiteralNode = estree.TemplateLiteral; 38 type TryStatement = estree.TryStatement; 39 type VariableDeclarator = estree.VariableDeclarator; 40 } 41} 42