lib.es2022.error.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*! *****************************************************************************
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  4. this file except in compliance with the License. You may obtain a copy of the
  5. License at http://www.apache.org/licenses/LICENSE-2.0
  6. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  8. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  9. MERCHANTABLITY OR NON-INFRINGEMENT.
  10. See the Apache Version 2.0 License for specific language governing permissions
  11. and limitations under the License.
  12. ***************************************************************************** */
  13. /// <reference no-default-lib="true"/>
  14. interface ErrorOptions {
  15. cause?: Error;
  16. }
  17. interface Error {
  18. cause?: Error;
  19. }
  20. interface ErrorConstructor {
  21. new (message?: string, options?: ErrorOptions): Error;
  22. (message?: string, options?: ErrorOptions): Error;
  23. }
  24. interface EvalErrorConstructor {
  25. new (message?: string, options?: ErrorOptions): EvalError;
  26. (message?: string, options?: ErrorOptions): EvalError;
  27. }
  28. interface RangeErrorConstructor {
  29. new (message?: string, options?: ErrorOptions): RangeError;
  30. (message?: string, options?: ErrorOptions): RangeError;
  31. }
  32. interface ReferenceErrorConstructor {
  33. new (message?: string, options?: ErrorOptions): ReferenceError;
  34. (message?: string, options?: ErrorOptions): ReferenceError;
  35. }
  36. interface SyntaxErrorConstructor {
  37. new (message?: string, options?: ErrorOptions): SyntaxError;
  38. (message?: string, options?: ErrorOptions): SyntaxError;
  39. }
  40. interface TypeErrorConstructor {
  41. new (message?: string, options?: ErrorOptions): TypeError;
  42. (message?: string, options?: ErrorOptions): TypeError;
  43. }
  44. interface URIErrorConstructor {
  45. new (message?: string, options?: ErrorOptions): URIError;
  46. (message?: string, options?: ErrorOptions): URIError;
  47. }
  48. interface AggregateErrorConstructor {
  49. new (
  50. errors: Iterable<any>,
  51. message?: string,
  52. options?: ErrorOptions
  53. ): AggregateError;
  54. (
  55. errors: Iterable<any>,
  56. message?: string,
  57. options?: ErrorOptions
  58. ): AggregateError;
  59. }