@therms/web-js
Advanced tools
Comparing version 2.5.3 to 2.6.0
@@ -0,1 +1,8 @@ | ||
# [2.6.0](https://bitbucket.org/thermsio/web-js/compare/v2.5.3...v2.6.0) (2022-09-01) | ||
### Features | ||
* add downloadBase64AsPdf() ([28e4f3e](https://bitbucket.org/thermsio/web-js/commits/28e4f3e41310eb986d6fb471bc5e4f0fa710ccb3)) | ||
## [2.5.3](https://bitbucket.org/thermsio/web-js/compare/v2.5.2...v2.5.3) (2022-08-21) | ||
@@ -2,0 +9,0 @@ |
@@ -60,2 +60,3 @@ import { CookieAttributes } from "js-cookie"; | ||
declare const b2bComms: BrowserToBrowserCommunications; | ||
declare function downloadBase64AsPdf(fileName: string, pdfBase64: string): void; | ||
declare const deleteCookie: (name: string, opts?: CookieAttributes) => void; | ||
@@ -84,3 +85,3 @@ declare const getCookie: (name: string) => string | undefined; | ||
declare function deepFreeze(object: any, clone?: boolean): any; | ||
declare function deepMerge<T>(target: T, ...sources: any[]): T; | ||
declare function deepMerge<T = any>(target: T, ...sources: any[]): T; | ||
type Device = { | ||
@@ -138,3 +139,3 @@ name: string; | ||
declare const sleep: (ms: number) => Promise<unknown>; | ||
interface EventPayload<Payload> { | ||
interface EventPayload<Payload = any> { | ||
payload?: Payload; | ||
@@ -157,2 +158,2 @@ topic: string; | ||
declare const globalVent: any; | ||
export { Timezone, timezones, checkIsBrowserVisible, onBrowserVisibilityChange, setBrowserTitle, flashBrowserTitle, b2bComms, deleteCookie, getCookie, setCookie, formatAddress, getColorContrast, randomHEXColor, dateWithinRange, getNumberWithOrdinal, humanizeMinutes, humanizeMillis, roundToNearestMin, setLocaleFirstDayOfWeek, deepClone, deepFreeze, deepMerge, Device, requestGeolocation, requestNotifications, requestPush, requestCamera, requestMicrophone, checkDevicePermissions, getDevice, isMobileDevice, isEmail, isHexColor, isIsoDate, isUrl, isPlural, pluralize, PromiseTimeoutError, PromiseController, retryPromise, sleep, Vent, globalVent }; | ||
export { Timezone, timezones, checkIsBrowserVisible, onBrowserVisibilityChange, setBrowserTitle, flashBrowserTitle, b2bComms, downloadBase64AsPdf, deleteCookie, getCookie, setCookie, formatAddress, getColorContrast, randomHEXColor, dateWithinRange, getNumberWithOrdinal, humanizeMinutes, humanizeMillis, roundToNearestMin, setLocaleFirstDayOfWeek, deepClone, deepFreeze, deepMerge, Device, requestGeolocation, requestNotifications, requestPush, requestCamera, requestMicrophone, checkDevicePermissions, getDevice, isMobileDevice, isEmail, isHexColor, isIsoDate, isUrl, isPlural, pluralize, PromiseTimeoutError, PromiseController, retryPromise, sleep, Vent, globalVent }; |
@@ -405,2 +405,10 @@ 'use strict'; | ||
function downloadBase64AsPdf(fileName, pdfBase64) { | ||
const linkSource = `data:application/pdf;base64,${pdfBase64}`; | ||
const downloadLink = document.createElement('a'); | ||
downloadLink.href = linkSource; | ||
downloadLink.download = `${fileName}.pdf`; | ||
downloadLink.click(); | ||
} | ||
const deleteCookie = (name, opts) => { | ||
@@ -851,2 +859,3 @@ Cookie__default["default"].remove(name, opts); | ||
exports.deleteCookie = deleteCookie; | ||
exports.downloadBase64AsPdf = downloadBase64AsPdf; | ||
exports.flashBrowserTitle = flashBrowserTitle; | ||
@@ -853,0 +862,0 @@ exports.formatAddress = formatAddress; |
@@ -60,2 +60,3 @@ import { CookieAttributes } from "js-cookie"; | ||
declare const b2bComms: BrowserToBrowserCommunications; | ||
declare function downloadBase64AsPdf(fileName: string, pdfBase64: string): void; | ||
declare const deleteCookie: (name: string, opts?: CookieAttributes) => void; | ||
@@ -84,3 +85,3 @@ declare const getCookie: (name: string) => string | undefined; | ||
declare function deepFreeze(object: any, clone?: boolean): any; | ||
declare function deepMerge<T>(target: T, ...sources: any[]): T; | ||
declare function deepMerge<T = any>(target: T, ...sources: any[]): T; | ||
type Device = { | ||
@@ -138,3 +139,3 @@ name: string; | ||
declare const sleep: (ms: number) => Promise<unknown>; | ||
interface EventPayload<Payload> { | ||
interface EventPayload<Payload = any> { | ||
payload?: Payload; | ||
@@ -157,2 +158,2 @@ topic: string; | ||
declare const globalVent: any; | ||
export { Timezone, timezones, checkIsBrowserVisible, onBrowserVisibilityChange, setBrowserTitle, flashBrowserTitle, b2bComms, deleteCookie, getCookie, setCookie, formatAddress, getColorContrast, randomHEXColor, dateWithinRange, getNumberWithOrdinal, humanizeMinutes, humanizeMillis, roundToNearestMin, setLocaleFirstDayOfWeek, deepClone, deepFreeze, deepMerge, Device, requestGeolocation, requestNotifications, requestPush, requestCamera, requestMicrophone, checkDevicePermissions, getDevice, isMobileDevice, isEmail, isHexColor, isIsoDate, isUrl, isPlural, pluralize, PromiseTimeoutError, PromiseController, retryPromise, sleep, Vent, globalVent }; | ||
export { Timezone, timezones, checkIsBrowserVisible, onBrowserVisibilityChange, setBrowserTitle, flashBrowserTitle, b2bComms, downloadBase64AsPdf, deleteCookie, getCookie, setCookie, formatAddress, getColorContrast, randomHEXColor, dateWithinRange, getNumberWithOrdinal, humanizeMinutes, humanizeMillis, roundToNearestMin, setLocaleFirstDayOfWeek, deepClone, deepFreeze, deepMerge, Device, requestGeolocation, requestNotifications, requestPush, requestCamera, requestMicrophone, checkDevicePermissions, getDevice, isMobileDevice, isEmail, isHexColor, isIsoDate, isUrl, isPlural, pluralize, PromiseTimeoutError, PromiseController, retryPromise, sleep, Vent, globalVent }; |
@@ -395,2 +395,10 @@ import Cookie from 'js-cookie'; | ||
function downloadBase64AsPdf(fileName, pdfBase64) { | ||
const linkSource = `data:application/pdf;base64,${pdfBase64}`; | ||
const downloadLink = document.createElement('a'); | ||
downloadLink.href = linkSource; | ||
downloadLink.download = `${fileName}.pdf`; | ||
downloadLink.click(); | ||
} | ||
const deleteCookie = (name, opts) => { | ||
@@ -830,3 +838,3 @@ Cookie.remove(name, opts); | ||
export { PromiseController, PromiseTimeoutError, Timezone, Vent, b2bComms, checkDevicePermissions, checkIsBrowserVisible, dateWithinRange, deepClone, deepFreeze, deepMerge, deleteCookie, flashBrowserTitle, formatAddress, getColorContrast, getCookie, getDevice, getNumberWithOrdinal, globalVent, humanizeMillis, humanizeMinutes, isEmail, isHexColor, isIsoDate, isMobileDevice, isPlural, isUrl, onBrowserVisibilityChange, pluralize, randomHEXColor, requestCamera, requestGeolocation, requestMicrophone, requestNotifications, requestPush, retryPromise, roundToNearestMin, setBrowserTitle, setCookie, setLocaleFirstDayOfWeek, sleep, timezones }; | ||
export { PromiseController, PromiseTimeoutError, Timezone, Vent, b2bComms, checkDevicePermissions, checkIsBrowserVisible, dateWithinRange, deepClone, deepFreeze, deepMerge, deleteCookie, downloadBase64AsPdf, flashBrowserTitle, formatAddress, getColorContrast, getCookie, getDevice, getNumberWithOrdinal, globalVent, humanizeMillis, humanizeMinutes, isEmail, isHexColor, isIsoDate, isMobileDevice, isPlural, isUrl, onBrowserVisibilityChange, pluralize, randomHEXColor, requestCamera, requestGeolocation, requestMicrophone, requestNotifications, requestPush, retryPromise, roundToNearestMin, setBrowserTitle, setCookie, setLocaleFirstDayOfWeek, sleep, timezones }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"license": "UNLICENSED", | ||
"name": "@therms/web-js", | ||
"version": "2.5.3", | ||
"version": "2.6.0", | ||
"description": "Common web/JS tools & utilities", | ||
@@ -6,0 +6,0 @@ "main": "./dist/cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
190453
1991
0