image-exporter 1.2.1 → 1.2.3
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/README.md +1 -2
- package/dist/capture/download-images.d.ts.map +1 -1
- package/dist/index.browser.js +21 -23
- package/dist/index.browser.js.map +5 -6
- package/dist/index.cjs +20 -132
- package/dist/index.cjs.map +5 -6
- package/dist/index.js +20 -132
- package/dist/index.js.map +5 -6
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +1 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ImageOptions {
|
|
2
|
+
/** Label for image. Does not include file extension or scale. */
|
|
3
|
+
label: Label;
|
|
4
|
+
/** File format, jpg, png, or svg. */
|
|
5
|
+
format: Format;
|
|
6
|
+
/** Scale of image. Can be a number or a comma-separated list of numbers. */
|
|
7
|
+
scale: Scale;
|
|
8
|
+
/** Quality of image. 0.0 to 1.0, only applies to jpg.*/
|
|
9
|
+
quality: Quality;
|
|
10
|
+
/** Include scale in label. True or false. Automatically true if scale is an array. */
|
|
11
|
+
includeScaleInLabel: IncludeScaleInLabel;
|
|
12
|
+
}
|
|
13
|
+
export interface Config extends ImageOptions {
|
|
14
|
+
/** Download images as files upon capture. */
|
|
15
|
+
downloadImages: boolean;
|
|
16
|
+
/** Default label for images. Does not include file extension or scale. */
|
|
17
|
+
defaultImageLabel: string;
|
|
18
|
+
/** Label for zip file. Does not include file extension or scale. */
|
|
19
|
+
zipLabel: Label;
|
|
20
|
+
/** Base URL for CORS proxy used when fetching external images.
|
|
21
|
+
*
|
|
22
|
+
* URLs will be encoded and appended without a `?`. Include your own trailing slash.
|
|
23
|
+
*
|
|
24
|
+
* I recommend [cors-proxy-worker](https://github.com/briantuckerdesign/cors-proxy-worker) for production and [local-cors-proxy-encoded](https://github.com/briantuckerdesign/local-cors-proxy-encoded) for development.
|
|
25
|
+
*
|
|
26
|
+
* Example: `https://cors-proxy.com/` -> `https://cors-proxy.com/https%3A%2F%2FmyEncodedUrl.com`
|
|
27
|
+
*/
|
|
28
|
+
corsProxyBaseUrl: string;
|
|
29
|
+
/** Enable window logging for use by external scripts. */
|
|
30
|
+
enableWindowLogging: boolean;
|
|
31
|
+
/** Enable verbose logging for debugging. */
|
|
32
|
+
loggingLevel: LoggingLevel;
|
|
33
|
+
}
|
|
34
|
+
export interface ParsedImageOptions extends ImageOptions {
|
|
35
|
+
/** After parsing, this will always be a number rather than possibly an array. */
|
|
36
|
+
scale: number;
|
|
37
|
+
}
|
|
38
|
+
export interface Image {
|
|
39
|
+
dataURL: string;
|
|
40
|
+
fileName: string;
|
|
41
|
+
}
|
|
42
|
+
export type Label = string;
|
|
43
|
+
export type Format = "jpg" | "png" | "svg" | "webp";
|
|
44
|
+
export type Scale = number | number[];
|
|
45
|
+
export type Quality = number;
|
|
46
|
+
export type IncludeScaleInLabel = boolean;
|
|
47
|
+
export type LoggingLevel = "none" | "info" | "error" | "verbose";
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,KAAK,EAAE,KAAK,CAAC;IACb,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,EAAE,KAAK,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,sFAAsF;IACtF,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAED,MAAM,WAAW,MAAO,SAAQ,YAAY;IAC1C,6CAA6C;IAC7C,cAAc,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,EAAE,KAAK,CAAC;IAChB;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,4CAA4C;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AACpD,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-exporter",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Easily download one or more DOM elements as images",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/briantuckerdesign/image-exporter#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"downloadjs": "^1.4.7",
|
|
49
48
|
"jszip": "^3.10.1",
|
|
50
49
|
"modern-screenshot": "^4.6.0"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@types/downloadjs": "^1.4.6",
|
|
54
52
|
"concurrently": "^9.1.2",
|
|
55
53
|
"http-server": "^14.1.1",
|
|
56
54
|
"typescript": "^5.7.3"
|