-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(index): add typescript definitions
- Loading branch information
Frazer Smith
committed
Oct 26, 2020
1 parent
c26a83e
commit e2203a6
Showing
6 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export class UnRTF { | ||
/** | ||
* @param {string=} binPath - Path of UnRTF binary. | ||
* Useful for Linux users who have UnRTF binary already installed. | ||
*/ | ||
constructor(binPath?: string | undefined); | ||
unrtfPath: string; | ||
/** | ||
* @author Frazer Smith | ||
* @description Converts a RTF file to HTML/LaTeX/RTF/TXT. | ||
* UnRTF will use the directory of the original file to store embedded pictures. | ||
* @param {object} options - Object containing options to pass to binary. | ||
* @param {boolean=} options.noPictures - Disable the automatic storing of embedded | ||
* pictures to the directory of the original file. | ||
* @param {boolean=} options.noRemap - Disable charset conversion (only works for 8-bit charsets) | ||
* (UnRTF v0.20.5 or later only). | ||
* @param {boolean=} options.outputHtml - Generate HTML output. | ||
* @param {boolean=} options.outputLatex - Generate LaTeX output. | ||
* @param {boolean=} options.outputPs - Generate PostScript (PS) output (UnRTF v0.19.4 or earlier only). | ||
* @param {boolean=} options.outputRtf - Generate RTF output. (UnRTF v0.21.3 or later only). | ||
* @param {boolean=} options.outputText - Generate ASCII text output. | ||
* @param {boolean=} options.outputVt - Generate text output with VT100 escape codes. | ||
* @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). | ||
* @param {string} file - Filepath of the RTF file to read. | ||
* @returns {Promise<string|Error>} Promise of stdout string on resolve, or Error object on rejection. | ||
*/ | ||
convert(options: { | ||
noPictures?: boolean | undefined; | ||
noRemap?: boolean | undefined; | ||
outputHtml?: boolean | undefined; | ||
outputLatex?: boolean | undefined; | ||
outputPs?: boolean | undefined; | ||
outputRtf?: boolean | undefined; | ||
outputText?: boolean | undefined; | ||
outputVt?: boolean | undefined; | ||
outputWpml?: boolean | undefined; | ||
printVersionInfo?: boolean | undefined; | ||
quiet?: boolean | undefined; | ||
}, file: string): Promise<string | Error>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"include": ["src/index.js"], | ||
"compilerOptions": { | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"allowJs": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters