/**
 * ```ts
 * import type { ArangoError, HttpError } from "arangojs/errors";
 * ```
 *
 * The "errors" module provides types and interfaces for TypeScript related
 * to arangojs error handling.
 *
 * @packageDocumentation
 */
/// <reference types="node" resolution-mode="require"/>
import * as connection from "./connection.js";
/**
 * Indicates whether the given value represents an {@link ArangoError}.
 *
 * @param error - A value that might be an `ArangoError`.
 */
export declare function isArangoError(error: any): error is ArangoError;
/**
 * Indicates whether the given value represents a {@link NetworkError}.
 *
 * @param error - A value that might be a `NetworkError`.
 */
export declare function isNetworkError(error: any): error is NetworkError;
/**
 * @internal
 *
 * Indicates whether the given value represents a Node.js `SystemError`.
 */
export declare function isSystemError(err: any): err is SystemError;
/**
 * @internal
 *
 * Indicates whether the given value represents a Node.js `UndiciError`.
 */
export declare function isUndiciError(err: any): err is UndiciError;
/**
 * Interface representing a Node.js `UndiciError`.
 *
 * @internal
 */
export interface UndiciError extends Error {
    code: `UND_${string}`;
}
/**
 * Interface representing a Node.js `SystemError`.
 *
 * @internal
 */
export interface SystemError extends Error {
    code: string;
    errno: number | string;
    syscall: string;
}
/**
 * Represents an error from a deliberate timeout encountered while waiting
 * for propagation.
 */
export declare class PropagationTimeoutError extends Error {
    name: string;
    constructor(message?: string, options?: {
        cause?: Error;
    });
}
/**
 * Represents a network error or an error encountered while performing a network request.
 */
export declare class NetworkError extends Error {
    name: string;
    /**
     * Indicates whether the request that caused this error can be safely retried.
     */
    isSafeToRetry: boolean | null;
    /**
     * Fetch request object.
     */
    request: globalThis.Request;
    constructor(message: string, request: globalThis.Request, options?: {
        cause?: Error;
        isSafeToRetry?: boolean | null;
    });
    toJSON(): {
        error: boolean;
        errorMessage: string;
        code: number;
    };
}
/**
 * Represents an error from a deliberate timeout encountered while waiting
 * for a server response.
 */
export declare class ResponseTimeoutError extends NetworkError {
    name: string;
    constructor(message: string | undefined, request: globalThis.Request, options?: {
        cause?: Error;
        isSafeToRetry?: boolean | null;
    });
}
/**
 * Represents an error from a request that was aborted.
 */
export declare class RequestAbortedError extends NetworkError {
    name: string;
    constructor(message: string | undefined, request: globalThis.Request, options?: {
        cause?: Error;
        isSafeToRetry?: boolean | null;
    });
}
/**
 * Represents an error from a failed fetch request.
 *
 * The root cause is often extremely difficult to determine.
 */
export declare class FetchFailedError extends NetworkError {
    name: string;
    constructor(message: string | undefined, request: globalThis.Request, options?: {
        cause?: Error;
        isSafeToRetry?: boolean | null;
    });
}
/**
 * Represents a plain HTTP error response.
 */
export declare class HttpError extends NetworkError {
    name: string;
    /**
     * HTTP status code of the server response.
     */
    code: number;
    /**
     * Server response object.
     */
    response: connection.ProcessedResponse;
    /**
     * @internal
     */
    constructor(response: connection.ProcessedResponse, options?: {
        cause?: Error;
        isSafeToRetry?: boolean | null;
    });
    toJSON(): {
        error: boolean;
        errorMessage: string;
        code: number;
    };
    toString(): string;
}
/**
 * Represents an error returned by ArangoDB.
 */
export declare class ArangoError extends Error {
    name: string;
    /**
     * Indicates whether the request that caused this error can be safely retried.
     *
     * @internal
     */
    isSafeToRetry: boolean | null;
    /**
     * @internal
     */
    get error(): true;
    /**
     * ArangoDB error code.
     *
     * See [ArangoDB error documentation](https://www.arangodb.com/docs/stable/appendix-error-codes.html).
     */
    errorNum: number;
    /**
     * Error message accompanying the error code.
     */
    get errorMessage(): string;
    /**
     * HTTP status code included in the server error response object.
     */
    code?: number;
    /**
     * @internal
     *
     * Creates a new `ArangoError` from a response object.
     */
    static from(response: connection.ProcessedResponse<connection.ArangoErrorResponse>): ArangoError;
    /**
     * Creates a new `ArangoError` from an ArangoDB error response.
     */
    constructor(data: Omit<connection.ArangoErrorResponse, "error">, options?: {
        cause?: Error;
        isSafeToRetry?: boolean | null;
    });
    /**
     * Server response object.
     */
    get response(): connection.ProcessedResponse<connection.ArangoErrorResponse> | undefined;
    /**
     * Fetch request object.
     */
    get request(): globalThis.Request | undefined;
    /**
     * @internal
     *
     * Indicates that this object represents an ArangoDB error.
     */
    get isArangoError(): true;
    toJSON(): connection.ArangoErrorResponse;
    toString(): string;
}
//# sourceMappingURL=errors.d.ts.map