import { ClassAttributes, ComponentClass, ComponentType, FunctionComponent } from 'react'; import { Action, AnyAction, Dispatch } from 'redux'; import type { NonReactStatics } from 'hoist-non-react-statics'; import type { ConnectProps } from './components/connect'; export declare type FixTypeLater = any; export declare type EqualityFn = (a: T, b: T) => boolean; export declare type ExtendedEqualityFn = (a: T, b: T, c: P, d: P) => boolean; export declare type AnyIfEmpty = keyof T extends never ? any : T; export declare type DistributiveOmit = T extends unknown ? Omit : never; export interface DispatchProp { dispatch: Dispatch; } /** * A property P will be present if: * - it is present in DecorationTargetProps * * Its value will be dependent on the following conditions * - if property P is present in InjectedProps and its definition extends the definition * in DecorationTargetProps, then its definition will be that of DecorationTargetProps[P] * - if property P is not present in InjectedProps then its definition will be that of * DecorationTargetProps[P] * - if property P is present in InjectedProps but does not extend the * DecorationTargetProps[P] definition, its definition will be that of InjectedProps[P] */ export declare type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : InjectedProps[P] : DecorationTargetProps[P]; }; /** * a property P will be present if : * - it is present in both DecorationTargetProps and InjectedProps * - InjectedProps[P] can satisfy DecorationTargetProps[P] * ie: decorated component can accept more types than decorator is injecting * * For decoration, inject props or ownProps are all optionally * required by the decorated (right hand side) component. * But any property required by the decorated component must be satisfied by the injected property. */ export declare type Shared = { [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; }; export declare type GetProps = C extends ComponentType ? C extends ComponentClass

? ClassAttributes> & P : P : never; export declare type GetLibraryManagedProps = JSX.LibraryManagedAttributes>; export declare type ConnectedComponent, P> = FunctionComponent

& NonReactStatics & { WrappedComponent: C; }; export declare type ConnectPropsMaybeWithoutContext = TActualOwnProps extends { context: any; } ? Omit : ConnectProps; declare type Identity = T; export declare type Mapped = Identity<{ [k in keyof T]: T[k]; }>; export declare type InferableComponentEnhancerWithProps = >>>(component: C) => ConnectedComponent, keyof Shared>> & TNeedsProps & ConnectPropsMaybeWithoutContext>>>; export declare type InferableComponentEnhancer = InferableComponentEnhancerWithProps; export declare type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn ? (...args: TParams) => TReturn : TActionCreator; export declare type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any ? InferThunkActionCreatorType : TActionCreator; export declare type ResolveThunks = TDispatchProps extends { [key: string]: any; } ? { [C in keyof TDispatchProps]: HandleThunkActionCreator; } : TDispatchProps; /** * This interface allows you to easily create a hook that is properly typed for your * store's root state. * * @example * * interface RootState { * property: string; * } * * const useTypedSelector: TypedUseSelectorHook = useSelector; */ export interface TypedUseSelectorHook { (selector: (state: TState) => TSelected, equalityFn?: EqualityFn>): TSelected; } export declare type NoInfer = [T][T extends any ? 0 : never]; export {};