parser-de-notas-de-corretagem 0.0.5 → 0.1.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
@@ -75,7 +75,7 @@ Easing the PITA of making IRRF
75
75
 
76
76
  ## Usage
77
77
 
78
- ### Full example
78
+ ### Full NodeJS example
79
79
  ```Typescript
80
80
  import fs from 'fs';
81
81
  import path from 'path';
@@ -91,7 +91,7 @@ async function main() {
91
91
  // Get all negotiation notes inside a PDF, even with password
92
92
  const possiblePDFpasswords: string[] = ['123', '456'];
93
93
  let pdfPath = path.join(__dirname, 'note.pdf');
94
- let parseResult = await assets.parseNote(pdfPath, possiblePDFpasswords);
94
+ let parseResult = await assets.parseNote(path.basename(pdfPath), fs.readFileSync(pdfPath), possiblePDFpasswords);
95
95
 
96
96
  // Merge all negotiation notes
97
97
  let allDeals: Deal[][] = [];
package/notes-parser.d.ts CHANGED
@@ -102,10 +102,11 @@ export declare class NoteParser {
102
102
  setDateFormat(format: DateFormat): void;
103
103
  /**
104
104
  * Read and parse a given PDF negotiation note by its full path
105
- * @param noteFullPath the full path to the PDF note to be parsed
105
+ * @param name PDF name
106
+ * @param content PDF content
106
107
  * @returns an `Array` of `NegotiationNote`
107
108
  */
108
- parseNote(noteFullPath: string, possiblePasswords?: string[]): Promise<NegotiationNote[]>;
109
+ parseNote(noteName: string, content: Uint8Array, possiblePasswords?: string[]): Promise<NegotiationNote[]>;
109
110
  /**
110
111
  * Add stock definition
111
112
  * @param code stock code