@rnacanvas/utilities 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DownloadableFile.d.ts +17 -0
- package/dist/DownloadableFile.d.ts.map +1 -0
- package/dist/detectMac.d.ts +7 -0
- package/dist/detectMac.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a file that can be downloaded.
|
|
3
|
+
*/
|
|
4
|
+
export declare class DownloadableFile {
|
|
5
|
+
private textContent;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a downloadable file with the given text content.
|
|
8
|
+
*/
|
|
9
|
+
constructor(textContent: string);
|
|
10
|
+
/**
|
|
11
|
+
* Offers the file to the user for download with the given name and type.
|
|
12
|
+
*/
|
|
13
|
+
downloadAs(name: string, options: {
|
|
14
|
+
type: string;
|
|
15
|
+
}): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=DownloadableFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadableFile.d.ts","sourceRoot":"","sources":["../src/DownloadableFile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAgB;IAIf,OAAO,CAAC,WAAW;IAH/B;;OAEG;gBACiB,WAAW,EAAE,MAAM;IAEvC;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAc1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectMac.d.ts","sourceRoot":"","sources":["../src/detectMac.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAOnC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.utilities=t():e.utilities=t()}(this,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.utilities=t():e.utilities=t()}(this,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function o(e){return e.map((function(e){return{v:e,priority:Math.random()}})).sort((function(e,t){return e.priority-t.priority})).map((function(e){return e.v}))}function n(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(e){return!1}}e.r(t),e.d(t,{DownloadableFile:()=>r,detectMac:()=>n,shuffled:()=>o});var r=function(){function e(e){this.textContent=e}return e.prototype.downloadAs=function(e,t){var o=new File([this.textContent],e,{type:t.type}),n=URL.createObjectURL(o),r=document.createElement("a");r.href=n,r.download=o.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)},e}();return t})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnacanvas/utilities",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "General utilities",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@babel/preset-typescript": "^7.23.3",
|
|
16
16
|
"babel-jest": "^29.7.0",
|
|
17
17
|
"jest": "^29.7.0",
|
|
18
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
18
19
|
"ts-loader": "^9.5.1",
|
|
19
20
|
"typescript": "^5.3.3",
|
|
20
21
|
"webpack": "^5.89.0",
|