DefinitelyTyped/types/react-lifecycle-component/index.d.ts
Alexander Fisher 8a155514f4 Add types for react-lifecycle-component (#28635)
Please fill in this template.

- [x] Use a meaningful title for the pull request. Include the name of the package modified.
- [x] Test the change in your own code. (Compile and run.)
- [x] Add or edit tests to reflect the change. (Run with `npm test`.)
- [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).

Select one of these and delete the others:

If adding a new definition:
- [x] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration`
- [x] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
- [x] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [x] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`.
2018-09-10 17:04:18 -07:00

25 lines
951 B
TypeScript

// Type definitions for react-lifecycle-component 2.0
// Project: https://github.com/JamieDixon/react-lifecycle-component
// Definitions by: Alexander Fisher <https://github.com/pixelshaded>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { ComponentLifecycle, Component, ComponentClass } from 'react';
import { Connect } from 'react-redux';
export interface LifecycleStateProps<P = {}, S = {}> {
component: ComponentClass<P, S>;
}
export interface LifecycleDispatchProps<P = {}, S = {}> extends ComponentLifecycle<P, S> {}
export interface Props<P = {}, S = {}> extends LifecycleStateProps<P, S>, LifecycleDispatchProps<P, S> {}
export class LifecycleComponent extends Component<Props<any, any>, any> {}
export function applyLifecycle<P = {}, S = {}>(
component: ComponentClass<P, S>,
): ComponentClass<P & LifecycleDispatchProps<P, S>>;
export const connectWithLifecycle: Connect;