parser-de-notas-de-corretagem 0.4.3 → 0.5.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/README.md CHANGED
@@ -133,6 +133,13 @@ async function main() {
133
133
  main();
134
134
  ```
135
135
 
136
+ ### Browser
137
+ Since only `Uint8Array` is accepted, use the following code to convert a string using the browser
138
+ ```JavaScript
139
+ if (typeof fileContent === 'string') fileContent = Uint8Array.from(fileContent, x => x.charCodeAt(0));
140
+ assetsParser.parseNote(filePath, fileContent, filePasswords);
141
+ ```
142
+
136
143
  ### Add a custom stock
137
144
  ```Typescript
138
145
  const assets = new NoteParser();
package/notes-parser.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CashDividendShortVersion, StockDividendShortVersion } from './types/corporative-events';
1
2
  /** Deal made in a `NegotiationNote` type */
2
3
  export interface Deal {
3
4
  /** Deal type */
@@ -93,6 +94,13 @@ export declare class NoteParser {
93
94
  * @param cnpj stock CNPJ
94
95
  */
95
96
  defineStock(code: string, name: string, cnpj?: string, isFII?: boolean): void;
97
+ /**
98
+ * Get the stock dividends and the cash dividends of a given asset, if any
99
+ * @param code the asset code (letter only)
100
+ * @returns and `Array` where the first position is the list of stock dividends
101
+ * and the second position is a list of the cash dividends
102
+ */
103
+ getDividends(code: string): [StockDividendShortVersion[], CashDividendShortVersion[]];
96
104
  /**
97
105
  * Convert a date according to `dateFormat`
98
106
  * @param date the date to be formatted