-
-
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.
chore(.prettierignore): ignore auto-generate types
- Loading branch information
Showing
3 changed files
with
52 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,7 @@ dist | |
package.json | ||
API.md | ||
CHANGELOG.md | ||
/types/index.d.ts | ||
|
||
# lock files | ||
bun.lockb | ||
|
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 |
---|---|---|
@@ -1,56 +1,53 @@ | ||
export default UnRTF; | ||
export class UnRTF { | ||
/** | ||
* @param {string} [binPath] - Path of UnRTF binary. | ||
* If not provided, the constructor will attempt to find the binary | ||
* in the PATH environment variable. | ||
* | ||
* For `win32`, a binary is bundled with the package and will be used | ||
* if a local installation is not found. | ||
*/ | ||
constructor(binPath?: string); | ||
/** @type {string|undefined} */ | ||
unrtfPath: string | undefined; | ||
/** @type {string|undefined} */ | ||
unrtfVersion: string | undefined; | ||
/** @type {object} */ | ||
unrtfAcceptedOptions: object; | ||
/** | ||
* @author Frazer Smith | ||
* @description 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. | ||
* @param {string} file - Filepath of the RTF file to read. | ||
* @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). | ||
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object. | ||
*/ | ||
convert( | ||
file: string, | ||
options?: { | ||
noPictures?: boolean; | ||
noRemap?: boolean; | ||
outputHtml?: boolean; | ||
outputLatex?: boolean; | ||
outputPs?: boolean; | ||
outputRtf?: boolean; | ||
outputText?: boolean; | ||
outputVt?: boolean; | ||
outputWpml?: boolean; | ||
printVersionInfo?: boolean; | ||
quiet?: boolean; | ||
} | ||
): Promise<string>; | ||
/** | ||
* @param {string} [binPath] - Path of UnRTF binary. | ||
* If not provided, the constructor will attempt to find the binary | ||
* in the PATH environment variable. | ||
* | ||
* For `win32`, a binary is bundled with the package and will be used | ||
* if a local installation is not found. | ||
*/ | ||
constructor(binPath?: string); | ||
/** @type {string|undefined} */ | ||
unrtfPath: string | undefined; | ||
/** @type {string|undefined} */ | ||
unrtfVersion: string | undefined; | ||
/** @type {object} */ | ||
unrtfAcceptedOptions: object; | ||
/** | ||
* @author Frazer Smith | ||
* @description 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. | ||
* @param {string} file - Filepath of the RTF file to read. | ||
* @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). | ||
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object. | ||
*/ | ||
convert(file: string, options?: { | ||
noPictures?: boolean; | ||
noRemap?: boolean; | ||
outputHtml?: boolean; | ||
outputLatex?: boolean; | ||
outputPs?: boolean; | ||
outputRtf?: boolean; | ||
outputText?: boolean; | ||
outputVt?: boolean; | ||
outputWpml?: boolean; | ||
printVersionInfo?: boolean; | ||
quiet?: boolean; | ||
}): Promise<string>; | ||
} |