@@ -102,20 +102,19 @@ export type BaseActionCreator<P, T extends string, M = never, E = never> = {
102102 *
103103 * @public
104104 */
105- export interface ActionCreatorWithPreparedPayload <
105+ export type ActionCreatorWithPreparedPayload <
106106 Args extends unknown [ ] ,
107107 P ,
108108 T extends string = string ,
109109 E = never ,
110110 M = never ,
111- > extends BaseActionCreator < P , T , M , E > {
111+ > = BaseActionCreator < P , T , M , E > &
112112 /**
113113 * Calling this {@link redux#ActionCreator} with `Args` will return
114114 * an Action with a payload of type `P` and (depending on the `PrepareAction`
115115 * method used) a `meta`- and `error` property of types `M` and `E` respectively.
116116 */
117- ( ...args : Args ) : PayloadAction < P , T , M , E >
118- }
117+ ( ( ...args : Args ) => PayloadAction < P , T , M , E > )
119118
120119/**
121120 * An action creator of type `T` that takes an optional payload of type `P`.
@@ -124,15 +123,16 @@ export interface ActionCreatorWithPreparedPayload<
124123 *
125124 * @public
126125 */
127- export interface ActionCreatorWithOptionalPayload < P , T extends string = string >
128- extends BaseActionCreator < P , T > {
126+ export type ActionCreatorWithOptionalPayload <
127+ P ,
128+ T extends string = string ,
129+ > = BaseActionCreator < P , T > &
129130 /**
130131 * Calling this {@link redux#ActionCreator} with an argument will
131132 * return a {@link PayloadAction} of type `T` with a payload of `P`.
132133 * Calling it without an argument will return a PayloadAction with a payload of `undefined`.
133134 */
134- ( payload ?: P ) : PayloadAction < P , T >
135- }
135+ ( ( payload ?: P ) => PayloadAction < P , T > )
136136
137137/**
138138 * An action creator of type `T` that takes no payload.
@@ -141,14 +141,13 @@ export interface ActionCreatorWithOptionalPayload<P, T extends string = string>
141141 *
142142 * @public
143143 */
144- export interface ActionCreatorWithoutPayload < T extends string = string >
145- extends BaseActionCreator < undefined , T > {
146- /**
147- * Calling this {@link redux#ActionCreator} will
148- * return a {@link PayloadAction} of type `T` with a payload of `undefined`
149- */
150- ( noArgument : void ) : PayloadAction < undefined , T >
151- }
144+ export type ActionCreatorWithoutPayload < T extends string = string > =
145+ BaseActionCreator < undefined , T > &
146+ /**
147+ * Calling this {@link redux#ActionCreator} will
148+ * return a {@link PayloadAction} of type `T` with a payload of `undefined`
149+ */
150+ ( ( noArgument : void ) => PayloadAction < undefined , T > )
152151
153152/**
154153 * An action creator of type `T` that requires a payload of type P.
@@ -157,14 +156,15 @@ export interface ActionCreatorWithoutPayload<T extends string = string>
157156 *
158157 * @public
159158 */
160- export interface ActionCreatorWithPayload < P , T extends string = string >
161- extends BaseActionCreator < P , T > {
159+ export type ActionCreatorWithPayload <
160+ P ,
161+ T extends string = string ,
162+ > = BaseActionCreator < P , T > &
162163 /**
163164 * Calling this {@link redux#ActionCreator} with an argument will
164165 * return a {@link PayloadAction} of type `T` with a payload of `P`
165166 */
166- ( payload : P ) : PayloadAction < P , T >
167- }
167+ ( ( payload : P ) => PayloadAction < P , T > )
168168
169169/**
170170 * An action creator of type `T` whose `payload` type could not be inferred. Accepts everything as `payload`.
@@ -173,16 +173,14 @@ export interface ActionCreatorWithPayload<P, T extends string = string>
173173 *
174174 * @public
175175 */
176- export interface ActionCreatorWithNonInferrablePayload <
177- T extends string = string ,
178- > extends BaseActionCreator < unknown , T > {
179- /**
180- * Calling this {@link redux#ActionCreator} with an argument will
181- * return a {@link PayloadAction} of type `T` with a payload
182- * of exactly the type of the argument.
183- */
184- < PT > ( payload : PT ) : PayloadAction < PT , T >
185- }
176+ export type ActionCreatorWithNonInferrablePayload < T extends string = string > =
177+ BaseActionCreator < unknown , T > &
178+ /**
179+ * Calling this {@link redux#ActionCreator} with an argument will
180+ * return a {@link PayloadAction} of type `T` with a payload
181+ * of exactly the type of the argument.
182+ */
183+ ( < PT > ( payload : PT ) => PayloadAction < PT , T > )
186184
187185/**
188186 * An action creator that produces actions with a `payload` attribute.
0 commit comments