errors.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Base class for errors. In addition to a `code` and a human-friendly
  3. * `message`, may also includes the token `stem` as well as other fields.
  4. *
  5. * @public
  6. */
  7. export declare class NumberFormatError extends Error {
  8. code: string;
  9. /** @internal */
  10. constructor(code: string, msg: string);
  11. }
  12. /** @internal */
  13. export declare class BadOptionError extends NumberFormatError {
  14. stem: string;
  15. option: string;
  16. constructor(stem: string, opt: string);
  17. }
  18. /** @internal */
  19. export declare class BadStemError extends NumberFormatError {
  20. stem: string;
  21. constructor(stem: string);
  22. }
  23. /** @internal */
  24. export declare class MaskedValueError extends NumberFormatError {
  25. type: string;
  26. prev: unknown;
  27. constructor(type: string, prev: unknown);
  28. }
  29. /** @internal */
  30. export declare class MissingOptionError extends NumberFormatError {
  31. stem: string;
  32. constructor(stem: string);
  33. }
  34. /** @internal */
  35. export declare class PatternError extends NumberFormatError {
  36. char: string;
  37. constructor(char: string, msg: string);
  38. }
  39. /** @internal */
  40. export declare class TooManyOptionsError extends NumberFormatError {
  41. stem: string;
  42. options: string[];
  43. constructor(stem: string, options: string[], maxOpt: number);
  44. }
  45. /** @internal */
  46. export declare class UnsupportedError extends NumberFormatError {
  47. stem: string;
  48. source?: string;
  49. constructor(stem: string, source?: string);
  50. }