Files
DefinitelyTyped/types/redux-auth-wrapper/index.d.ts
Thomas Charlat 65b176eaef [react-redux]: decoration target props should not extend injected props, contravariance issue (#25228)
* feat(react-redux): add strict null check

* feat(react-redux): remove improper inference tests

Infered decorated typings would rely on the implicit and false
assumption that decorated component props extend injected props and
own props

#24922
#24913

* fix(react-redux): injected props and decorated component props intersection

* InjectedProps should not have to extend DecoratedProps
* DecoratedProps should not have to extend InjectedProps
* DecoratedProps should extend Intersection<InjectedProps, DecoratedProps>
* Remaining Props should be required on the decoration output

#24913
#24922

* feat(react-redux): add new commiters

* feat(react-redux): 2.9 keyof compatibility depends on Extract (2.8)
2018-05-07 12:34:04 -07:00

22 lines
864 B
TypeScript

// Type definitions for redux-auth-wrapper 2.0
// Project: https://github.com/mjrussell/redux-auth-wrapper
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { ComponentClass, StatelessComponent, ComponentType, ReactType } from "react";
export type StateSelector<State, OwnProps, R> = (state: State, props: OwnProps) => R;
export type AuthWrapperDecorator<Props> = (component: ComponentType<Props>) => ComponentClass<Props>;
export interface AuthConfig {
AuthenticatingComponent?: ReactType;
wrapperDisplayName?: string;
}
export interface AuthBaseConfig<OwnProps = {}, State = {}> extends AuthConfig {
authenticatedSelector: StateSelector<State, OwnProps, boolean>;
authenticatingSelector?: StateSelector<State, OwnProps, boolean>;
}