Skip to content

Commit 5a0f977

Browse files
clean up
(cherry picked from commit a651044591ecfd20409e5e004aa71c6da0561386) # Conflicts: # packages/core/src/index.ts
1 parent 3d24bfd commit 5a0f977

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"description": "The jimp monorepo.",
44
"repository": "jimp-dev/jimp",
55
"author": "Andrew Lisowski <[email protected]>",
6+
"engines": {
7+
"node": ">=18"
8+
},
69
"scripts": {
710
"build": "turbo run build",
811
"dev": "turbo run dev",

packages/core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"devDependencies": {
1919
"@jimp/config-eslint": "workspace:*",
2020
"@jimp/config-typescript": "workspace:*",
21+
"@types/file-type": "^10.9.1",
2122
"eslint": "^8.57.0",
2223
"tshy": "^1.12.0",
2324
"typescript": "^5.4.2",

packages/core/src/index.ts

+9
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,18 @@ export class Jimp<
7676
> implements JimpClass
7777
{
7878
static plugins: JimpPlugin[] = [];
79+
/**
80+
* Plugins that add image formats
81+
*/
7982
static formatPlugins: JimpFormat[] = [];
83+
/**
84+
* Formats that can be used with Jimp
85+
*/
8086
static formats: Format[] = [];
8187

88+
/**
89+
* The bitmap data of the image
90+
*/
8291
bitmap: Bitmap = emptyBitmap;
8392
methods: MethodMap = {} as MethodMap;
8493
formats: Format<SupportedMimeTypes>[] = [];

packages/jimp/src/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ import blit from "@jimp/plugin-blit";
66
import png from "@jimp/js-png";
77

88
export const Jimp = JimpCustom
9-
// .addFormat(png)
9+
// Formats
10+
.addFormat(png)
11+
// Plugins
1012
.plugin(blit)
1113
.plugin(crop);
1214

1315
const image = new Jimp();
1416

1517
image
18+
// doesn't work because blit is added first
1619
.blit({ src: image, x: 0, y: 0 })
1720
.crop(0, 0, image.bitmap.width, image.bitmap.height)
1821
.blit({ src: image, x: 0, y: 0 })
@@ -21,4 +24,6 @@ image
2124
image
2225
.crop(0, 0, image.bitmap.width, image.bitmap.height)
2326
.blit({ src: image, x: 0, y: 0 })
27+
// doesn't work because becuase of type returned from crop?
28+
// maybe its the same issue as above?
2429
.crop(0, 0, image.bitmap.width, image.bitmap.height);

pnpm-lock.yaml

+10-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)