import { inspect } from 'node:util'; import { Exception } from '@poppinss/utils/exception'; import type { Dumper } from './dumper.ts'; import type { Kernel } from '../ace/kernel.ts'; import type { HttpContext } from '../http/main.ts'; /** * DumpDie exception raised by the "dd" (dump and die) function. * This special exception terminates execution while dumping the provided * value as HTML (during HTTP requests) or ANSI (in console/CLI). * * @example * ```ts * // This will dump the user object and terminate * dumper.dd(user) * * // In HTTP context: sends HTML dump to browser * // In CLI context: prints ANSI dump to console * ``` */ declare class DumpDieException extends Exception { #private; static status: number; static code: string; fileName: string; lineNumber: number; value: unknown; constructor(value: unknown, dumper: Dumper); /** * Set the stack trace index for determining the source location. * This is useful when building nested helpers on top of dump/die functionality. * * @param index - Stack trace index (0 = current function, 1 = caller, etc.) */ setTraceSourceIndex(index: number): this; /** * Preventing itself from getting reported by the * AdonisJS exception reporter */ report(): void; /** * HTTP exception handler that renders the dump as HTML output. * This method is called automatically by AdonisJS when a DumpDieException * is thrown during an HTTP request. * * @param error - The DumpDieException instance * @param ctx - HTTP context for the current request */ handle(error: DumpDieException, ctx: HttpContext): Promise; /** * Ace command exception handler that renders the dump as ANSI output. * This method is called automatically by the Ace kernel when a DumpDieException * is thrown during command execution. * * @param error - The DumpDieException instance * @param kernel - Ace kernel instance */ render(error: DumpDieException, kernel: Kernel): Promise; /** * Custom output for the Node.js util inspect */ [inspect.custom](): string; } export declare const E_DUMP_DIE_EXCEPTION: typeof DumpDieException; export {};