parser-de-notas-de-corretagem 0.8.78 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/notes-parser.d.ts CHANGED
@@ -44,26 +44,55 @@ export declare class NegotiationNote {
44
44
  }
45
45
  /** Possible date formats to be used */
46
46
  export type DateFormat = "dd/MM/yyyy" | "yyyy-MM-dd";
47
+ /** Base custom error */
48
+ declare class BaseError extends Error {
49
+ /** File that triggered the error */
50
+ file: string;
51
+ /**
52
+ * Create a custom error
53
+ * @param message error message
54
+ * @param file the file name that triggered the error
55
+ */
56
+ constructor(message: string, file: string);
57
+ }
47
58
  /** Wrong password error */
48
- export declare class WrongPassword extends Error {
59
+ export declare class WrongPassword extends BaseError {
60
+ /** Tested passwords */
61
+ passwords: string[];
62
+ /**
63
+ * Create a custom error
64
+ * @param message error message
65
+ * @param file the file name that triggered the error
66
+ * @param passwords tested passwords
67
+ */
68
+ constructor(message: string, file: string, passwords: string[]);
49
69
  }
50
70
  /** Empty document error */
51
- export declare class EmptyDocument extends Error {
71
+ export declare class EmptyDocument extends BaseError {
52
72
  }
53
73
  /** Document without note number error */
54
- export declare class MissingNoteNumber extends Error {
74
+ export declare class MissingNoteNumber extends BaseError {
55
75
  }
56
76
  /** Document without holder error */
57
- export declare class MissingHolder extends Error {
77
+ export declare class MissingHolder extends BaseError {
58
78
  }
59
79
  /** Document without date error */
60
- export declare class MissingDate extends Error {
80
+ export declare class MissingDate extends BaseError {
61
81
  }
62
82
  /** Missing Buy or Sell sums */
63
- export declare class MissingBuyOrSellSums extends Error {
83
+ export declare class MissingBuyOrSellSums extends BaseError {
64
84
  }
65
85
  /** Unknown Asset error error */
66
- export declare class UnknownAsset extends Error {
86
+ export declare class UnknownAsset extends BaseError {
87
+ /** The unknown asset name in the note */
88
+ asset: string;
89
+ /**
90
+ * Create a custom error
91
+ * @param message error message
92
+ * @param file the file name that triggered the error
93
+ * @param asset the unknown asset name in the note
94
+ */
95
+ constructor(message: string, file: string, asset: string);
67
96
  }
68
97
  /** Brokerage notes parser */
69
98
  export declare class NoteParser {