import type { ActionFromMatcher, Matcher, UnionToIntersection } from './tsHelpers'; import type { AsyncThunk, AsyncThunkFulfilledActionCreator, AsyncThunkPendingActionCreator, AsyncThunkRejectedActionCreator } from './createAsyncThunk'; /** @public */ export declare type ActionMatchingAnyOf, ...Matcher[]]> = ActionFromMatcher; /** @public */ export declare type ActionMatchingAllOf, ...Matcher[]]> = UnionToIntersection>; /** * A higher-order function that returns a function that may be used to check * whether an action matches any one of the supplied type guards or action * creators. * * @param matchers The type guards or action creators to match against. * * @public */ export declare function isAnyOf, ...Matcher[]]>(...matchers: Matchers): (action: any) => action is ActionFromMatcher; /** * A higher-order function that returns a function that may be used to check * whether an action matches all of the supplied type guards or action * creators. * * @param matchers The type guards or action creators to match against. * * @public */ export declare function isAllOf, ...Matcher[]]>(...matchers: Matchers): (action: any) => action is UnionToIntersection>; /** * @param action A redux action * @param validStatus An array of valid meta.requestStatus values * * @internal */ export declare function hasExpectedRequestMetadata(action: any, validStatus: readonly string[]): boolean; export declare type UnknownAsyncThunkPendingAction = ReturnType>; export declare type PendingActionFromAsyncThunk = ActionFromMatcher; /** * A higher-order function that returns a function that may be used to check * whether an action was created by an async thunk action creator, and that * the action is pending. * * @public */ export declare function isPending(): (action: any) => action is UnknownAsyncThunkPendingAction; /** * A higher-order function that returns a function that may be used to check * whether an action belongs to one of the provided async thunk action creators, * and that the action is pending. * * @param asyncThunks (optional) The async thunk action creators to match against. * * @public */ export declare function isPending(...asyncThunks: AsyncThunks): (action: any) => action is PendingActionFromAsyncThunk; /** * Tests if `action` is a pending thunk action * @public */ export declare function isPending(action: any): action is UnknownAsyncThunkPendingAction; export declare type UnknownAsyncThunkRejectedAction = ReturnType>; export declare type RejectedActionFromAsyncThunk = ActionFromMatcher; /** * A higher-order function that returns a function that may be used to check * whether an action was created by an async thunk action creator, and that * the action is rejected. * * @public */ export declare function isRejected(): (action: any) => action is UnknownAsyncThunkRejectedAction; /** * A higher-order function that returns a function that may be used to check * whether an action belongs to one of the provided async thunk action creators, * and that the action is rejected. * * @param asyncThunks (optional) The async thunk action creators to match against. * * @public */ export declare function isRejected(...asyncThunks: AsyncThunks): (action: any) => action is RejectedActionFromAsyncThunk; /** * Tests if `action` is a rejected thunk action * @public */ export declare function isRejected(action: any): action is UnknownAsyncThunkRejectedAction; export declare type UnknownAsyncThunkRejectedWithValueAction = ReturnType>; export declare type RejectedWithValueActionFromAsyncThunk = ActionFromMatcher & (T extends AsyncThunk ? { payload: RejectedValue; } : unknown); /** * A higher-order function that returns a function that may be used to check * whether an action was created by an async thunk action creator, and that * the action is rejected with value. * * @public */ export declare function isRejectedWithValue(): (action: any) => action is UnknownAsyncThunkRejectedAction; /** * A higher-order function that returns a function that may be used to check * whether an action belongs to one of the provided async thunk action creators, * and that the action is rejected with value. * * @param asyncThunks (optional) The async thunk action creators to match against. * * @public */ export declare function isRejectedWithValue(...asyncThunks: AsyncThunks): (action: any) => action is RejectedWithValueActionFromAsyncThunk; /** * Tests if `action` is a rejected thunk action with value * @public */ export declare function isRejectedWithValue(action: any): action is UnknownAsyncThunkRejectedAction; export declare type UnknownAsyncThunkFulfilledAction = ReturnType>; export declare type FulfilledActionFromAsyncThunk = ActionFromMatcher; /** * A higher-order function that returns a function that may be used to check * whether an action was created by an async thunk action creator, and that * the action is fulfilled. * * @public */ export declare function isFulfilled(): (action: any) => action is UnknownAsyncThunkFulfilledAction; /** * A higher-order function that returns a function that may be used to check * whether an action belongs to one of the provided async thunk action creators, * and that the action is fulfilled. * * @param asyncThunks (optional) The async thunk action creators to match against. * * @public */ export declare function isFulfilled(...asyncThunks: AsyncThunks): (action: any) => action is FulfilledActionFromAsyncThunk; /** * Tests if `action` is a fulfilled thunk action * @public */ export declare function isFulfilled(action: any): action is UnknownAsyncThunkFulfilledAction; export declare type UnknownAsyncThunkAction = UnknownAsyncThunkPendingAction | UnknownAsyncThunkRejectedAction | UnknownAsyncThunkFulfilledAction; export declare type AnyAsyncThunk = { pending: { match: (action: any) => action is any; }; fulfilled: { match: (action: any) => action is any; }; rejected: { match: (action: any) => action is any; }; }; export declare type ActionsFromAsyncThunk = ActionFromMatcher | ActionFromMatcher | ActionFromMatcher; /** * A higher-order function that returns a function that may be used to check * whether an action was created by an async thunk action creator. * * @public */ export declare function isAsyncThunkAction(): (action: any) => action is UnknownAsyncThunkAction; /** * A higher-order function that returns a function that may be used to check * whether an action belongs to one of the provided async thunk action creators. * * @param asyncThunks (optional) The async thunk action creators to match against. * * @public */ export declare function isAsyncThunkAction(...asyncThunks: AsyncThunks): (action: any) => action is ActionsFromAsyncThunk; /** * Tests if `action` is a thunk action * @public */ export declare function isAsyncThunkAction(action: any): action is UnknownAsyncThunkAction;