Alias colliding names in Closure Library like goog.ui.Component
Closure Library causes has 18 errors of TS2417 like the following.
TS2417: Class static side 'typeof Container' incorrectly extends base class static side 'typeof Component'.
Types of property 'EventType' are incompatible.
Type 'typeof EventType' is missing the following properties from type 'typeof EventType': ACTION, ACTIVATE, BEFORE_SHOW, BLUR, and 17 more.
https://github.com/teppeis/closure-library.d.ts/blob/master/errors.txt
In ES (TypeScript) classes, static props of classes are inherited to subclasses.
But in Closure, props of constructor function are not inherited.
For example, goog.ui.Component.EventType is a prop of goog.ui.Component, but it's goog.provide'd by itself and not inherited to the subclasses.
This PR aliases classes that has such props and causes the errors. By this change, the props are only imported directory, but not available as static props of classes.
// Good
import EventType from 'goog:goog.ui.Component.EventType';
console.log(EventType);
// Bad
import Component from 'goog:goog.ui.Component';
console.log(Component.EventType);
Rebased on latest master
@rkirov
In fact, I took your cl and removed the list and your test - goog_ui_component, still produced code that is valid TS.
No. This is the generated code and is not valid.
In --partial mode, this problem cannot be resolved on the local knowledge, so whitelist is needed. (How can I refer to extends ಠ_ಠ.clutz.goog.ui.Component__clutz_alias from other file?)
In non-partial mode, I can guess it to a certain extent (1: is a shadowed symbol, 2: is a constructor, 3: has an enum property that is goog.provide'd), but I do not know whether it is correct for all users, so I think that it is better to limit the target area using whitelist. That makes the code simpler.
rebased