1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
|
## API Report File for "react-redux"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { Action } from 'redux';
import { AnyAction } from 'redux';
import { unstable_batchedUpdates as batch } from 'react-dom';
import { ClassAttributes } from 'react';
import { ComponentClass } from 'react';
import { ComponentType } from 'react';
import { Context } from 'react';
import { Dispatch } from 'redux';
import type { NonReactStatics } from 'hoist-non-react-statics';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { Store } from 'redux';
// @public (undocumented)
export type AdvancedComponentDecorator<TProps, TOwnProps> = (component: ComponentType<TProps>) => ComponentType<TOwnProps>;
// @public (undocumented)
export type AnyIfEmpty<T extends object> = keyof T extends never ? any : T;
export { batch }
// @public (undocumented)
export const connect: {
(): InferableComponentEnhancer<DispatchProp>;
<TStateProps = {}, no_dispatch = {}, TOwnProps = {}, State = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>): InferableComponentEnhancerWithProps<TStateProps & DispatchProp<AnyAction>, TOwnProps>;
<no_state = {}, TDispatchProps = {}, TOwnProps_1 = {}>(mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps_1>): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps_1>;
<no_state_1 = {}, TDispatchProps_1 = {}, TOwnProps_2 = {}>(mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps_1, TOwnProps_2>): InferableComponentEnhancerWithProps<ResolveThunks<TDispatchProps_1>, TOwnProps_2>;
<TStateProps_1 = {}, TDispatchProps_2 = {}, TOwnProps_3 = {}, State_1 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_1, TOwnProps_3, State_1>, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps_2, TOwnProps_3>): InferableComponentEnhancerWithProps<TStateProps_1 & TDispatchProps_2, TOwnProps_3>;
<TStateProps_2 = {}, TDispatchProps_3 = {}, TOwnProps_4 = {}, State_2 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_2, TOwnProps_4, State_2>, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps_3, TOwnProps_4>): InferableComponentEnhancerWithProps<TStateProps_2 & ResolveThunks<TDispatchProps_3>, TOwnProps_4>;
<no_state_2 = {}, no_dispatch_1 = {}, TOwnProps_5 = {}, TMergedProps = {}>(mapStateToProps: null | undefined, mapDispatchToProps: null | undefined, mergeProps: MergeProps<undefined, undefined, TOwnProps_5, TMergedProps>): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps_5>;
<TStateProps_3 = {}, no_dispatch_2 = {}, TOwnProps_6 = {}, TMergedProps_1 = {}, State_3 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_3, TOwnProps_6, State_3>, mapDispatchToProps: null | undefined, mergeProps: MergeProps<TStateProps_3, undefined, TOwnProps_6, TMergedProps_1>): InferableComponentEnhancerWithProps<TMergedProps_1, TOwnProps_6>;
<no_state_3 = {}, TDispatchProps_4 = {}, TOwnProps_7 = {}, TMergedProps_2 = {}>(mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps_4, TOwnProps_7>, mergeProps: MergeProps<undefined, TDispatchProps_4, TOwnProps_7, TMergedProps_2>): InferableComponentEnhancerWithProps<TMergedProps_2, TOwnProps_7>;
<TStateProps_4 = {}, no_dispatch_3 = {}, TOwnProps_8 = {}, State_4 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_4, TOwnProps_8, State_4>, mapDispatchToProps: null | undefined, mergeProps: null | undefined, options: ConnectOptions<State_4, TStateProps_4, TOwnProps_8, {}>): InferableComponentEnhancerWithProps<DispatchProp<AnyAction> & TStateProps_4, TOwnProps_8>;
<TStateProps_5 = {}, TDispatchProps_5 = {}, TOwnProps_9 = {}>(mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps_5, TOwnProps_9>, mergeProps: null | undefined, options: ConnectOptions<{}, TStateProps_5, TOwnProps_9, {}>): InferableComponentEnhancerWithProps<TDispatchProps_5, TOwnProps_9>;
<TStateProps_6 = {}, TDispatchProps_6 = {}, TOwnProps_10 = {}>(mapStateToProps: null | undefined, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps_6, TOwnProps_10>, mergeProps: null | undefined, options: ConnectOptions<{}, TStateProps_6, TOwnProps_10, {}>): InferableComponentEnhancerWithProps<ResolveThunks<TDispatchProps_6>, TOwnProps_10>;
<TStateProps_7 = {}, TDispatchProps_7 = {}, TOwnProps_11 = {}, State_5 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_7, TOwnProps_11, State_5>, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps_7, TOwnProps_11>, mergeProps: null | undefined, options: ConnectOptions<State_5, TStateProps_7, TOwnProps_11, {}>): InferableComponentEnhancerWithProps<TStateProps_7 & TDispatchProps_7, TOwnProps_11>;
<TStateProps_8 = {}, TDispatchProps_8 = {}, TOwnProps_12 = {}, State_6 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_8, TOwnProps_12, State_6>, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps_8, TOwnProps_12>, mergeProps: null | undefined, options: ConnectOptions<State_6, TStateProps_8, TOwnProps_12, {}>): InferableComponentEnhancerWithProps<TStateProps_8 & ResolveThunks<TDispatchProps_8>, TOwnProps_12>;
<TStateProps_9 = {}, TDispatchProps_9 = {}, TOwnProps_13 = {}, TMergedProps_3 = {}, State_7 = DefaultRootState>(mapStateToProps: MapStateToPropsParam<TStateProps_9, TOwnProps_13, State_7>, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps_9, TOwnProps_13>, mergeProps: MergeProps<TStateProps_9, TDispatchProps_9, TOwnProps_13, TMergedProps_3>, options?: ConnectOptions<State_7, TStateProps_9, TOwnProps_13, TMergedProps_3> | undefined): InferableComponentEnhancerWithProps<TMergedProps_3, TOwnProps_13>;
};
// @public (undocumented)
export function connectAdvanced<S, TProps, TOwnProps, TFactoryOptions = {}>(selectorFactory: SelectorFactory<S, TProps, unknown, unknown>, { getDisplayName, methodName, shouldHandleStateChanges, forwardRef, context, ...connectOptions }?: ConnectAdvancedOptions & Partial<TFactoryOptions>): AdvancedComponentDecorator<TProps, TOwnProps & ConnectProps>;
// @public (undocumented)
export interface ConnectAdvancedOptions {
// (undocumented)
context?: typeof ReactReduxContext;
// (undocumented)
forwardRef?: boolean;
// (undocumented)
getDisplayName?: (name: string) => string;
// (undocumented)
methodName?: string;
// (undocumented)
pure?: boolean;
// (undocumented)
shouldHandleStateChanges?: boolean;
}
// @public (undocumented)
export type ConnectedComponent<C extends ComponentType<any>, P> = ComponentType<P> & NonReactStatics<C> & {
WrappedComponent: C;
};
// @public
export type ConnectedProps<TConnector> = TConnector extends InferableComponentEnhancerWithProps<infer TInjectedProps, any> ? unknown extends TInjectedProps ? TConnector extends InferableComponentEnhancer<infer TInjectedProps> ? TInjectedProps : never : TInjectedProps : never;
// @public (undocumented)
export interface ConnectProps {
// (undocumented)
context?: ReactReduxContextInstance;
// (undocumented)
reactReduxForwardedRef?: React_2.ForwardedRef<unknown>;
// (undocumented)
store?: Store;
}
// @public
export function createDispatchHook(context?: Context<ReactReduxContextValue<any, AnyAction> | null>): () => Dispatch<AnyAction>;
// @public
export function createSelectorHook(context?: Context<ReactReduxContextValue<any, AnyAction> | null>): <TState = DefaultRootState, Selected = unknown>(selector: (state: TState) => Selected, equalityFn?: EqualityFn<Selected>) => Selected;
// @public
export function createStoreHook(context?: Context<ReactReduxContextValue<any, AnyAction> | null>): () => Store<any, AnyAction>;
// @public
export interface DefaultRootState {
}
// @public (undocumented)
export interface DispatchProp<A extends Action = AnyAction> {
// (undocumented)
dispatch: Dispatch<A>;
}
// @public (undocumented)
export type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit_2<T, K> : never;
// @public (undocumented)
export type EqualityFn<T> = (a: T | undefined, b: T | undefined) => boolean;
// @public (undocumented)
export type FixTypeLater = any;
// @public (undocumented)
export type GetProps<C> = C extends ComponentType<infer P> ? C extends ComponentClass<P> ? ClassAttributes<InstanceType<C>> & P : P : never;
// @public (undocumented)
export type HandleThunkActionCreator<TActionCreator> = TActionCreator extends (...args: any[]) => any ? InferThunkActionCreatorType<TActionCreator> : TActionCreator;
// @public (undocumented)
export type InferableComponentEnhancer<TInjectedProps> = InferableComponentEnhancerWithProps<TInjectedProps, {}>;
// @public (undocumented)
export type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> = <C extends ComponentType<Matching<TInjectedProps, GetProps<C>>>>(component: C) => ConnectedComponent<C, DistributiveOmit<GetProps<C>, keyof Shared<TInjectedProps, GetProps<C>>> & TNeedsProps>;
// @public (undocumented)
export type InferThunkActionCreatorType<TActionCreator extends (...args: any[]) => any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn ? (...args: TParams) => TReturn : TActionCreator;
// @public (undocumented)
export type MapDispatchToProps<TDispatchProps, TOwnProps> = MapDispatchToPropsFunction<TDispatchProps, TOwnProps> | TDispatchProps;
// @public (undocumented)
export type MapDispatchToPropsFactory<TDispatchProps, TOwnProps> = (dispatch: Dispatch<Action>, ownProps: TOwnProps) => MapDispatchToPropsFunction<TDispatchProps, TOwnProps>;
// @public (undocumented)
export type MapDispatchToPropsFunction<TDispatchProps, TOwnProps> = (dispatch: Dispatch<Action>, ownProps: TOwnProps) => TDispatchProps;
// @public (undocumented)
export type MapDispatchToPropsNonObject<TDispatchProps, TOwnProps> = MapDispatchToPropsFactory<TDispatchProps, TOwnProps> | MapDispatchToPropsFunction<TDispatchProps, TOwnProps>;
// @public (undocumented)
export type MapDispatchToPropsParam<TDispatchProps, TOwnProps> = MapDispatchToPropsFactory<TDispatchProps, TOwnProps> | MapDispatchToProps<TDispatchProps, TOwnProps>;
// @public (undocumented)
export type MapStateToProps<TStateProps, TOwnProps, State = DefaultRootState> = (state: State, ownProps: TOwnProps) => TStateProps;
// @public (undocumented)
export type MapStateToPropsFactory<TStateProps, TOwnProps, State = DefaultRootState> = (initialState: State, ownProps: TOwnProps) => MapStateToProps<TStateProps, TOwnProps, State>;
// @public (undocumented)
export type MapStateToPropsParam<TStateProps, TOwnProps, State = DefaultRootState> = MapStateToPropsFactory<TStateProps, TOwnProps, State> | MapStateToProps<TStateProps, TOwnProps, State> | null | undefined;
// @public
export type Matching<InjectedProps, DecorationTargetProps> = {
[P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : InjectedProps[P] : DecorationTargetProps[P];
};
// @public (undocumented)
export type MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps> = (stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps;
// @public (undocumented)
type Omit_2<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export { Omit_2 as Omit }
// @public (undocumented)
export function Provider({ store, context, children }: ProviderProps): JSX.Element;
// @public (undocumented)
export interface ProviderProps<A extends Action = AnyAction> {
// (undocumented)
children: ReactNode;
context?: Context<ReactReduxContextValue>;
store: Store<FixTypeLater, A>;
}
// @public (undocumented)
export const ReactReduxContext: React_2.Context<ReactReduxContextValue<any, AnyAction> | null>;
// @public (undocumented)
export interface ReactReduxContextValue<SS = FixTypeLater, A extends Action = AnyAction> {
// (undocumented)
store: Store<SS, A>;
// (undocumented)
subscription: Subscription;
}
// @public (undocumented)
export type ResolveArrayThunks<TDispatchProps extends ReadonlyArray<any>> = TDispatchProps extends [
infer A1,
infer A2,
infer A3,
infer A4,
infer A5,
infer A6,
infer A7,
infer A8,
infer A9
] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>,
HandleThunkActionCreator<A4>,
HandleThunkActionCreator<A5>,
HandleThunkActionCreator<A6>,
HandleThunkActionCreator<A7>,
HandleThunkActionCreator<A8>,
HandleThunkActionCreator<A9>
] : TDispatchProps extends [
infer A1,
infer A2,
infer A3,
infer A4,
infer A5,
infer A6,
infer A7,
infer A8
] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>,
HandleThunkActionCreator<A4>,
HandleThunkActionCreator<A5>,
HandleThunkActionCreator<A6>,
HandleThunkActionCreator<A7>,
HandleThunkActionCreator<A8>
] : TDispatchProps extends [
infer A1,
infer A2,
infer A3,
infer A4,
infer A5,
infer A6,
infer A7
] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>,
HandleThunkActionCreator<A4>,
HandleThunkActionCreator<A5>,
HandleThunkActionCreator<A6>,
HandleThunkActionCreator<A7>
] : TDispatchProps extends [
infer A1,
infer A2,
infer A3,
infer A4,
infer A5,
infer A6
] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>,
HandleThunkActionCreator<A4>,
HandleThunkActionCreator<A5>,
HandleThunkActionCreator<A6>
] : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>,
HandleThunkActionCreator<A4>,
HandleThunkActionCreator<A5>
] : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>,
HandleThunkActionCreator<A4>
] : TDispatchProps extends [infer A1, infer A2, infer A3] ? [
HandleThunkActionCreator<A1>,
HandleThunkActionCreator<A2>,
HandleThunkActionCreator<A3>
] : TDispatchProps extends [infer A1, infer A2] ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>] : TDispatchProps extends [infer A1] ? [HandleThunkActionCreator<A1>] : TDispatchProps extends Array<infer A> ? Array<HandleThunkActionCreator<A>> : TDispatchProps extends ReadonlyArray<infer A> ? ReadonlyArray<HandleThunkActionCreator<A>> : never;
// @public (undocumented)
export type ResolveThunks<TDispatchProps> = TDispatchProps extends {
[key: string]: any;
} ? {
[C in keyof TDispatchProps]: HandleThunkActionCreator<TDispatchProps[C]>;
} : TDispatchProps;
// @public (undocumented)
export type RootStateOrAny = AnyIfEmpty<DefaultRootState>;
// @public (undocumented)
export type Selector<S, TProps, TOwnProps = null> = TOwnProps extends null | undefined ? (state: S) => TProps : (state: S, ownProps: TOwnProps) => TProps;
// @public (undocumented)
export type SelectorFactory<S, TProps, TOwnProps, TFactoryOptions> = (dispatch: Dispatch<Action>, factoryOptions: TFactoryOptions) => Selector<S, TProps, TOwnProps>;
// @public (undocumented)
export function shallowEqual(objA: any, objB: any): boolean;
// @public
export type Shared<InjectedProps, DecorationTargetProps> = {
[P in Extract<keyof InjectedProps, keyof DecorationTargetProps>]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never;
};
// @public
export interface TypedUseSelectorHook<TState> {
// (undocumented)
<TSelected>(selector: (state: TState) => TSelected, equalityFn?: (left: TSelected, right: TSelected) => boolean): TSelected;
}
// @public
export const useDispatch: () => Dispatch<AnyAction>;
// @public
export const useSelector: <TState = DefaultRootState, Selected = unknown>(selector: (state: TState) => Selected, equalityFn?: EqualityFn<Selected> | undefined) => Selected;
// @public
export const useStore: () => Store<any, AnyAction>;
// (No @packageDocumentation comment for this package)
```
|