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 | import {
|
27 | ClassAttributes,
|
28 | Component,
|
29 | ComponentClass,
|
30 | ComponentType,
|
31 | StatelessComponent,
|
32 | Context,
|
33 | NamedExoticComponent
|
34 | } from 'react';
|
35 |
|
36 | import {
|
37 | Action,
|
38 | ActionCreator,
|
39 | AnyAction,
|
40 | Dispatch,
|
41 | Store
|
42 | } from 'redux';
|
43 |
|
44 | import hoistNonReactStatics = require('hoist-non-react-statics');
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export interface DefaultRootState {}
|
54 |
|
55 | export type AnyIfEmpty<T extends object> = keyof T extends never ? any : T;
|
56 | export type RootStateOrAny = AnyIfEmpty<DefaultRootState>;
|
57 |
|
58 |
|
59 | export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
60 |
|
61 | export type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
62 |
|
63 | export interface DispatchProp<A extends Action = AnyAction> {
|
64 | dispatch: Dispatch<A>;
|
65 | }
|
66 |
|
67 | export type AdvancedComponentDecorator<TProps, TOwnProps> =
|
68 | (component: ComponentType<TProps>) => NamedExoticComponent<TOwnProps>;
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | export type Matching<InjectedProps, DecorationTargetProps> = {
|
83 | [P in keyof DecorationTargetProps]: P extends keyof InjectedProps
|
84 | ? InjectedProps[P] extends DecorationTargetProps[P]
|
85 | ? DecorationTargetProps[P]
|
86 | : InjectedProps[P]
|
87 | : DecorationTargetProps[P];
|
88 | };
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | export type Shared<
|
101 | InjectedProps,
|
102 | DecorationTargetProps
|
103 | > = {
|
104 | [P in Extract<keyof InjectedProps, keyof DecorationTargetProps>]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never;
|
105 | };
|
106 |
|
107 |
|
108 | export type GetProps<C> = C extends ComponentType<infer P>
|
109 | ? C extends ComponentClass<P> ? ClassAttributes<InstanceType<C>> & P : P
|
110 | : never;
|
111 |
|
112 |
|
113 |
|
114 | export type ConnectedComponent<
|
115 | C extends ComponentType<any>,
|
116 | P
|
117 | > = NamedExoticComponent<JSX.LibraryManagedAttributes<C, P>> & hoistNonReactStatics.NonReactStatics<C> & {
|
118 | WrappedComponent: C;
|
119 | };
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 | export type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> =
|
126 | <C extends ComponentType<Matching<TInjectedProps, GetProps<C>>>>(
|
127 | component: C
|
128 | ) => ConnectedComponent<C, DistributiveOmit<GetProps<C>, keyof Shared<TInjectedProps, GetProps<C>>> & TNeedsProps>;
|
129 |
|
130 |
|
131 |
|
132 |
|
133 | export type InferableComponentEnhancer<TInjectedProps> =
|
134 | InferableComponentEnhancerWithProps<TInjectedProps, {}>;
|
135 |
|
136 | export type InferThunkActionCreatorType<TActionCreator extends (...args: any[]) => any> =
|
137 | TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn
|
138 | ? (...args: TParams) => TReturn
|
139 | : TActionCreator;
|
140 |
|
141 | export type HandleThunkActionCreator<TActionCreator> =
|
142 | TActionCreator extends (...args: any[]) => any
|
143 | ? InferThunkActionCreatorType<TActionCreator>
|
144 | : TActionCreator;
|
145 |
|
146 |
|
147 |
|
148 | export type ResolveThunks<TDispatchProps> =
|
149 | TDispatchProps extends { [key: string]: any }
|
150 | ? {
|
151 | [C in keyof TDispatchProps]: HandleThunkActionCreator<TDispatchProps[C]>
|
152 | }
|
153 | : TDispatchProps;
|
154 |
|
155 |
|
156 |
|
157 | export type ResolveArrayThunks<TDispatchProps extends ReadonlyArray<any>> =
|
158 | TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, infer A9]
|
159 | ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>, HandleThunkActionCreator<A4>,
|
160 | HandleThunkActionCreator<A5>, HandleThunkActionCreator<A6>, HandleThunkActionCreator<A7>, HandleThunkActionCreator<A8>, HandleThunkActionCreator<A9>]
|
161 | : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8]
|
162 | ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>, HandleThunkActionCreator<A4>,
|
163 | HandleThunkActionCreator<A5>, HandleThunkActionCreator<A6>, HandleThunkActionCreator<A7>, HandleThunkActionCreator<A8>]
|
164 | : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7]
|
165 | ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>, HandleThunkActionCreator<A4>,
|
166 | HandleThunkActionCreator<A5>, HandleThunkActionCreator<A6>, HandleThunkActionCreator<A7>]
|
167 | : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6]
|
168 | ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>, HandleThunkActionCreator<A4>, HandleThunkActionCreator<A5>, HandleThunkActionCreator<A6>]
|
169 | : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5]
|
170 | ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>, HandleThunkActionCreator<A4>, HandleThunkActionCreator<A5>]
|
171 | : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>, HandleThunkActionCreator<A4>]
|
172 | : TDispatchProps extends [infer A1, infer A2, infer A3] ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>, HandleThunkActionCreator<A3>]
|
173 | : TDispatchProps extends [infer A1, infer A2] ? [HandleThunkActionCreator<A1>, HandleThunkActionCreator<A2>]
|
174 | : TDispatchProps extends [infer A1] ? [HandleThunkActionCreator<A1>]
|
175 | : TDispatchProps extends Array<infer A> ? Array<HandleThunkActionCreator<A>>
|
176 | : TDispatchProps extends ReadonlyArray<infer A> ? ReadonlyArray<HandleThunkActionCreator<A>>
|
177 | : never
|
178 | ;
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 | export interface Connect<DefaultState = DefaultRootState> {
|
200 |
|
201 | (): InferableComponentEnhancer<DispatchProp>;
|
202 |
|
203 | <TStateProps = {}, no_dispatch = {}, TOwnProps = {}, State = DefaultState>(
|
204 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
|
205 | ): InferableComponentEnhancerWithProps<TStateProps & DispatchProp, TOwnProps>;
|
206 |
|
207 | <no_state = {}, TDispatchProps = {}, TOwnProps = {}>(
|
208 | mapStateToProps: null | undefined,
|
209 | mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>
|
210 | ): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>;
|
211 |
|
212 | <no_state = {}, TDispatchProps = {}, TOwnProps = {}>(
|
213 | mapStateToProps: null | undefined,
|
214 | mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
215 | ): InferableComponentEnhancerWithProps<
|
216 | ResolveThunks<TDispatchProps>,
|
217 | TOwnProps
|
218 | >;
|
219 |
|
220 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, State = DefaultState>(
|
221 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
222 | mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>
|
223 | ): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>;
|
224 |
|
225 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, State = DefaultState>(
|
226 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
227 | mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
228 | ): InferableComponentEnhancerWithProps<
|
229 | TStateProps & ResolveThunks<TDispatchProps>,
|
230 | TOwnProps
|
231 | >;
|
232 |
|
233 | <no_state = {}, no_dispatch = {}, TOwnProps = {}, TMergedProps = {}>(
|
234 | mapStateToProps: null | undefined,
|
235 | mapDispatchToProps: null | undefined,
|
236 | mergeProps: MergeProps<undefined, undefined, TOwnProps, TMergedProps>,
|
237 | ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;
|
238 |
|
239 | <TStateProps = {}, no_dispatch = {}, TOwnProps = {}, TMergedProps = {}, State = DefaultState>(
|
240 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
241 | mapDispatchToProps: null | undefined,
|
242 | mergeProps: MergeProps<TStateProps, undefined, TOwnProps, TMergedProps>,
|
243 | ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;
|
244 |
|
245 | <no_state = {}, TDispatchProps = {}, TOwnProps = {}, TMergedProps = {}>(
|
246 | mapStateToProps: null | undefined,
|
247 | mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
248 | mergeProps: MergeProps<undefined, TDispatchProps, TOwnProps, TMergedProps>,
|
249 | ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;
|
250 |
|
251 | <TStateProps = {}, no_dispatch = {}, TOwnProps = {}, State = DefaultState>(
|
252 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
253 | mapDispatchToProps: null | undefined,
|
254 | mergeProps: null | undefined,
|
255 | options: Options<State, TStateProps, TOwnProps>
|
256 | ): InferableComponentEnhancerWithProps<DispatchProp & TStateProps, TOwnProps>;
|
257 |
|
258 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}>(
|
259 | mapStateToProps: null | undefined,
|
260 | mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>,
|
261 | mergeProps: null | undefined,
|
262 | options: Options<{}, TStateProps, TOwnProps>
|
263 | ): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>;
|
264 |
|
265 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}>(
|
266 | mapStateToProps: null | undefined,
|
267 | mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
268 | mergeProps: null | undefined,
|
269 | options: Options<{}, TStateProps, TOwnProps>
|
270 | ): InferableComponentEnhancerWithProps<
|
271 | ResolveThunks<TDispatchProps>,
|
272 | TOwnProps
|
273 | >;
|
274 |
|
275 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, State = DefaultState>(
|
276 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
277 | mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>,
|
278 | mergeProps: null | undefined,
|
279 | options: Options<State, TStateProps, TOwnProps>
|
280 | ): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>;
|
281 |
|
282 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, State = DefaultState>(
|
283 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
284 | mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
285 | mergeProps: null | undefined,
|
286 | options: Options<State, TStateProps, TOwnProps>
|
287 | ): InferableComponentEnhancerWithProps<
|
288 | TStateProps & ResolveThunks<TDispatchProps>,
|
289 | TOwnProps
|
290 | >;
|
291 |
|
292 | <TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, TMergedProps = {}, State = DefaultState>(
|
293 | mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
294 | mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
295 | mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>,
|
296 | options?: Options<State, TStateProps, TOwnProps, TMergedProps>
|
297 | ): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;
|
298 |
|
299 | }
|
300 |
|
301 |
|
302 |
|
303 |
|
304 | export type ConnectedProps<TConnector> =
|
305 | TConnector extends InferableComponentEnhancerWithProps<infer TInjectedProps, any>
|
306 | ? unknown extends TInjectedProps
|
307 | ? TConnector extends InferableComponentEnhancer<infer TInjectedProps>
|
308 | ? TInjectedProps
|
309 | : never
|
310 | : TInjectedProps
|
311 | : never;
|
312 |
|
313 |
|
314 |
|
315 |
|
316 | export const connect: Connect;
|
317 |
|
318 | export type MapStateToProps<TStateProps, TOwnProps, State = DefaultRootState> =
|
319 | (state: State, ownProps: TOwnProps) => TStateProps;
|
320 |
|
321 | export type MapStateToPropsFactory<TStateProps, TOwnProps, State = DefaultRootState> =
|
322 | (initialState: State, ownProps: TOwnProps) => MapStateToProps<TStateProps, TOwnProps, State>;
|
323 |
|
324 | export type MapStateToPropsParam<TStateProps, TOwnProps, State = DefaultRootState> =
|
325 | MapStateToPropsFactory<TStateProps, TOwnProps, State> | MapStateToProps<TStateProps, TOwnProps, State> | null | undefined;
|
326 |
|
327 | export type MapDispatchToPropsFunction<TDispatchProps, TOwnProps> =
|
328 | (dispatch: Dispatch<Action>, ownProps: TOwnProps) => TDispatchProps;
|
329 |
|
330 | export type MapDispatchToProps<TDispatchProps, TOwnProps> =
|
331 | MapDispatchToPropsFunction<TDispatchProps, TOwnProps> | TDispatchProps;
|
332 |
|
333 | export type MapDispatchToPropsFactory<TDispatchProps, TOwnProps> =
|
334 | (dispatch: Dispatch<Action>, ownProps: TOwnProps) => MapDispatchToPropsFunction<TDispatchProps, TOwnProps>;
|
335 |
|
336 | export type MapDispatchToPropsParam<TDispatchProps, TOwnProps> = MapDispatchToPropsFactory<TDispatchProps, TOwnProps> | MapDispatchToProps<TDispatchProps, TOwnProps>;
|
337 |
|
338 | export type MapDispatchToPropsNonObject<TDispatchProps, TOwnProps> = MapDispatchToPropsFactory<TDispatchProps, TOwnProps> | MapDispatchToPropsFunction<TDispatchProps, TOwnProps>;
|
339 |
|
340 | export type MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps> =
|
341 | (stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps;
|
342 |
|
343 | export interface Options<State = DefaultRootState, TStateProps = {}, TOwnProps = {}, TMergedProps = {}> extends ConnectOptions {
|
344 | |
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 | pure?: boolean;
|
352 |
|
353 | |
354 |
|
355 |
|
356 |
|
357 | areStatesEqual?: (nextState: State, prevState: State) => boolean;
|
358 |
|
359 | |
360 |
|
361 |
|
362 |
|
363 | areOwnPropsEqual?: (nextOwnProps: TOwnProps, prevOwnProps: TOwnProps) => boolean;
|
364 |
|
365 | |
366 |
|
367 |
|
368 |
|
369 | areStatePropsEqual?: (nextStateProps: TStateProps, prevStateProps: TStateProps) => boolean;
|
370 |
|
371 | |
372 |
|
373 |
|
374 |
|
375 | areMergedPropsEqual?: (nextMergedProps: TMergedProps, prevMergedProps: TMergedProps) => boolean;
|
376 |
|
377 | |
378 |
|
379 |
|
380 |
|
381 |
|
382 | forwardRef?: boolean;
|
383 | }
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | export function connectAdvanced<S, TProps, TOwnProps, TFactoryOptions = {}>(
|
396 |
|
397 | selectorFactory: SelectorFactory<S, TProps, TOwnProps, TFactoryOptions>,
|
398 | connectOptions?: ConnectOptions & TFactoryOptions
|
399 | ): AdvancedComponentDecorator<TProps, TOwnProps>;
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | export type SelectorFactory<S, TProps, TOwnProps, TFactoryOptions> =
|
410 | (dispatch: Dispatch<Action>, factoryOptions: TFactoryOptions) => Selector<S, TProps, TOwnProps>;
|
411 |
|
412 | export type Selector<S, TProps, TOwnProps = null> = TOwnProps extends null | undefined
|
413 | ? (state: S) => TProps
|
414 | : (state: S, ownProps: TOwnProps) => TProps;
|
415 |
|
416 | export interface ConnectOptions {
|
417 | |
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 | getDisplayName?: (componentName: string) => string;
|
425 | |
426 |
|
427 |
|
428 |
|
429 |
|
430 | methodName?: string;
|
431 | |
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 | renderCountProp?: string;
|
439 | |
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | shouldHandleStateChanges?: boolean;
|
446 | |
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 | storeKey?: string;
|
453 | |
454 |
|
455 |
|
456 |
|
457 |
|
458 | withRef?: boolean;
|
459 | |
460 |
|
461 |
|
462 |
|
463 |
|
464 | context?: Context<ReactReduxContextValue>;
|
465 | }
|
466 |
|
467 | export interface ReactReduxContextValue<SS = any, A extends Action = AnyAction> {
|
468 | store: Store<SS, A>;
|
469 | storeState: SS;
|
470 | }
|
471 |
|
472 | export interface ProviderProps<A extends Action = AnyAction> {
|
473 | |
474 |
|
475 |
|
476 | store: Store<any, A>;
|
477 | |
478 |
|
479 |
|
480 |
|
481 |
|
482 | context?: Context<ReactReduxContextValue>;
|
483 | }
|
484 |
|
485 |
|
486 |
|
487 |
|
488 | export class Provider<A extends Action = AnyAction> extends Component<ProviderProps<A>> { }
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 | export const ReactReduxContext: Context<ReactReduxContextValue>;
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 | export function batch(cb: () => void): void;
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 | export function shallowEqual<T>(left: T, right: any): boolean;
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 | export function useDispatch<TDispatch = Dispatch<any>>(): TDispatch;
|
540 | export function useDispatch<A extends Action = AnyAction>(): Dispatch<A>;
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 | export function useSelector<TState = DefaultRootState, TSelected = unknown>(
|
571 | selector: (state: TState) => TSelected,
|
572 | equalityFn?: (left: TSelected, right: TSelected) => boolean
|
573 | ): TSelected;
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 | export interface TypedUseSelectorHook<TState> {
|
588 | <TSelected>(
|
589 | selector: (state: TState) => TSelected,
|
590 | equalityFn?: (left: TSelected, right: TSelected) => boolean
|
591 | ): TSelected;
|
592 | }
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 | export function useStore<S = RootStateOrAny, A extends Action = AnyAction>(): Store<S, A>;
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 | export function createSelectorHook<S = RootStateOrAny, A extends Action = AnyAction>(
|
618 | context?: Context<ReactReduxContextValue<S, A>>,
|
619 | ): <Selected extends unknown>(
|
620 | selector: (state: S) => Selected,
|
621 | equalityFn?: (previous: Selected, next: Selected) => boolean,
|
622 | ) => Selected;
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 | export function createStoreHook<S = RootStateOrAny, A extends Action = AnyAction>(
|
631 | context?: Context<ReactReduxContextValue<S, A>>,
|
632 | ): () => Store<S, A>;
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 | export function createDispatchHook<S = RootStateOrAny, A extends Action = AnyAction>(
|
641 | context?: Context<ReactReduxContextValue<S, A>>,
|
642 | ): () => Dispatch<A>;
|
643 |
|
644 |
|