Browse Source

ref(ts): Add typings for reflux (#15105)

Evan Purkhiser 5 years ago
parent
commit
cb2b3672d6

+ 1 - 0
package.json

@@ -37,6 +37,7 @@
     "@types/react-router": "^3.0.20",
     "@types/react-sparklines": "^1.7.0",
     "@types/react-virtualized": "^9.20.1",
+    "@types/reflux": "0.4.1",
     "algoliasearch": "^3.32.0",
     "babel-core": "^7.0.0-bridge.0",
     "babel-loader": "^8.0.0",

+ 2 - 2
src/sentry/static/sentry/app/components/assigneeSelector.tsx

@@ -55,8 +55,8 @@ const AssigneeSelectorComponent = createReactClass<Props, State>({
   },
 
   mixins: [
-    Reflux.listenTo(GroupStore, 'onGroupChange'),
-    Reflux.connect(MemberListStore, 'memberList'),
+    Reflux.listenTo(GroupStore, 'onGroupChange') as any,
+    Reflux.connect(MemberListStore, 'memberList') as any,
   ],
 
   getDefaultProps() {

+ 1 - 1
src/sentry/static/sentry/app/components/globalModal.tsx

@@ -95,7 +95,7 @@ class GlobalModal extends React.Component<Props> {
 
 const GlobalModalContainer = createReactClass({
   displayName: 'GlobalModalContainer',
-  mixins: [Reflux.connect(ModalStore, 'modalStore')],
+  mixins: [Reflux.connect(ModalStore, 'modalStore') as any],
 
   getInitialState() {
     return {

+ 2 - 1
src/sentry/static/sentry/app/stores/configStore.tsx

@@ -64,4 +64,5 @@ const ConfigStore = Reflux.createStore({
   },
 });
 
-export default ConfigStore;
+// TODO(ts): This should be properly typed
+export default ConfigStore as any;

+ 2 - 1
src/sentry/static/sentry/app/stores/discoverSavedQueriesStore.tsx

@@ -131,4 +131,5 @@ const DiscoverSavedQueriesStore = Reflux.createStore({
   },
 });
 
-export default DiscoverSavedQueriesStore;
+// TODO(ts): This should be properly typed
+export default DiscoverSavedQueriesStore as any;

+ 2 - 1
src/sentry/static/sentry/app/stores/modalStore.tsx

@@ -35,4 +35,5 @@ const ModalStore = Reflux.createStore({
   },
 });
 
-export default ModalStore;
+// TODO(ts): This should be properly typed
+export default ModalStore as any;

+ 1 - 1
src/sentry/static/sentry/app/utils/withConfig.tsx

@@ -25,7 +25,7 @@ const withConfig = <P extends InjectedConfigProps>(
     State
   >({
     displayName: `withConfig(${getDisplayName(WrappedComponent)})`,
-    mixins: [Reflux.listenTo(ConfigStore, 'onUpdate')],
+    mixins: [Reflux.listenTo(ConfigStore, 'onUpdate') as any],
 
     getInitialState() {
       return {config: ConfigStore.getConfig()};

+ 1 - 1
src/sentry/static/sentry/app/utils/withDiscoverSavedQueries.tsx

@@ -28,7 +28,7 @@ const withDiscoverSavedQueries = <P extends InjectedDiscoverSavedQueriesProps>(
     State
   >({
     displayName: `withDiscoverSavedQuery(${getDisplayName(WrappedComponent)})`,
-    mixins: [Reflux.listenTo(DiscoverSavedQueriesStore, 'onUpdate')],
+    mixins: [Reflux.listenTo(DiscoverSavedQueriesStore, 'onUpdate') as any],
 
     getInitialState() {
       return {

+ 1 - 1
src/sentry/static/sentry/app/utils/withGlobalSelection.tsx

@@ -27,7 +27,7 @@ const withGlobalSelection = <P extends InjectedGlobalSelectionProps>(
     State
   >({
     displayName: `withGlobalSelection(${getDisplayName(WrappedComponent)})`,
-    mixins: [Reflux.listenTo(GlobalSelectionStore, 'onUpdate')],
+    mixins: [Reflux.listenTo(GlobalSelectionStore, 'onUpdate') as any],
 
     getInitialState() {
       return {

+ 1 - 1
src/sentry/static/sentry/app/utils/withLatestContext.tsx

@@ -41,7 +41,7 @@ const withLatestContext = <P extends InjectedLatestContextProps>(
         organization: SentryTypes.Organization,
         organizations: PropTypes.arrayOf(SentryTypes.Organization).isRequired,
       },
-      mixins: [Reflux.connect(LatestContextStore, 'latestContext')],
+      mixins: [Reflux.connect(LatestContextStore, 'latestContext') as any],
 
       render() {
         const {organizations} = this.props;

Some files were not shown because too many files changed in this diff