parser-de-notas-de-corretagem 0.4.4 → 0.5.1

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
@@ -1,3 +1,5 @@
1
+ import { AssetCrawler, AssetVerbosity } from "./asset-crawler";
2
+ import { CashDividendShortVersion, StockDividendShortVersion } from './types/corporative-events';
1
3
  /** Deal made in a `NegotiationNote` type */
2
4
  export interface Deal {
3
5
  /** Deal type */
@@ -63,17 +65,22 @@ export declare class UnknownAsset extends Error {
63
65
  }
64
66
  /** Brokerage notes parser */
65
67
  export declare class NoteParser {
66
- /** Path to the JSON data file */
67
- private stockParser;
68
+ /** Info about the assets */
69
+ assetCrawler: AssetCrawler;
68
70
  /** The date format used. Default is `dd/MM/yyyy` */
69
71
  private dateFormat;
72
+ /** Set the verbosity level. Actually it's the same as the crawler */
73
+ private _verbosity;
74
+ /** Set the verbosity level */
75
+ set verbosity(v: AssetVerbosity);
76
+ get verbosity(): AssetVerbosity;
70
77
  /**
71
78
  * Instantiate a new `NoteParser`
72
79
  * @param autoUpdateLookUpList whether the application should auto-update
73
80
  * the list of assets for new changes every week. Default is `false`. Require internet connection.
74
81
  * Updating this package to the latest version also gets the latest infos
75
82
  */
76
- constructor(autoUpdateLookUpList?: boolean);
83
+ constructor(autoUpdateLookUpList?: boolean, verbosity?: AssetVerbosity);
77
84
  /**
78
85
  * Set the date format
79
86
  * @param format a `DateFormat`
@@ -93,6 +100,13 @@ export declare class NoteParser {
93
100
  * @param cnpj stock CNPJ
94
101
  */
95
102
  defineStock(code: string, name: string, cnpj?: string, isFII?: boolean): void;
103
+ /**
104
+ * Get the stock dividends and the cash dividends of a given asset, if any
105
+ * @param code the asset code (letter only)
106
+ * @returns and `Array` where the first position is the list of stock dividends
107
+ * and the second position is a list of the cash dividends
108
+ */
109
+ getDividends(code: string): [StockDividendShortVersion[], CashDividendShortVersion[]];
96
110
  /**
97
111
  * Convert a date according to `dateFormat`
98
112
  * @param date the date to be formatted