Skip to content

Commit

Permalink
flow: Add types for the config object
Browse files Browse the repository at this point in the history
Fixes Flow complaining about config.startup.notification
  • Loading branch information
borisyankov committed Mar 29, 2018
1 parent a2fc51b commit 924bdee
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,34 @@
import { NativeModules } from 'react-native';
import DeviceInfo from 'react-native-device-info';

import type { Narrow, Notification } from './types';

const isDevelopment = process.env.NODE_ENV === 'development';
const isEmulator = NativeModules.RNDeviceInfo ? DeviceInfo.isEmulator() : false;

export default {
type Config = {
startup: {
narrow: ?Narrow,
anchor: number,
notification: ?Notification,
},
compatibilityUrl: string,
messagesPerRequest: number,
scrollCallbackThrottle: number,
messageListThreshold: number,
enableReduxLogging: boolean,
enableReduxSlowReducerWarnings: boolean,
enableSentry: boolean,
enableWebViewErrorDisplay: boolean,
enableNotifications: boolean,
slowReducersThreshold: number,
sentryKey: string,
enableErrorConsoleLogging: boolean,
trackServerEvents: string[],
serverDataOnStartup: string[],
};

const config: Config = {
startup: {
narrow: undefined,
anchor: 0,
Expand Down Expand Up @@ -60,3 +84,5 @@ export default {
'update_message_flags',
],
};

export default config;

0 comments on commit 924bdee

Please sign in to comment.