heic-to 1.0.1 → 1.0.2

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 CHANGED
@@ -11,7 +11,7 @@ Currently, heic-to is using [libheif 1.18.2](https://github.com/strukturag/libhe
11
11
  #### Check whether the image is HEIC or not
12
12
 
13
13
  ```js
14
- import { isHeic } from "hiec-to"
14
+ import { isHeic } from "heic-to"
15
15
 
16
16
  const file = field.files[0]
17
17
  await isHeic(file)
@@ -21,7 +21,7 @@ await isHeic(file)
21
21
 
22
22
 
23
23
  ```js
24
- import { heicTo } from "hiec-to"
24
+ import { heicTo } from "heic-to"
25
25
 
26
26
  const file = field.files[0]
27
27
 
@@ -69,4 +69,4 @@ cd libheif
69
69
  mkdir buildjs
70
70
  cd buildjs
71
71
  USE_WASM=0 ../build-emscripten.sh ..
72
- ```
72
+ ```
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Checks if a file is in HEIC format.
3
+ * @param file - The file to check.
4
+ * @returns A promise that resolves to true if the file is HEIC, false otherwise.
5
+ */
6
+ export declare function isHeic(file: File): Promise<boolean>;
7
+
8
+ /**
9
+ * Options for converting HEIC images.
10
+ */
11
+ export interface HeicToOptions {
12
+ /**
13
+ * The HEIC image blob to convert.
14
+ */
15
+ blob: Blob;
16
+
17
+ /**
18
+ * The desired output image MIME type (e.g., 'image/jpeg', 'image/png').
19
+ */
20
+ type: string;
21
+
22
+ /**
23
+ * The quality of the output image, between 0 and 1.
24
+ */
25
+ quality?: number;
26
+ }
27
+
28
+ /**
29
+ * Converts a HEIC image to another format.
30
+ * @param options - The conversion options.
31
+ * @returns A promise that resolves to the converted image blob.
32
+ */
33
+ export declare function heicTo(options: HeicToOptions): Promise<Blob>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heic-to",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Converting HEIF/HEIF image formats to PNG/JPEG in the browser",
5
5
  "main": "dist/heic-to.js",
6
6
  "scripts": {
@@ -11,8 +11,17 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/hoppergee/heic-to.git"
13
13
  },
14
+ "types": "dist/heic-to.d.ts",
14
15
  "keywords": [
15
- "heic", "heif", "jpeg", "jpg", "png", "conversion", "convert", "image", "decoder"
16
+ "heic",
17
+ "heif",
18
+ "jpeg",
19
+ "jpg",
20
+ "png",
21
+ "conversion",
22
+ "convert",
23
+ "image",
24
+ "decoder"
16
25
  ],
17
26
  "author": "Hopper Gee",
18
27
  "license": "LGPL-3.0",