From bd5e8907ddc11f72aa9db1087dd1995b31440b67 Mon Sep 17 00:00:00 2001 From: Lucas Mateus Date: Tue, 23 Feb 2021 09:44:29 -0300 Subject: [PATCH] Docs: improve output documentation --- src/jspdf.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/jspdf.js b/src/jspdf.js index b50eff27b..4f3a96bb8 100644 --- a/src/jspdf.js +++ b/src/jspdf.js @@ -3017,12 +3017,22 @@ function jsPDF(options) { * * If `type` argument is undefined, output is raw body of resulting PDF returned as a string. * - * @param {string} type A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow', 'pdfobjectnewwindow', 'pdfjsnewwindow'. - * @param {Object} options An object providing some additional signalling to PDF generator. Possible options are 'filename'. - * + * @param {string} type A string identifying one of the possible output types.
+ * Possible values are:
+ * 'arraybuffer' -> (ArrayBuffer)
+ * 'blob' -> (Blob)
+ * 'bloburi'/'bloburl' -> (string)
+ * 'datauristring'/'dataurlstring' -> (string)
+ * 'datauri'/'dataurl' -> (undefined) -> change location to generated datauristring/dataurlstring
+ * 'dataurlnewwindow' -> (window | null | undefined) throws error if global isn't a window object(node)
+ * 'pdfobjectnewwindow' -> (window | null) throws error if global isn't a window object(node)
+ * 'pdfjsnewwindow' -> (wind | null) + * @param {Object|string} options An object providing some additional signalling to PDF generator.
+ * Possible options are 'filename'.
+ * A string can be passed instead of {filename:string} and defaults to 'generated.pdf' * @function * @instance - * @returns {jsPDF} + * @returns {string|window|ArrayBuffer|Blob|jsPDF|null|undefined} * @memberof jsPDF# * @name output */