DefinitelyTyped/types/react-side-effect/index.d.ts
Ferdy Budhidharma bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01:00

35 lines
1.2 KiB
TypeScript

// Type definitions for react-side-effect 1.1
// Project: https://github.com/gaearon/react-side-effect
// Definitions by: Remo H. Jansen <https://github.com/remojansen>
// Martin Charles <https://github.com/0xcaff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
interface WithSideEffect {
<TProp, TState>(
reducePropsToState: (propsList: TProp[]) => TState,
handleStateChangeOnClient: (state: TState) => void
): ClassDecorator<TProp, TState, TState>;
<TProp, TState, TServerState>(
reducePropsToState: (propsList: TProp[]) => TState,
handleStateChangeOnClient: (state: TState) => void,
mapStateOnServer: (state: TState) => TServerState
): ClassDecorator<TProp, TState | TServerState, TServerState>;
}
declare const withSideEffect: WithSideEffect;
type ClassDecorator<TProp, TPeek, TRewind> = (
component: React.ComponentType<TProp>
) => React.ComponentType<TProp> & {
peek: () => TPeek;
rewind: () => TRewind;
};
declare namespace withSideEffect {} // https://github.com/Microsoft/TypeScript/issues/5073
export = withSideEffect;