1 | import type { ActionFromMatcher, Matcher, UnionToIntersection } from './tsHelpers';
|
2 | import type { AsyncThunk, AsyncThunkFulfilledActionCreator, AsyncThunkPendingActionCreator, AsyncThunkRejectedActionCreator } from './createAsyncThunk';
|
3 |
|
4 | export declare type ActionMatchingAnyOf<Matchers extends [...Matcher<any>[]]> = ActionFromMatcher<Matchers[number]>;
|
5 |
|
6 | export declare type ActionMatchingAllOf<Matchers extends [...Matcher<any>[]]> = UnionToIntersection<ActionMatchingAnyOf<Matchers>>;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare function isAnyOf<Matchers extends [...Matcher<any>[]]>(...matchers: Matchers): (action: any) => action is ActionFromMatcher<Matchers[number]>;
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare function isAllOf<Matchers extends [...Matcher<any>[]]>(...matchers: Matchers): (action: any) => action is UnionToIntersection<ActionFromMatcher<Matchers[number]>>;
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare function hasExpectedRequestMetadata(action: any, validStatus: readonly string[]): boolean;
|
34 | export declare type UnknownAsyncThunkPendingAction = ReturnType<AsyncThunkPendingActionCreator<unknown>>;
|
35 | export declare type PendingActionFromAsyncThunk<T extends AnyAsyncThunk> = ActionFromMatcher<T['pending']>;
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare function isPending(): (action: any) => action is UnknownAsyncThunkPendingAction;
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export declare function isPending<AsyncThunks extends [AnyAsyncThunk, ...AnyAsyncThunk[]]>(...asyncThunks: AsyncThunks): (action: any) => action is PendingActionFromAsyncThunk<AsyncThunks[number]>;
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | export declare function isPending(action: any): action is UnknownAsyncThunkPendingAction;
|
59 | export declare type UnknownAsyncThunkRejectedAction = ReturnType<AsyncThunkRejectedActionCreator<unknown, unknown>>;
|
60 | export declare type RejectedActionFromAsyncThunk<T extends AnyAsyncThunk> = ActionFromMatcher<T['rejected']>;
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | export declare function isRejected(): (action: any) => action is UnknownAsyncThunkRejectedAction;
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | export declare function isRejected<AsyncThunks extends [AnyAsyncThunk, ...AnyAsyncThunk[]]>(...asyncThunks: AsyncThunks): (action: any) => action is RejectedActionFromAsyncThunk<AsyncThunks[number]>;
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | export declare function isRejected(action: any): action is UnknownAsyncThunkRejectedAction;
|
84 | export declare type UnknownAsyncThunkRejectedWithValueAction = ReturnType<AsyncThunkRejectedActionCreator<unknown, unknown>>;
|
85 | export declare type RejectedWithValueActionFromAsyncThunk<T extends AnyAsyncThunk> = ActionFromMatcher<T['rejected']> & (T extends AsyncThunk<any, any, {
|
86 | rejectValue: infer RejectedValue;
|
87 | }> ? {
|
88 | payload: RejectedValue;
|
89 | } : unknown);
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | export declare function isRejectedWithValue(): (action: any) => action is UnknownAsyncThunkRejectedAction;
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | export declare function isRejectedWithValue<AsyncThunks extends [AnyAsyncThunk, ...AnyAsyncThunk[]]>(...asyncThunks: AsyncThunks): (action: any) => action is RejectedWithValueActionFromAsyncThunk<AsyncThunks[number]>;
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | export declare function isRejectedWithValue(action: any): action is UnknownAsyncThunkRejectedAction;
|
113 | export declare type UnknownAsyncThunkFulfilledAction = ReturnType<AsyncThunkFulfilledActionCreator<unknown, unknown>>;
|
114 | export declare type FulfilledActionFromAsyncThunk<T extends AnyAsyncThunk> = ActionFromMatcher<T['fulfilled']>;
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | export declare function isFulfilled(): (action: any) => action is UnknownAsyncThunkFulfilledAction;
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | export declare function isFulfilled<AsyncThunks extends [AnyAsyncThunk, ...AnyAsyncThunk[]]>(...asyncThunks: AsyncThunks): (action: any) => action is FulfilledActionFromAsyncThunk<AsyncThunks[number]>;
|
133 |
|
134 |
|
135 |
|
136 |
|
137 | export declare function isFulfilled(action: any): action is UnknownAsyncThunkFulfilledAction;
|
138 | export declare type UnknownAsyncThunkAction = UnknownAsyncThunkPendingAction | UnknownAsyncThunkRejectedAction | UnknownAsyncThunkFulfilledAction;
|
139 | export declare type AnyAsyncThunk = {
|
140 | pending: {
|
141 | match: (action: any) => action is any;
|
142 | };
|
143 | fulfilled: {
|
144 | match: (action: any) => action is any;
|
145 | };
|
146 | rejected: {
|
147 | match: (action: any) => action is any;
|
148 | };
|
149 | };
|
150 | export declare type ActionsFromAsyncThunk<T extends AnyAsyncThunk> = ActionFromMatcher<T['pending']> | ActionFromMatcher<T['fulfilled']> | ActionFromMatcher<T['rejected']>;
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 | export declare function isAsyncThunkAction(): (action: any) => action is UnknownAsyncThunkAction;
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | export declare function isAsyncThunkAction<AsyncThunks extends [AnyAsyncThunk, ...AnyAsyncThunk[]]>(...asyncThunks: AsyncThunks): (action: any) => action is ActionsFromAsyncThunk<AsyncThunks[number]>;
|
167 |
|
168 |
|
169 |
|
170 |
|
171 | export declare function isAsyncThunkAction(action: any): action is UnknownAsyncThunkAction;
|