The types aren't quite as nice as when providing a string literal like
"div" or "input", but it works as well as it did before the
string-literal-overload change in #17507.
These weak type errors were not caught in TS 2.4 RC. The final TS 2.4
will catch weak type errors with primitives, so this PR fixes those
now-caught errors.
* Fix first round of weak type errors
Done through griddle-react
* 95% done with weak type fixes
* Fix last couple of weak type errors
* Remove some lint from mithril tests
* mithril's Lifecycle is not a weak type any more
Restore the Lifecycle constraints in the rest of the definitions.
* Fix react-redux tests after #16652 broke them
* Remove package-lock.json
The animateTransform SVG element was missing from JSX.IntrinsicElements.
Like the SVG animate element, this will need to be refined when TypeScript's lib.dom.d.ts is updated to include SVGAnimateTransformElement.
ComponentLifecycle is intended to provide some methods to Component
subclasses and enforce that overrides of those methods are correct in
those same subclasses.
However, it does neither of these things as an interface that
Component `implements`. It just checks that Component has all the
required methods of ComponentLifecycle. Since there are no required
methods, the `implements` check passes. And since Component doesn't
actually *implement* any of the methods, its subclasses don't get
them by default, and their 'overrides' are not checked for
correctness.
Changing ComponentLifecycle to a class fixes both of these problems.
* Use specific event type for nativeEvent property
Allows event handlers to fully use the `ev.nativeEvent` property without casting. But it does make the `React.MouseEvent` type slightly more complicated.
* Maintain backwards compatibility of SyntheticEvent type
TypeScript 2.3 should be adding type parameter defaults, which allows the `nativeEvent` property to be made generic but without breaking existing code.
* Override nativeEvent in the more specific event types
Overriding nativeEvent in this way maintains backwards compatibility and doesn't depend on bleeding-edge TypeScript features.