Skip to content

Commit

Permalink
fix(index): return types don't support promise rejection values
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Jun 2, 2023
1 parent bce0174 commit f7f13f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

* [UnRTF](#UnRTF)
* [new UnRTF([binPath])](#new_UnRTF_new)
* [.convert(file, [options])](#UnRTF+convert) ⇒ <code>Promise.&lt;(string\|Error)&gt;</code>
* [.convert(file, [options])](#UnRTF+convert) ⇒ <code>Promise.&lt;string&gt;</code>

<a name="new_UnRTF_new"></a>

Expand All @@ -17,13 +17,13 @@

<a name="UnRTF+convert"></a>

### unRTF.convert(file, [options]) ⇒ <code>Promise.&lt;(string\|Error)&gt;</code>
### unRTF.convert(file, [options]) ⇒ <code>Promise.&lt;string&gt;</code>
Converts an RTF file to HTML/LaTeX/RTF/TXT.
Defaults to HTML output if no `output*` options are provided.
UnRTF will use the directory of the original file to store embedded pictures.

**Kind**: instance method of [<code>UnRTF</code>](#UnRTF)
**Returns**: <code>Promise.&lt;(string\|Error)&gt;</code> - Promise of stdout string on resolve, or Error object on rejection.
**Returns**: <code>Promise.&lt;string&gt;</code> - A promise that resolves with a stdout string, or rejects with an `Error` object.
**Author**: Frazer Smith

| Param | Type | Description |
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class UnRTF {
* @param {boolean=} options.outputWpml - Generate WPML output (UnRTF v0.19.4 or earlier only).
* @param {boolean=} options.printVersionInfo - Print copyright and version info.
* @param {boolean=} options.quiet - Do not print any leading comments in output (UnRTF v0.21.3 or later only).
* @returns {Promise<string|Error>} Promise of stdout string on resolve, or Error object on rejection.
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
*/
async convert(file, options = {}) {
const acceptedOptions = {
Expand Down
7 changes: 2 additions & 5 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ export class UnRTF {
* @param {boolean=} options.outputWpml - Generate WPML output (UnRTF v0.19.4 or earlier only).
* @param {boolean=} options.printVersionInfo - Print copyright and version info.
* @param {boolean=} options.quiet - Do not print any leading comments in output (UnRTF v0.21.3 or later only).
* @returns {Promise<string|Error>} Promise of stdout string on resolve, or Error object on rejection.
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
*/
convert(
file: string,
options?: object | undefined
): Promise<string | Error>;
convert(file: string, options?: object | undefined): Promise<string>;
}

0 comments on commit f7f13f2

Please sign in to comment.