feat: expose AnimatedEvent (#22984)

Summary:
Some third party components rely on the `AnimatedEvent` as a type (see https://github.com/kmagiera/react-native-gesture-handler/blob/master/Swipeable.js#L9). In order to not rely on a path which could change at any time it would be great to expose it.

Changelog:
----------

[General][added] - Expose AnimatedEvent
Pull Request resolved: https://github.com/facebook/react-native/pull/22984

Differential Revision: D13682678

Pulled By: cpojer

fbshipit-source-id: 2f2b228e3f49e6afe623fd551220ef2147e79550
This commit is contained in:
Julian Hundeloh
2019-01-16 07:01:30 -08:00
committed by Facebook Github Bot
parent 7d881c1d8a
commit 35e7fdd79d
2 changed files with 6 additions and 1 deletions

View File

@@ -158,7 +158,7 @@ class AnimatedEvent {
};
}
_callListeners(...args) {
_callListeners(...args: any) {
this._listeners.forEach(listener => listener(...args));
}

View File

@@ -685,5 +685,10 @@ module.exports = {
forkEvent,
unforkEvent,
/**
* Expose Event class, so it can be used as a type for type checkers.
*/
Event: AnimatedEvent,
__PropsOnlyForTests: AnimatedProps,
};