import type { ReadonlyJSONValue } from '../../shared/src/json.ts';
/**
 * Options accepted by {@link ApplicationError}.
 *
 * Use these when you need to attach additional context to an error that will
 * be sent back to the client.
 */
export interface ApplicationErrorOptions<T extends ReadonlyJSONValue | undefined> {
    details?: T;
    cause?: unknown;
}
/**
 * Error type that application code can throw to surface structured metadata back to
 * the client.
 *
 * Use this when you want to return a descriptive message along with the
 * JSON-serializable `details`.
 */
export declare class ApplicationError<const T extends ReadonlyJSONValue | undefined = ReadonlyJSONValue | undefined> extends Error {
    #private;
    constructor(message: string, options?: ApplicationErrorOptions<T> | undefined);
    get details(): T;
    get kind(): 'Application';
}
export declare function isApplicationError(error: unknown): error is ApplicationError;
export declare function wrapWithApplicationError<T extends ReadonlyJSONValue | undefined = ReadonlyJSONValue | undefined>(error: unknown): ApplicationError<T>;
//# sourceMappingURL=application-error.d.ts.map