@@ -1167,10 +1167,10 @@ export type Actions<
11671167 */
11681168export type ActionResult <
11691169 Success extends Record < string , unknown > | undefined = Record < string , any > ,
1170- Invalid extends Record < string , unknown > | undefined = Record < string , any >
1170+ Failure extends Record < string , unknown > | undefined = Record < string , any >
11711171> =
11721172 | { type : 'success' ; status : number ; data ?: Success }
1173- | { type : 'failure' ; status : number ; data ?: Invalid }
1173+ | { type : 'failure' ; status : number ; data ?: Failure }
11741174 | { type : 'redirect' ; status : number ; location : string }
11751175 | { type : 'error' ; status ?: number ; error : any } ;
11761176
@@ -1239,7 +1239,7 @@ export function text(body: string, init?: ResponseInit): Response;
12391239 * @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
12401240 * @param data Data associated with the failure (e.g. validation errors)
12411241 */
1242- export function fail < T extends Record < string , unknown > | undefined > (
1242+ export function fail < T extends Record < string , unknown > | undefined = undefined > (
12431243 status : number ,
12441244 data ?: T
12451245) : ActionFailure < T > ;
@@ -1257,7 +1257,7 @@ export interface ActionFailure<T extends Record<string, unknown> | undefined = u
12571257
12581258export interface SubmitFunction <
12591259 Success extends Record < string , unknown > | undefined = Record < string , any > ,
1260- Invalid extends Record < string , unknown > | undefined = Record < string , any >
1260+ Failure extends Record < string , unknown > | undefined = Record < string , any >
12611261> {
12621262 ( input : {
12631263 action : URL ;
@@ -1271,7 +1271,7 @@ export interface SubmitFunction<
12711271 | ( ( opts : {
12721272 form : HTMLFormElement ;
12731273 action : URL ;
1274- result : ActionResult < Success , Invalid > ;
1274+ result : ActionResult < Success , Failure > ;
12751275 /**
12761276 * Call this to get the default behavior of a form submission response.
12771277 * @param options Set `reset: false` if you don't want the `<form>` values to be reset after a successful submission.
0 commit comments