/**
 * Error is a class that enhances the debugging and error handling process. Rather than returning a generic
 * [JavaScript error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error),
 * this Error returns a standardized error object with several properties. The error class can be useful
 * in many scenarios, such as working with promises, the [esriRequest](https://developers.arcgis.com/javascript/latest/references/core/request/) module, and many different layers and widgets.
 *
 * @since 4.5
 * @see [request](https://developers.arcgis.com/javascript/latest/references/core/request/)
 * @example
 * button.on("click", function() {
 *   esriRequest(url, options).then(function(response) {
 *     // do something useful
 *   }).catch(function(error){
 *     console.log("informative error message: ", error.message);
 *   });
 * });
 */
export default class Error<T = any> {
  constructor(name: string, message: string, details?: T);
  /**
   * The details object provides additional details specific to the error,
   * giving more information about why the error was raised. For example, the details object for
   * [esriRequest](https://developers.arcgis.com/javascript/latest/references/core/request/types/#RequestErrorDetails) includes
   * additional information to help the developer diagnose issues with a problematic request.
   *
   * @example
   * someAsyncFunction.then(callback)
   *   .catch(function(error){
   *     console.log("Error details: ", error.details);
   * });
   */
  details?: T | null;
  /**
   * Message describing the error.
   *
   * @example
   * someAsyncFunction.then(callback)
   *   .catch(function(error){
   *     console.log("Error message: ", error.message);
   * });
   */
  readonly message: string;
  /**
   * A unique error name. This can be used to map to a localized error message to present to the user.
   *
   * @example
   * someAsyncFunction.then(callback)
   *   .catch(function(error){
   *     console.log("Error name: ", error.name);
   * });
   */
  readonly name: string;
}