@@ -46,12 +46,14 @@ export type SafeActionResult<
46
46
Data = unknown ,
47
47
// eslint-disable-next-line
48
48
NextCtx = unknown ,
49
- > = {
50
- data? : Data ;
51
- serverError? : ServerError ;
52
- validationErrors? : CVE ;
53
- bindArgsValidationErrors? : CBAVE ;
54
- };
49
+ > =
50
+ | {
51
+ data? : Data ;
52
+ serverError? : ServerError ;
53
+ validationErrors? : CVE ;
54
+ bindArgsValidationErrors? : CBAVE ;
55
+ };
56
+ | undefined ;
55
57
```
56
58
57
59
### ` SafeActionFn `
@@ -175,30 +177,30 @@ Type of action execution callbacks. These are called after the action is execute
175
177
176
178
``` typescript
177
179
export type SafeActionCallbacks <
178
- ServerError ,
179
- S extends Schema | undefined ,
180
- BAS extends readonly Schema [],
181
- CVE ,
182
- CBAVE ,
183
- Data ,
180
+ ServerError ,
181
+ S extends Schema | undefined ,
182
+ BAS extends readonly Schema [],
183
+ CVE ,
184
+ CBAVE ,
185
+ Data ,
184
186
> = {
185
- onSuccess? : (args : {
186
- data? : Data ;
187
- clientInput: S extends Schema ? InferIn <S > : undefined ;
188
- bindArgsClientInputs: InferInArray <BAS >;
189
- parsedInput: S extends Schema ? Infer <S > : undefined ;
190
- bindArgsParsedInputs: InferArray <BAS >;
191
- }) => MaybePromise <void >;
192
- onError? : (args : {
193
- error: Omit <SafeActionResult <ServerError , S , BAS , CVE , CBAVE , Data >, " data" >;
194
- clientInput: S extends Schema ? InferIn <S > : undefined ;
195
- bindArgsClientInputs: InferInArray <BAS >;
196
- }) => MaybePromise <void >;
197
- onSettled? : (args : {
198
- result: SafeActionResult <ServerError , S , BAS , CVE , CBAVE , Data >;
199
- clientInput: S extends Schema ? InferIn <S > : undefined ;
200
- bindArgsClientInputs: InferInArray <BAS >;
201
- }) => MaybePromise <void >;
187
+ onSuccess? : (args : {
188
+ data? : Data ;
189
+ clientInput: S extends Schema ? InferIn <S > : undefined ;
190
+ bindArgsClientInputs: InferInArray <BAS >;
191
+ parsedInput: S extends Schema ? Infer <S > : undefined ;
192
+ bindArgsParsedInputs: InferArray <BAS >;
193
+ }) => MaybePromise <void >;
194
+ onError? : (args : {
195
+ error: Omit <SafeActionResult <ServerError , S , BAS , CVE , CBAVE , Data >, " data" >;
196
+ clientInput: S extends Schema ? InferIn <S > : undefined ;
197
+ bindArgsClientInputs: InferInArray <BAS >;
198
+ }) => MaybePromise <void >;
199
+ onSettled? : (args : {
200
+ result: SafeActionResult <ServerError , S , BAS , CVE , CBAVE , Data >;
201
+ clientInput: S extends Schema ? InferIn <S > : undefined ;
202
+ bindArgsClientInputs: InferInArray <BAS >;
203
+ }) => MaybePromise <void >;
202
204
};
203
205
```
204
206
@@ -282,7 +284,7 @@ export type HookResult<
282
284
CVE ,
283
285
CBAVE ,
284
286
Data ,
285
- > = SafeActionResult <ServerError , S , BAS , CVE , CBAVE , Data > & {
287
+ > = NonNullable < SafeActionResult <ServerError , S , BAS , CVE , CBAVE , Data > > & {
286
288
fetchError? : string ;
287
289
};
288
290
` ` `
0 commit comments