1 | import { ClassAttributes, ComponentClass, ComponentType, FunctionComponent } from 'react';
|
2 | import { Action, AnyAction, Dispatch } from 'redux';
|
3 | import type { NonReactStatics } from 'hoist-non-react-statics';
|
4 | import type { ConnectProps } from './components/connect';
|
5 | export declare type FixTypeLater = any;
|
6 | export declare type EqualityFn<T> = (a: T, b: T) => boolean;
|
7 | export declare type ExtendedEqualityFn<T, P> = (a: T, b: T, c: P, d: P) => boolean;
|
8 | export declare type AnyIfEmpty<T extends object> = keyof T extends never ? any : T;
|
9 | export declare type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
10 | export interface DispatchProp<A extends Action = AnyAction> {
|
11 | dispatch: Dispatch<A>;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | export declare type Matching<InjectedProps, DecorationTargetProps> = {
|
26 | [P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : InjectedProps[P] : DecorationTargetProps[P];
|
27 | };
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare type Shared<InjectedProps, DecorationTargetProps> = {
|
39 | [P in Extract<keyof InjectedProps, keyof DecorationTargetProps>]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never;
|
40 | };
|
41 | export declare type GetProps<C> = C extends ComponentType<infer P> ? C extends ComponentClass<P> ? ClassAttributes<InstanceType<C>> & P : P : never;
|
42 | export declare type GetLibraryManagedProps<C> = JSX.LibraryManagedAttributes<C, GetProps<C>>;
|
43 | export declare type ConnectedComponent<C extends ComponentType<any>, P> = FunctionComponent<P> & NonReactStatics<C> & {
|
44 | WrappedComponent: C;
|
45 | };
|
46 | export declare type ConnectPropsMaybeWithoutContext<TActualOwnProps> = TActualOwnProps extends {
|
47 | context: any;
|
48 | } ? Omit<ConnectProps, 'context'> : ConnectProps;
|
49 | declare type Identity<T> = T;
|
50 | export declare type Mapped<T> = Identity<{
|
51 | [k in keyof T]: T[k];
|
52 | }>;
|
53 | export declare type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> = <C extends ComponentType<Matching<TInjectedProps, GetProps<C>>>>(component: C) => ConnectedComponent<C, Mapped<DistributiveOmit<GetLibraryManagedProps<C>, keyof Shared<TInjectedProps, GetLibraryManagedProps<C>>> & TNeedsProps & ConnectPropsMaybeWithoutContext<TNeedsProps & GetProps<C>>>>;
|
54 | export declare type InferableComponentEnhancer<TInjectedProps> = InferableComponentEnhancerWithProps<TInjectedProps, {}>;
|
55 | export declare type InferThunkActionCreatorType<TActionCreator extends (...args: any[]) => any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn ? (...args: TParams) => TReturn : TActionCreator;
|
56 | export declare type HandleThunkActionCreator<TActionCreator> = TActionCreator extends (...args: any[]) => any ? InferThunkActionCreatorType<TActionCreator> : TActionCreator;
|
57 | export declare type ResolveThunks<TDispatchProps> = TDispatchProps extends {
|
58 | [key: string]: any;
|
59 | } ? {
|
60 | [C in keyof TDispatchProps]: HandleThunkActionCreator<TDispatchProps[C]>;
|
61 | } : TDispatchProps;
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export interface TypedUseSelectorHook<TState> {
|
75 | <TSelected>(selector: (state: TState) => TSelected, equalityFn?: EqualityFn<NoInfer<TSelected>>): TSelected;
|
76 | }
|
77 | export declare type NoInfer<T> = [T][T extends any ? 0 : never];
|
78 | export {};
|
79 |
|
\ | No newline at end of file |