idea-html2pdf
Advanced tools
Comparing version 1.0.0 to 1.0.1
/// <reference types="node" /> | ||
import { Lambda } from 'aws-sdk'; | ||
import { SafeString } from 'handlebars'; | ||
import { S3 } from 'idea-aws'; | ||
@@ -23,2 +24,10 @@ import { Languages, SignedURL } from 'idea-toolbox'; | ||
/** | ||
* Compile an Handlebars template. | ||
*/ | ||
handlebarsCompile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate; | ||
/** | ||
* Return a new safe string for Handlebars templates. | ||
*/ | ||
handlebarsSafeString(str: string): SafeString; | ||
/** | ||
* Create a new PDF created by an HTML source. | ||
@@ -25,0 +34,0 @@ * @param params the parameters to create the PDF |
@@ -38,2 +38,14 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/** | ||
* Compile an Handlebars template. | ||
*/ | ||
handlebarsCompile(input, options) { | ||
return handlebars_1.compile(input, options); | ||
} | ||
/** | ||
* Return a new safe string for Handlebars templates. | ||
*/ | ||
handlebarsSafeString(str) { | ||
return new handlebars_1.SafeString(str); | ||
} | ||
/** | ||
* Create a new PDF created by an HTML source. | ||
@@ -97,3 +109,3 @@ * @param params the parameters to create the PDF | ||
const variables = { _template, _data }; | ||
return new handlebars_1.default.SafeString(handlebars_1.default.compile(htmlInnerTemplate, { compat: true })(variables)); | ||
return new handlebars_1.SafeString(handlebars_1.compile(htmlInnerTemplate, { compat: true })(variables)); | ||
}, | ||
@@ -104,3 +116,3 @@ isFieldABoolean: (data, value) => typeof data[value] === 'boolean', | ||
label: (label) => (label ? label[language] || label[languages.default] : null), | ||
mdToHTML: (s) => (typeof s === 'string' ? new handlebars_1.default.SafeString(idea_toolbox_1.mdToHtml(s)) : s), | ||
mdToHTML: (s) => (typeof s === 'string' ? new handlebars_1.SafeString(idea_toolbox_1.mdToHtml(s)) : s), | ||
translate: (s) => s && additionalTranslations && additionalTranslations[s] ? additionalTranslations[s] : s | ||
@@ -107,0 +119,0 @@ }; |
{ | ||
"name": "idea-html2pdf", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "IDEA helper for generating a PDF from HTML contents", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30392
623