ExtendTypes

ExtendTypes

This class allows the use of intersection types in oder to define types extensions by transforming the code in two ways:

  1. If one of the types of the intersection uses augments/extends for the intersection type, all its "lines" are moved to the intersection type and it gets removed.
  2. If the first scenario is not possible, it trasforms & into |. Yes, it becomes a union type, but it's as closer as we can get with pure JSDoc.

Constructor

new ExtendTypes(events, EVENT_NAMES)

Source:
Parameters:
Name Type Description
events EventEmitter

To hook to the necessary events to parse the code.

EVENT_NAMES EventNames

To get the name of the events the class needs to listen for.