From a8d716911bf965621685694a13705a11ab0f7878 Mon Sep 17 00:00:00 2001 From: "EMEA\\norbertvirth" Date: Wed, 15 May 2019 17:17:11 +0200 Subject: [PATCH 1/2] Created TypeScript definitions file --- printThis.d.ts | 118 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 printThis.d.ts diff --git a/printThis.d.ts b/printThis.d.ts new file mode 100644 index 0000000..277d33e --- /dev/null +++ b/printThis.d.ts @@ -0,0 +1,118 @@ +interface JQuery { + printThis(args?: IPrintThisOptions); +} + +interface IPrintThisOptions { + /** + * show the iframe for debugging + * default value: false + */ + debug?: boolean, + + /** + * import parent page css + * default value: true + */ + importCSS?: boolean, + + /** + * import style tags + * default value: false + */ + importStyle?: boolean, + + /** + * print outer container/$.selector + * default value: true + */ + printContainer?: boolean, + + /** + * path to additional css file - use an array [] for multiple + */ + loadCSS?: string, + + /** + * add title to print page + */ + pageTitle?: string, + + /** + * remove inline styles from print elements + * default value: false + */ + removeInline?: boolean, + + /** + * custom selectors to filter inline styles. removeInline must be true + * default value: "*" + */ + removeInlineSelector?: string, + + /** + * variable print delay + * default value: 333 + */ + printDelay?: number, + + /** + * prefix to html + */ + header?: JQuery | string, + + /** + * postfix to html + */ + footer?: JQuery | string, + + /** + * preserve the BASE tag or accept a string for the URL + * default value: false + */ + base?: boolean, + + /** + * preserve input/form values + * default value: true + */ + formValues?: boolean, + + /** + * copy canvas content + * default value: false + */ + canvas?: boolean, + + /** + * enter a different doctype for older markup + * default value: '' + */ + doctypeString?: string, + + /** + * remove script tags from print content + * default value: false + */ + removeScripts?: boolean, + + /** + * copy classes from the html & body tag + * default value: false + */ + copyTagClasses?: boolean, + + /** + * callback function for printEvent in iframe + */ + beforePrintEvent?: Function, + + /** + * function called before iframe is filled + */ + beforePrint?: Function, + + /** + * function called before iframe is removed + */ + afterPrint?: Function +} \ No newline at end of file From f9db36f3d300e350a2919875a9fea3289fa61341 Mon Sep 17 00:00:00 2001 From: Samuel Rouse Date: Wed, 15 May 2019 19:56:07 -0400 Subject: [PATCH 2/2] Update TypeScript Definitions base supports a boolean or string. --- printThis.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/printThis.d.ts b/printThis.d.ts index 277d33e..244f86f 100644 --- a/printThis.d.ts +++ b/printThis.d.ts @@ -69,7 +69,7 @@ interface IPrintThisOptions { * preserve the BASE tag or accept a string for the URL * default value: false */ - base?: boolean, + base?: boolean | string, /** * preserve input/form values @@ -115,4 +115,4 @@ interface IPrintThisOptions { * function called before iframe is removed */ afterPrint?: Function -} \ No newline at end of file +}