From 39e43128760eb4f510184c83a7a7476e8a81dbb3 Mon Sep 17 00:00:00 2001 From: cybice Date: Wed, 16 Aug 2017 23:44:38 +0300 Subject: [PATCH] Update typings based on flow v0.53 changes --- types/flow-example/.flowconfig | 4 +++- types/flow-example/flow-typed/react-motion.js | 9 +++++++++ types/flow-example/package.json | 2 +- types/flow-example/yarn.lock | 6 +++--- types/flow-typed/.flowconfig | 2 +- types/flow-typed/package.json | 2 +- .../recompose_v0.24.x.js | 19 ++++++++----------- .../test_branch.js | 0 .../test_componentFromStream.js | 0 .../test_createEventHandler.js | 0 .../test_defaultProps.js | 0 .../test_getContext.js | 0 .../test_mapProps.js | 0 .../test_mapPropsStream.js | 0 .../test_onlyUpdateForKeys.js | 0 .../test_onlyUpdateForPropTypes.js | 0 .../test_pure.js | 0 .../test_shouldUpdate.js | 0 .../test_statics.js | 0 .../test_toClass.js | 0 .../test_utils.js | 0 .../test_voodoo.js | 0 .../test_withContext.js | 0 .../test_withHandlers.js | 0 .../test_withProps.js | 0 .../test_withPropsOnChange.js | 0 .../test_withStateHandlers.js | 0 types/flow-typed/yarn.lock | 6 +++--- 28 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 types/flow-example/flow-typed/react-motion.js rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/recompose_v0.24.x.js (96%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_branch.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_componentFromStream.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_createEventHandler.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_defaultProps.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_getContext.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_mapProps.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_mapPropsStream.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_onlyUpdateForKeys.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_onlyUpdateForPropTypes.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_pure.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_shouldUpdate.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_statics.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_toClass.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_utils.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_voodoo.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_withContext.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_withHandlers.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_withProps.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_withPropsOnChange.js (100%) rename types/flow-typed/recompose_v0.24.x/{flow_v0.49.x- => flow_v0.53.x-}/test_withStateHandlers.js (100%) diff --git a/types/flow-example/.flowconfig b/types/flow-example/.flowconfig index 6f39ca17..405a3f48 100644 --- a/types/flow-example/.flowconfig +++ b/types/flow-example/.flowconfig @@ -1,10 +1,12 @@ [ignore] .*/node_modules/eslint-plugin-jsx-a11y/.* +# TODO: remove after react-motion will be updated with new flow typedefs +.*/node_modules/react-motion/lib/* [include] [libs] -../flow-typed/recompose_v0.24.x/flow_v0.49.x-/recompose_v0.24.x.js +../flow-typed/recompose_v0.24.x/flow_v0.53.x-/recompose_v0.24.x.js [options] suppress_comment=\\(.\\|\n\\)*\\$ExpectError diff --git a/types/flow-example/flow-typed/react-motion.js b/types/flow-example/flow-typed/react-motion.js new file mode 100644 index 00000000..77cf0a96 --- /dev/null +++ b/types/flow-example/flow-typed/react-motion.js @@ -0,0 +1,9 @@ +// TODO: remove after react-motion will be updated with new flow typedefs +declare module 'react-motion' { + declare export function spring( + val: number, + config?: A + ): { val: number, ...$Exact } + + declare export var TransitionMotion: React$ComponentType<{ styles: any }> +} diff --git a/types/flow-example/package.json b/types/flow-example/package.json index 784720ff..5500129b 100644 --- a/types/flow-example/package.json +++ b/types/flow-example/package.json @@ -5,7 +5,7 @@ "dependencies": { "change-emitter": "^0.1.6", "flow": "^0.2.3", - "flow-bin": "^0.52.0", + "flow-bin": "^0.53.0", "glamor": "^3.0.0-3", "glamor-reset": "^3.0.0-2", "hoist-non-react-statics": "^2.0.0", diff --git a/types/flow-example/yarn.lock b/types/flow-example/yarn.lock index 08c2b00f..eb74958f 100644 --- a/types/flow-example/yarn.lock +++ b/types/flow-example/yarn.lock @@ -2536,9 +2536,9 @@ flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" -flow-bin@^0.52.0: - version "0.52.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.52.0.tgz#b6d9abe8bcd1ee5c62df386451a4e2553cadc3a3" +flow-bin@^0.53.0: + version "0.53.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.53.0.tgz#f7830e609ca02b12db4127114213cccc7c0771b9" flow@^0.2.3: version "0.2.3" diff --git a/types/flow-typed/.flowconfig b/types/flow-typed/.flowconfig index fb202c49..fe69f787 100644 --- a/types/flow-typed/.flowconfig +++ b/types/flow-typed/.flowconfig @@ -3,7 +3,7 @@ [include] [libs] -../flow-typed/recompose_v0.24.x/flow_v0.49.x-/recompose_v0.24.x.js +../flow-typed/recompose_v0.24.x/flow_v0.53.x-/recompose_v0.24.x.js [options] suppress_comment=\\(.\\|\n\\)*\\$ExpectError diff --git a/types/flow-typed/package.json b/types/flow-typed/package.json index 11879fc1..a355eca6 100644 --- a/types/flow-typed/package.json +++ b/types/flow-typed/package.json @@ -5,7 +5,7 @@ "author": "istarkov@gmail.com", "license": "MIT", "devDependencies": { - "flow-bin": "^0.52.0", + "flow-bin": "^0.53.0", "prop-types": "^15.5.10", "rxjs": "^5.4.2" }, diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/recompose_v0.24.x.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/recompose_v0.24.x.js similarity index 96% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/recompose_v0.24.x.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/recompose_v0.24.x.js index f0b0473c..165ee918 100644 --- a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/recompose_v0.24.x.js +++ b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/recompose_v0.24.x.js @@ -62,10 +62,6 @@ declare module 'recompose' { v: (props: Enhanced) => V ) => V - declare type FunctionComponent = (props: A) => ?React$Element - - declare type ClassComponent = Class> - declare type UnaryFn = (a: A) => R declare type Compose = (( @@ -130,9 +126,7 @@ declare module 'recompose' { // Public declarations // ----------------------------------------------------------------- - declare export type Component = - | FunctionComponent - | ClassComponent + declare export type Component = React$ComponentType declare export type HOC = UnaryFn< Component, @@ -314,12 +308,12 @@ declare module 'recompose' { declare export function createEagerElement( type: Component | string, props: ?A, - children?: ?ReactNode + children?: ?React$Node ): React$Element declare export function createEagerFactory( type: Component | string - ): (props: ?A, children?: ?ReactNode) => React$Element + ): (props: ?A, children?: ?React$Node) => React$Element declare export function createSink( callback: (props: A) => void @@ -335,7 +329,10 @@ declare module 'recompose' { declare export function componentFromStream( (props$: any) => any - ): T => React.Element<*> + ): T => React$Element - declare export function createEventHandler(): { stream: any, handler: Function } + declare export function createEventHandler(): { + stream: any, + handler: Function, + } } diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_branch.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_branch.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_branch.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_branch.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_componentFromStream.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_componentFromStream.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_componentFromStream.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_componentFromStream.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_createEventHandler.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_createEventHandler.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_createEventHandler.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_createEventHandler.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_defaultProps.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_defaultProps.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_defaultProps.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_defaultProps.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_getContext.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_getContext.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_getContext.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_getContext.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_mapProps.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_mapProps.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_mapProps.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_mapProps.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_mapPropsStream.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_mapPropsStream.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_mapPropsStream.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_mapPropsStream.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_onlyUpdateForKeys.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_onlyUpdateForKeys.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_onlyUpdateForKeys.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_onlyUpdateForKeys.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_onlyUpdateForPropTypes.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_onlyUpdateForPropTypes.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_onlyUpdateForPropTypes.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_onlyUpdateForPropTypes.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_pure.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_pure.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_pure.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_pure.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_shouldUpdate.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_shouldUpdate.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_shouldUpdate.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_shouldUpdate.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_statics.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_statics.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_statics.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_statics.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_toClass.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_toClass.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_toClass.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_toClass.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_utils.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_utils.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_utils.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_utils.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_voodoo.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_voodoo.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_voodoo.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_voodoo.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withContext.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withContext.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withContext.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withContext.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withHandlers.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withHandlers.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withHandlers.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withHandlers.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withProps.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withProps.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withProps.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withProps.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withPropsOnChange.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withPropsOnChange.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withPropsOnChange.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withPropsOnChange.js diff --git a/types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withStateHandlers.js b/types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withStateHandlers.js similarity index 100% rename from types/flow-typed/recompose_v0.24.x/flow_v0.49.x-/test_withStateHandlers.js rename to types/flow-typed/recompose_v0.24.x/flow_v0.53.x-/test_withStateHandlers.js diff --git a/types/flow-typed/yarn.lock b/types/flow-typed/yarn.lock index 0b40b760..422f8b78 100644 --- a/types/flow-typed/yarn.lock +++ b/types/flow-typed/yarn.lock @@ -28,9 +28,9 @@ fbjs@^0.8.9: setimmediate "^1.0.5" ua-parser-js "^0.7.9" -flow-bin@^0.52.0: - version "0.52.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.52.0.tgz#b6d9abe8bcd1ee5c62df386451a4e2553cadc3a3" +flow-bin@^0.53.0: + version "0.53.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.53.0.tgz#f7830e609ca02b12db4127114213cccc7c0771b9" iconv-lite@~0.4.13: version "0.4.18"