,
+ [[call]]: >(C) => StyledComponentType
+ };
+}
+
+
+
+declare module 'styled-components/native' {
+
+ declare export type Interpolation =
+ | ((executionContext: P) => string)
+ | CSSRules
+ | KeyFrames
+ | string
+ | number
+
+
+ declare export type CSSRules = Interpolation[]
+
+ // This is not exported on purpose, since it's an implementation detail
+ declare type TaggedTemplateLiteral = (strings : string[], ...interpolations : Interpolation[]) => R
+
+ declare export type CSSConstructor = TaggedTemplateLiteral
+ declare export type KeyFramesConstructor = TaggedTemplateLiteral
+ declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral>
+
+ declare interface Tag {
+ styleTag: HTMLStyleElement | null;
+ getIds(): string[];
+ hasNameForId(id: string, name: string): boolean;
+ insertMarker(id: string): T;
+ insertRules(id: string, cssRules: string[], name: ?string): void;
+ removeRules(id: string): void;
+ css(): string;
+ toHTML(additionalAttrs: ?string): string;
+ toElement(): React$Element<*>;
+ clone(): Tag;
+ sealed: boolean;
+ }
+
+ // The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over
+ declare export class StyleSheet {
+ static get master() : StyleSheet;
+ static get instance() : StyleSheet;
+ static reset(forceServer? : boolean) : void;
+
+ id : number;
+ forceServer : boolean;
+ target : ?HTMLElement;
+ tagMap : {[string]: Tag}; // eslint-disable-line flowtype/no-weak-types
+ deferred: { [string]: string[] | void };
+ rehydratedNames: { [string]: boolean };
+ ignoreRehydratedNames: { [string]: boolean };
+ tags: Tag[]; // eslint-disable-line flowtype/no-weak-types
+ importRuleTag: Tag; // eslint-disable-line flowtype/no-weak-types
+ capacity: number;
+ clones: StyleSheet[];
+
+ constructor(?HTMLElement) : this;
+ rehydrate() : this;
+ clone() : StyleSheet;
+ sealAllTags() : void;
+ makeTag(tag : ?Tag) : Tag; // eslint-disable-line flowtype/no-weak-types
+ getImportRuleTag() : Tag; // eslint-disable-line flowtype/no-weak-types
+ getTagForId(id : string): Tag; // eslint-disable-line flowtype/no-weak-types
+ hasId(id: string) : boolean;
+ hasNameForId(id: string, name: string) : boolean;
+ deferredInject(id : string, cssRules : string[]) : void;
+ inject(id: string, cssRules : string[], name? : string) : void;
+ remove(id : string) : void;
+ toHtml() : string;
+ toReactElements() : React$ElementType[];
+ }
+
+ declare export class KeyFrames {
+ id : string;
+ name : string;
+ rules : string[];
+
+ constructor(name : string, rules : string[]) : this;
+ inject(StyleSheet) : void;
+ toString() : string;
+ getName() : string;
+ }
+
+ // I think any is appropriate here?
+ // eslint-disable-next-line flowtype/no-weak-types
+ declare export type Theme = {+[string] : any}
+
+ declare export var css : CSSConstructor;
+ declare export var keyframes : KeyFramesConstructor;
+ declare export var createGlobalStyle : CreateGlobalStyleConstructor
+ declare export var ThemeProvider : React$ComponentType<{children?: ?React$Node, theme : Theme | (Theme) => Theme}>
+
+ // This is a bit hard to read. Not sure how to make it more readable. I think adding line-breaks makes it worse.
+ declare type InjectedProps = { theme : Theme | void }
+ declare export function withTheme>(WrappedComponent: Component) : React$ComponentType<$Diff>, InjectedProps>>;
+
+
+ // @HACK This is a cheat to hide that the underlying type is "just a string"
+ // once we know of a better way, we should be able to update this accordingly.
+ // I don't think there _is_ a good way, currently.
+ // @NOTE Also not too sure about the naming of this...
+ declare export type StyledElementType = T;
+ declare export type StyledComponentType = {
+ [[call]]: TaggedTemplateLiteral,
+ +attrs: (attributes: A) => TaggedTemplateLiteral, A>>>
+ };
+
+ declare type StyledComponentList = {
+ ActivityIndicator: StyledComponentType>,
+ ActivityIndicatorIOS: StyledComponentType>,
+ ART: StyledComponentType>,
+ Button: StyledComponentType>,
+ DatePickerIOS: StyledComponentType>,
+ DrawerLayoutAndroid: StyledComponentType>,
+ Image: StyledComponentType>,
+ ImageBackground: StyledComponentType>,
+ ImageEditor: StyledComponentType>,
+ ImageStore: StyledComponentType>,
+ KeyboardAvoidingView: StyledComponentType>,
+ ListView: StyledComponentType>,
+ MapView: StyledComponentType>,
+ Modal: StyledComponentType>,
+ NavigatorIOS: StyledComponentType>,
+ Picker: StyledComponentType>,
+ PickerIOS: StyledComponentType>,
+ ProgressBarAndroid: StyledComponentType>,
+ ProgressViewIOS: StyledComponentType>,
+ ScrollView: StyledComponentType>,
+ SegmentedControlIOS: StyledComponentType>,
+ Slider: StyledComponentType>,
+ SliderIOS: StyledComponentType>,
+ SnapshotViewIOS: StyledComponentType>,
+ Switch: StyledComponentType>,
+ RecyclerViewBackedScrollView: StyledComponentType>,
+ RefreshControl: StyledComponentType>,
+ SafeAreaView: StyledComponentType>,
+ StatusBar: StyledComponentType>,
+ SwipeableListView: StyledComponentType>,
+ SwitchAndroid: StyledComponentType>,
+ SwitchIOS: StyledComponentType>,
+ TabBarIOS: StyledComponentType>,
+ Text: StyledComponentType>,
+ TextInput: StyledComponentType>,
+ ToastAndroid: StyledComponentType>,
+ ToolbarAndroid: StyledComponentType>,
+ Touchable: StyledComponentType>,
+ TouchableHighlight: StyledComponentType>,
+ TouchableNativeFeedback: StyledComponentType>,
+ TouchableOpacity: StyledComponentType>,
+ TouchableWithoutFeedback: StyledComponentType>,
+ View: StyledComponentType>,
+ ViewPagerAndroid: StyledComponentType>,
+ WebView: StyledComponentType>,
+ FlatList: StyledComponentType>,
+ SectionList: StyledComponentType>,
+ VirtualizedList: StyledComponentType>,
+ }
+
+ declare export default StyledComponentList & {
+ [[call]]: (S) => $ElementType,
+ [[call]]: >(C) => StyledComponentType
+ };
+}
diff --git a/package.json b/package.json
index e98bf2c..0376246 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,7 @@
"redux-thunk": "^2.3.0",
"sequelize": "^4.43.0",
"socket.io": "^2.2.0",
+ "styled-components": "^4.1.3",
"superagent": "^4.1.0",
"uuid": "^3.3.2"
},
@@ -58,6 +59,7 @@
"@babel/preset-env": "^7.3.4",
"@babel/preset-flow": "^7.0.0",
"babel-eslint": "^10.0.1",
+ "babel-plugin-styled-components": "^1.10.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"chokidar": "^2.1.2",
"eslint-plugin-flowtype": "^3.4.2",
diff --git a/yarn.lock b/yarn.lock
index d8f4fc3..4a304b4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1013,6 +1013,18 @@
dependencies:
"@emotion/memoize" "^0.6.6"
+"@emotion/is-prop-valid@^0.7.3":
+ version "0.7.3"
+ resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.7.3.tgz#a6bf4fa5387cbba59d44e698a4680f481a8da6cc"
+ integrity sha512-uxJqm/sqwXw3YPA5GXX365OBcJGFtxUVkB6WyezqFHlNe9jqUWH5ur2O2M8dGBz61kn1g3ZBlzUunFQXQIClhA==
+ dependencies:
+ "@emotion/memoize" "0.7.1"
+
+"@emotion/memoize@0.7.1":
+ version "0.7.1"
+ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.1.tgz#e93c13942592cf5ef01aa8297444dc192beee52f"
+ integrity sha512-Qv4LTqO11jepd5Qmlp3M1YEjBumoTHcHFdgPTQ+sFlIL5myi/7xu/POwP7IRu6odBdmLXdtIs1D6TuW6kbwbbg==
+
"@emotion/memoize@^0.6.6":
version "0.6.6"
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.6.6.tgz#004b98298d04c7ca3b4f50ca2035d4f60d2eed1b"
@@ -1718,7 +1730,7 @@ babel-plugin-react-require@3.0.0:
resolved "https://registry.yarnpkg.com/babel-plugin-react-require/-/babel-plugin-react-require-3.0.0.tgz#2e4e7b4496b93a654a1c80042276de4e4eeb20e3"
integrity sha1-Lk57RJa5OmVKHIAEInbeTk7rIOM=
-"babel-plugin-styled-components@>= 1":
+"babel-plugin-styled-components@>= 1", babel-plugin-styled-components@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.0.tgz#ff1f42ad2cc78c21f26b62266b8f564dbc862939"
integrity sha512-sQVKG8irFXx14ZfaK1bBePirfkacl3j8nZwSZK+ZjsbnadRHKQTbhXbe/RB1vT6Vgkz45E+V95LBq4KqdhZUNw==
@@ -8058,6 +8070,23 @@ styled-components@4.1.2:
stylis-rule-sheet "^0.0.10"
supports-color "^5.5.0"
+styled-components@^4.1.3:
+ version "4.1.3"
+ resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.1.3.tgz#4472447208e618b57e84deaaeb6acd34a5e0fe9b"
+ integrity sha512-0quV4KnSfvq5iMtT0RzpMGl/Dg3XIxIxOl9eJpiqiq4SrAmR1l1DLzNpMzoy3DyzdXVDMJS2HzROnXscWA3SEw==
+ dependencies:
+ "@babel/helper-module-imports" "^7.0.0"
+ "@emotion/is-prop-valid" "^0.7.3"
+ "@emotion/unitless" "^0.7.0"
+ babel-plugin-styled-components ">= 1"
+ css-to-react-native "^2.2.2"
+ memoize-one "^4.0.0"
+ prop-types "^15.5.4"
+ react-is "^16.6.0"
+ stylis "^3.5.0"
+ stylis-rule-sheet "^0.0.10"
+ supports-color "^5.5.0"
+
styled-jsx@3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-3.2.1.tgz#452051fe50df5e9c7c7f3dd20fa46c3060ac65b0"