import * as React from "react" ; import { ActionCreatorsMapObject } from "redux" ; import { DefaultSceneActions } from "../core/types" ; import { ArenaSceneExtraProps , ArenaScene } from "../hocs" ; import { Omit , ActionsProps , SceneBundleNo , SceneBundleNoS , SceneBundleNoA , SceneBundleNoPP , SceneBundleNoAPP , SceneBundleNoSA , SceneBundleNoSPP , SceneBundleNoSAPP } from "./types" ; import { defaultPropsPicker , defaultActions , defaultReducerCreator } from "./autoFill" ; function bundleToComponent < P extends PP , S , A extends ActionCreatorsMapObject , PP > ( bundle , extraProps ? ) ; function bundleToComponent < P extends PP , A extends ActionCreatorsMapObject , PP > ( bundle , extraProps ? ) ; function bundleToComponent < P extends PP , S , PP > ( bundle , extraProps ? ) ; function bundleToComponent < P extends S & ActionsProps < A > , S , A extends ActionCreatorsMapObject > ( bundle , extraProps ? ) ; function bundleToComponent < P extends PP , PP > ( bundle , extraProps ? ) ; function bundleToComponent < P extends ActionsProps < A > , A extends ActionCreatorsMapObject > ( bundle , extraProps ? ) ; function bundleToComponent < P extends S & ActionsProps < DefaultSceneActions < S > > , S > ( bundle , extraProps ? ) ; function bundleToComponent < P extends ActionsProps < DefaultSceneActions < { } > > > ( bundle , extraProps ? ) ; function bundleToComponent ( bundle , extraProps ? ) { let newBundle = Object . assign ( { propsPicker : defaultPropsPicker , actions : defaultActions , reducer : defaultReducerCreator ( bundle . state ) } , bundle ) ; let WrapperClass = props => ( < ArenaScene sceneBundle = { newBundle } sceneProps = { props } { ... extraProps } />); WrapperClass . displayName = "ScenePropsProxy" ; return WrapperClass ; } export default bundleToComponent ;