declare module 'recompose' { import { ComponentLifecycle, ComponentClass, StatelessComponent, ValidationMap } from 'react'; interface ComponentDecorator { (component: ComponentClass | StatelessComponent): ComponentClass; } /** * Decorator that infers the type from the original component * * Can't use the above decorator because it would default the type to {} */ export interface InferableComponentDecorator { | StatelessComponent

)>(component: TComponentConstruct): TComponentConstruct; } export function withContext( childContextTypes: ValidationMap, getChildContext: (props: ComponentOwnProps) => any ): InferableComponentDecorator; export function mapProps( propsMapper: (props: TNeededProps) => TMappedProps ): ComponentDecorator; export function withProps( createProps: (props: TOriginalProps) => TOriginalProps & TOwnProps | TOwnProps ): ComponentDecorator; // export function pure(Cmp): InferableComponentDecorator; export function pure | StatelessComponent

)> (component: TComponentConstruct): TComponentConstruct; export function onlyUpdateForKeys(propKeys: Array): InferableComponentDecorator; export function onlyUpdateForPropTypes(): InferableComponentDecorator; export function setPropTypes( propTypes: ValidationMap ): ComponentDecorator<{}, TOwnProps>; export function getContext( contextTypes: ValidationMap ): ComponentDecorator; export function componentFromProp(propName: string) : ComponentClass; export function defaultProps(props: {}): InferableComponentDecorator; export function withState( stateName: string, stateUpdaterName: string, initialState: (props: Object) => any | any ): ComponentDecorator; type HandlerCreators = { [handlerName: string]: (props: Object) => Function } export function withHandlers( handlerCreators: HandlerCreators ): ComponentDecorator; export function lifecycle(spec: ComponentLifecycle): InferableComponentDecorator; export function compose( ...functions: Array ): ComponentDecorator; /** * Higher-order component version of shouldComponentUpdate(). The test * function accepts both the current props and the next props. */ export function shouldUpdate( test: (props: TProps, nextProps: TProps) => boolean ): ComponentDecorator; }