import { Exception } from '@adonisjs/core/exceptions'; import type { HttpContext } from '@adonisjs/core/http'; import { type Document, type ErrorObject } from './types.ts'; /** * An exception that carries JSON:API error objects. Thrown by the plugin * itself (invalid include paths, unknown sort fields, ...) and available * to userland for custom errors. */ /** * Formats acceptable JSON:API types for an error detail: '"a" or "b"'. */ export declare function formatTypeList(types: string[]): string; export declare class JsonApiException extends Exception { static status: number; static code: string; errors: ErrorObject[]; constructor(errors: ErrorObject | ErrorObject[], options?: { status?: number; code?: string; }); static invalidQueryParameter(parameter: string, detail: string): JsonApiException; } /** * Converts any thrown error into a JSON:API errors document. Wired into the * application exception handler so every error response is spec-compliant. */ export declare function toErrorDocument(error: unknown, debug: boolean): { status: number; body: Document; }; /** * Sends a JSON:API error response for the given error. Returns false when * the request did not ask for JSON so the default handler can render it. */ export declare function renderJsonApiError(error: unknown, ctx: HttpContext, debug: boolean): void;