import type { Submission } from "@conform-to/dom"; import type { ActionFunction } from "react-router"; import type { ZodSchema } from "zod"; import type { SuccessResponseData } from "../hooks/use-action.js"; type RespondWithErrorOptions = { code?: number; message?: string; type?: "error" | "invalid_submission"; }; declare function respondWithError(responseData: TResponse, options?: RespondWithErrorOptions): ErrorResponse | InvalidSubmissionResponse["reply"]>>; type ErrorResponse = { status: "error"; type: "error"; result: TResult; code: number; message?: string; }; type InvalidSubmissionResponse = { status: "error"; type: "invalid_submission"; result: TResponse; code: number; message?: string; }; declare function isErrorResponse(response: any): response is ErrorResponse; declare function isSuccessResponse(response: any): response is SuccessResponseData; export { respondWithError, isErrorResponse, isSuccessResponse }; export type { ErrorResponse, InvalidSubmissionResponse };