@@ -191,6 +191,7 @@ namespace ts {
191191 ArrayType ,
192192 TupleType ,
193193 UnionType ,
194+ IntersectionType ,
194195 ParenthesizedType ,
195196 // Binding patterns
196197 ObjectBindingPattern ,
@@ -667,10 +668,14 @@ namespace ts {
667668 elementTypes : NodeArray < TypeNode > ;
668669 }
669670
670- export interface UnionTypeNode extends TypeNode {
671+ export interface UnionOrIntersectionTypeNode extends TypeNode {
671672 types : NodeArray < TypeNode > ;
672673 }
673674
675+ export interface UnionTypeNode extends UnionOrIntersectionTypeNode { }
676+
677+ export interface IntersectionTypeNode extends UnionOrIntersectionTypeNode { }
678+
674679 export interface ParenthesizedTypeNode extends TypeNode {
675680 type : TypeNode ;
676681 }
@@ -1573,7 +1578,7 @@ namespace ts {
15731578 Merged = 0x02000000 , // Merged symbol (created during program binding)
15741579 Transient = 0x04000000 , // Transient symbol (created during type check)
15751580 Prototype = 0x08000000 , // Prototype property (no source representation)
1576- UnionProperty = 0x10000000 , // Property in union type
1581+ SyntheticProperty = 0x10000000 , // Property in union or intersection type
15771582 Optional = 0x20000000 , // Optional property
15781583 ExportStar = 0x40000000 , // Export * declaration
15791584
@@ -1652,7 +1657,7 @@ namespace ts {
16521657 instantiations ?: Map < Type > ; // Instantiations of generic type alias (undefined if non-generic)
16531658 mapper ?: TypeMapper ; // Type mapper for instantiation alias
16541659 referenced ?: boolean ; // True if alias symbol has been referenced as a value
1655- unionType ?: UnionType ; // Containing union type for union property
1660+ containingType ?: UnionOrIntersectionType ; // Containing union or intersection type for synthetic property
16561661 resolvedExports ?: SymbolTable ; // Resolved exports of module
16571662 exportsChecked ?: boolean ; // True if exports of external module have been checked
16581663 isNestedRedeclaration ?: boolean ; // True if symbol is block scoped redeclaration
@@ -1721,17 +1726,18 @@ namespace ts {
17211726 Interface = 0x00000800 , // Interface
17221727 Reference = 0x00001000 , // Generic type reference
17231728 Tuple = 0x00002000 , // Tuple
1724- Union = 0x00004000 , // Union
1725- Anonymous = 0x00008000 , // Anonymous
1726- Instantiated = 0x00010000 , // Instantiated anonymous type
1729+ Union = 0x00004000 , // Union (T | U)
1730+ Intersection = 0x00008000 , // Intersection (T & U)
1731+ Anonymous = 0x00010000 , // Anonymous
1732+ Instantiated = 0x00020000 , // Instantiated anonymous type
17271733 /* @internal */
1728- FromSignature = 0x00020000 , // Created for signature assignment check
1729- ObjectLiteral = 0x00040000 , // Originates in an object literal
1734+ FromSignature = 0x00040000 , // Created for signature assignment check
1735+ ObjectLiteral = 0x00080000 , // Originates in an object literal
17301736 /* @internal */
1731- ContainsUndefinedOrNull = 0x00080000 , // Type is or contains Undefined or Null type
1737+ ContainsUndefinedOrNull = 0x00100000 , // Type is or contains Undefined or Null type
17321738 /* @internal */
1733- ContainsObjectLiteral = 0x00100000 , // Type is or contains object literal type
1734- ESSymbol = 0x00200000 , // Type of symbol primitive introduced in ES6
1739+ ContainsObjectLiteral = 0x00200000 , // Type is or contains object literal type
1740+ ESSymbol = 0x00400000 , // Type of symbol primitive introduced in ES6
17351741
17361742 /* @internal */
17371743 Intrinsic = Any | String | Number | Boolean | ESSymbol | Void | Undefined | Null ,
@@ -1740,6 +1746,8 @@ namespace ts {
17401746 StringLike = String | StringLiteral ,
17411747 NumberLike = Number | Enum ,
17421748 ObjectType = Class | Interface | Reference | Tuple | Anonymous ,
1749+ UnionOrIntersection = Union | Intersection ,
1750+ StructuredType = ObjectType | Union | Intersection ,
17431751 /* @internal */
17441752 RequiresWidening = ContainsUndefinedOrNull | ContainsObjectLiteral
17451753 }
@@ -1799,17 +1807,21 @@ namespace ts {
17991807 baseArrayType : TypeReference ; // Array<T> where T is best common type of element types
18001808 }
18011809
1802- export interface UnionType extends Type {
1810+ export interface UnionOrIntersectionType extends Type {
18031811 types : Type [ ] ; // Constituent types
18041812 /* @internal */
18051813 reducedType : Type ; // Reduced union type (all subtypes removed)
18061814 /* @internal */
18071815 resolvedProperties : SymbolTable ; // Cache of resolved properties
18081816 }
18091817
1818+ export interface UnionType extends UnionOrIntersectionType { }
1819+
1820+ export interface IntersectionType extends UnionOrIntersectionType { }
1821+
18101822 /* @internal */
1811- // Resolved object or union type
1812- export interface ResolvedType extends ObjectType , UnionType {
1823+ // Resolved object, union, or intersection type
1824+ export interface ResolvedType extends ObjectType , UnionOrIntersectionType {
18131825 members : SymbolTable ; // Properties by name
18141826 properties : Symbol [ ] ; // Properties
18151827 callSignatures : Signature [ ] ; // Call signatures of type
0 commit comments