extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} with `Args` will return\n * an Action with a payload of type `P` and (depending on the `PrepareAction`\n * method used) a `meta`- and `error` property of types `M` and `E` respectively.\n */\n (...args: Args): PayloadAction
;\n}\n/**\n * An action creator of type `T` that takes an optional payload of type `P`.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\n\nexport interface ActionCreatorWithOptionalPayload
extends BaseActionCreator
{\n /**\n * Calling this {@link redux#ActionCreator} with an argument will\n * return a {@link PayloadAction} of type `T` with a payload of `P`.\n * Calling it without an argument will return a PayloadAction with a payload of `undefined`.\n */\n (payload?: P): PayloadAction
;\n}\n/**\n * An action creator of type `T` that takes no payload.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\n\nexport interface ActionCreatorWithoutPayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} will\n * return a {@link PayloadAction} of type `T` with a payload of `undefined`\n */\n (noArgument: void): PayloadAction;\n}\n/**\n * An action creator of type `T` that requires a payload of type P.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\n\nexport interface ActionCreatorWithPayload extends BaseActionCreator
{\n /**\n * Calling this {@link redux#ActionCreator} with an argument will\n * return a {@link PayloadAction} of type `T` with a payload of `P`\n */\n (payload: P): PayloadAction
;\n}\n/**\n * An action creator of type `T` whose `payload` type could not be inferred. Accepts everything as `payload`.\n *\n * @inheritdoc {redux#ActionCreator}\n *\n * @public\n */\n\nexport interface ActionCreatorWithNonInferrablePayload extends BaseActionCreator {\n /**\n * Calling this {@link redux#ActionCreator} with an argument will\n * return a {@link PayloadAction} of type `T` with a payload\n * of exactly the type of the argument.\n */\n (payload: PT): PayloadAction;\n}\n/**\n * An action creator that produces actions with a `payload` attribute.\n *\n * @typeParam P the `payload` type\n * @typeParam T the `type` of the resulting action\n * @typeParam PA if the resulting action is preprocessed by a `prepare` method, the signature of said method.\n *\n * @public\n */\n\nexport type PayloadActionCreator | void = void> = IfPrepareActionMethodProvided, // else\nIsAny, IsUnknownOrNonInferrable
, // else\nIfVoid
, // else\nIfMaybeUndefined
, // else\nActionCreatorWithPayload
>>>>>;\n/**\n * A utility function to create an action creator for the given action type\n * string. The action creator accepts a single argument, which will be included\n * in the action object as a field called payload. The action creator function\n * will also have its toString() overridden so that it returns the action type.\n *\n * @param type The action type to use for created actions.\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\n *\n * @public\n */\n\nexport function createAction
(type: T): PayloadActionCreator
;\n/**\n * A utility function to create an action creator for the given action type\n * string. The action creator accepts a single argument, which will be included\n * in the action object as a field called payload. The action creator function\n * will also have its toString() overridden so that it returns the action type.\n *\n * @param type The action type to use for created actions.\n * @param prepare (optional) a method that takes any number of arguments and returns { payload } or { payload, meta }.\n * If this is given, the resulting action creator will pass its arguments to this method to calculate payload & meta.\n *\n * @public\n */\n\nexport function createAction, T extends string = string>(type: T, prepareAction: PA): PayloadActionCreator['payload'], T, PA>;\nexport function createAction(type: string, prepareAction?: Function): any {\n function actionCreator(...args: any[]) {\n if (prepareAction) {\n let prepared = prepareAction(...args);\n\n if (!prepared) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(0) : 'prepareAction did not return an object');\n }\n\n return {\n type,\n payload: prepared.payload,\n ...('meta' in prepared && {\n meta: prepared.meta\n }),\n ...('error' in prepared && {\n error: prepared.error\n })\n };\n }\n\n return {\n type,\n payload: args[0]\n };\n }\n\n actionCreator.toString = () => `${type}`;\n\n actionCreator.type = type;\n\n actionCreator.match = (action: unknown): action is PayloadAction => isAction(action) && action.type === type;\n\n return actionCreator;\n}\n/**\n * Returns true if value is an RTK-like action creator, with a static type property and match method.\n */\n\nexport function isActionCreator(action: unknown): action is BaseActionCreator & Function {\n return typeof action === 'function' && 'type' in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it\n hasMatchFunction((action as any));\n}\n/**\n * Returns true if value is an action with a string type and valid Flux Standard Action keys.\n */\n\nexport function isFSA(action: unknown): action is {\n type: string;\n payload?: unknown;\n error?: unknown;\n meta?: unknown;\n} {\n return isAction(action) && Object.keys(action).every(isValidKey);\n}\n\nfunction isValidKey(key: string) {\n return ['type', 'payload', 'error', 'meta'].indexOf(key) > -1;\n} // helper types for more readable typings\n\n\ntype IfPrepareActionMethodProvided | void, True, False> = PA extends (...args: any[]) => any ? True : False;","import { Action } from '../types/actions';\nimport isPlainObject from './isPlainObject';\nexport default function isAction(action: unknown): action is Action {\n return isPlainObject(action) && 'type' in action && typeof (action as Record<'type', unknown>).type === 'string';\n}","import type { Middleware, UnknownAction } from 'redux';\nimport type { ThunkMiddleware } from 'redux-thunk';\nimport { thunk as thunkMiddleware, withExtraArgument } from 'redux-thunk';\nimport type { ActionCreatorInvariantMiddlewareOptions } from './actionCreatorInvariantMiddleware';\nimport { createActionCreatorInvariantMiddleware } from './actionCreatorInvariantMiddleware';\nimport type { ImmutableStateInvariantMiddlewareOptions } from './immutableStateInvariantMiddleware';\n/* PROD_START_REMOVE_UMD */\n\nimport { createImmutableStateInvariantMiddleware } from './immutableStateInvariantMiddleware';\n/* PROD_STOP_REMOVE_UMD */\n\nimport type { SerializableStateInvariantMiddlewareOptions } from './serializableStateInvariantMiddleware';\nimport { createSerializableStateInvariantMiddleware } from './serializableStateInvariantMiddleware';\nimport type { ExcludeFromTuple } from './tsHelpers';\nimport { Tuple } from './utils';\n\nfunction isBoolean(x: any): x is boolean {\n return typeof x === 'boolean';\n}\n\ninterface ThunkOptions {\n extraArgument: E;\n}\ninterface GetDefaultMiddlewareOptions {\n thunk?: boolean | ThunkOptions;\n immutableCheck?: boolean | ImmutableStateInvariantMiddlewareOptions;\n serializableCheck?: boolean | SerializableStateInvariantMiddlewareOptions;\n actionCreatorCheck?: boolean | ActionCreatorInvariantMiddlewareOptions;\n}\nexport type ThunkMiddlewareFor = O extends {\n thunk: false;\n} ? never : O extends {\n thunk: {\n extraArgument: infer E;\n };\n} ? ThunkMiddleware : ThunkMiddleware;\nexport type GetDefaultMiddleware = (options?: O) => Tuple], never>>;\nexport const buildGetDefaultMiddleware = (): GetDefaultMiddleware