@levischuck/tiny-png 0.0.2 → 0.0.4
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/index.d.ts +12 -0
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate an indexed-color PNG image, up to 255 colors are supported
|
|
3
|
+
*
|
|
4
|
+
* @param input - Pixel data as a Uint8Array where each byte is a palette index
|
|
5
|
+
* @param width - Image width in pixels
|
|
6
|
+
* @param height - Image height in pixels
|
|
7
|
+
* @param colors - Color palette as an array of `[R, G, B]` tuples (0-255)
|
|
8
|
+
* @returns Promise resolving to PNG file bytes as a Uint8Array
|
|
9
|
+
* @throws Error if the color palette doesn't have enough colors for the highest index in the input data.
|
|
10
|
+
* @throws Error if the input does not match the dimensions.
|
|
11
|
+
* @throws Error if the input is empty.
|
|
12
|
+
*/
|
|
1
13
|
export declare function indexedPng(input: Uint8Array, width: number, height: number, colors: [number, number, number][]): Promise<Uint8Array>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levischuck/tiny-png",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "
|
|
17
|
+
"url": "https://github.com/LeviSchuck/tiny-packages",
|
|
18
|
+
"directory": "packages/tiny-png"
|
|
18
19
|
},
|
|
19
20
|
"publishConfig": {
|
|
20
21
|
"access": "public"
|
|
@@ -31,7 +32,8 @@
|
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "vite build",
|
|
33
34
|
"prepublishOnly": "bun run build",
|
|
34
|
-
"type-check": "bunx tsc --noEmit"
|
|
35
|
+
"type-check": "bunx tsc --noEmit",
|
|
36
|
+
"build:jsr": "echo Nothing to build"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@types/bun": "latest"
|