2.0.16 • Published 6 months ago

@types/redux-auth-wrapper v2.0.16

Weekly downloads
1,972
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/redux-auth-wrapper

Summary

This package contains type definitions for redux-auth-wrapper (https://github.com/mjrussell/redux-auth-wrapper).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-auth-wrapper/v1.

index.d.ts

// Type definitions for redux-auth-wrapper 1.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, FunctionComponent, ElementType } from "react";
import { Action } from "redux";
import { Location } from "history";

export type ComponentConstructor<P> = ComponentClass<P> | FunctionComponent<P>;

export interface InjectedProps<AuthData> {
    authData?: AuthData | undefined;
}

export interface AuthWrapperConfig<State, Props, AuthData> {
    allowRedirectBack?: boolean | ((location: Location, redirectPath: string) => boolean) | undefined;
    authenticatingSelector?(state: State, ownProps?: Props): boolean;
    authSelector(state: State, ownProps?: Props): AuthData;
    FailureComponent?: ElementType | undefined;
    failureRedirectPath?: string | ((state: State, ownProps?: Props) => string) | undefined;
    LoadingComponent?: ElementType | undefined;
    redirectQueryParamName?: string | undefined;
    wrapperDisplayName?: string | undefined;
    predicate?(authData: AuthData): boolean;
    propMapper?(ownProps: Props): InjectedProps<AuthData> & Props;
    redirectAction?(...args: any[]): Action;
}

export type AuthDecorator<Props> = (component: ComponentConstructor<Props>) => ComponentClass<Props>;

export function UserAuthWrapper<State, Props, AuthData>(config: AuthWrapperConfig<State, Props, AuthData>): AuthDecorator<Props>;

Additional Details

Credits

These definitions were written by Karol Janyst.

2.0.15

7 months ago

2.0.16

6 months ago

2.0.14

7 months ago

1.0.11

7 months ago

1.0.13

6 months ago

1.0.12

7 months ago

2.0.13

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

2.0.11

3 years ago

2.0.12

3 years ago

1.0.7

3 years ago

2.0.10

3 years ago

2.0.9

5 years ago

1.0.6

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

1.0.5

6 years ago

2.0.6

6 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago