@types/react-side-effect
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

Installation

npm install --save @types/react-side-effect

Summary

This package contains type definitions for react-side-effect (https://github.com/gaearon/react-side-effect).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-side-effect.

index.d.ts

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;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Remo H. Jansen, and Martin Charles.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-side-effect

Weekly Downloads

9,635

Version

1.1.4

License

MIT

Unpacked Size

4.64 kB

Total Files

5

Last publish

Collaborators

  • types