@pi-r/jimp 0.8.1 → 0.8.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 +6 -6
- package/package.json +29 -29
- package/types/index.d.ts +32 -32
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
### @pi-r/jimp
|
|
2
|
-
|
|
3
|
-
https://e-mc.readthedocs.io/en/latest/image
|
|
4
|
-
|
|
5
|
-
### LICENSE
|
|
6
|
-
|
|
1
|
+
### @pi-r/jimp
|
|
2
|
+
|
|
3
|
+
https://e-mc.readthedocs.io/en/latest/image
|
|
4
|
+
|
|
5
|
+
### LICENSE
|
|
6
|
+
|
|
7
7
|
MIT
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pi-r/jimp",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "Jimp image constructor for E-mc.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
12
|
-
"directory": "src/module/jimp"
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"squared",
|
|
16
|
-
"e-mc",
|
|
17
|
-
"squared-functions"
|
|
18
|
-
],
|
|
19
|
-
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@e-mc/image": "^0.10.
|
|
24
|
-
"@e-mc/types": "^0.10.
|
|
25
|
-
"bmp-js": "^0.1.0",
|
|
26
|
-
"gifwrap": "^0.10.1",
|
|
27
|
-
"jimp": "^0.22.12"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pi-r/jimp",
|
|
3
|
+
"version": "0.8.3",
|
|
4
|
+
"description": "Jimp image constructor for E-mc.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
12
|
+
"directory": "src/module/jimp"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"squared",
|
|
16
|
+
"e-mc",
|
|
17
|
+
"squared-functions"
|
|
18
|
+
],
|
|
19
|
+
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@e-mc/image": "^0.10.3",
|
|
24
|
+
"@e-mc/types": "^0.10.3",
|
|
25
|
+
"bmp-js": "^0.1.0",
|
|
26
|
+
"gifwrap": "^0.10.1",
|
|
27
|
+
"jimp": "^0.22.12"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import type { IFileManager, IHost, IImage, ImageConstructor } from '@e-mc/types/lib';
|
|
2
|
-
import type { ExternalAsset } from '@e-mc/types/lib/asset';
|
|
3
|
-
import type { TransformOptions } from '@e-mc/types/lib/image';
|
|
4
|
-
import type { ImageModule, ImageSettings } from '@e-mc/types/lib/settings';
|
|
5
|
-
import type { ExecAction } from '@e-mc/types/lib/module';
|
|
6
|
-
|
|
7
|
-
import type { ImageHandler } from '@e-mc/image/types';
|
|
8
|
-
|
|
9
|
-
import type * as jimp from 'jimp';
|
|
10
|
-
|
|
11
|
-
export interface JimpSettings extends ImageSettings {
|
|
12
|
-
jimp?: {
|
|
13
|
-
exec?: ExecAction;
|
|
14
|
-
cache_expires?: number | string;
|
|
15
|
-
rotate_clockwise?: boolean;
|
|
16
|
-
gifwrap_quantize?: "dekker" | "sorokin" | "wu" | "none";
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type ResultCallback<T = unknown, U = void, V = unknown> = (err: V, result: T) => U;
|
|
21
|
-
|
|
22
|
-
export interface IJimpHandler<T extends IHost = IHost, U extends ImageModule = ImageModule> extends ImageHandler<jimp, T, IImage<T, U>> {
|
|
23
|
-
method(): Promise<void>;
|
|
24
|
-
rotate(localFile?: string, callback?: ResultCallback<string>): Promise<this>;
|
|
25
|
-
background(value: number | [number, number, number, number]): void;
|
|
26
|
-
writeAsync(output: string, callback?: ResultCallback): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface JimpImageConstructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends ImageModule = ImageModule<JimpSettings>> extends ConstructorDerived<ImageConstructor<T, V>> {
|
|
30
|
-
transform<W extends TransformOptions>(file: string, command: string, options?: W): Promise<W extends { tempFile: true } ? string : Null<Buffer>>;
|
|
31
|
-
readonly prototype: IImage<T, V>;
|
|
32
|
-
new(module?: V, ...args: unknown[]): IImage<T, V>;
|
|
1
|
+
import type { IFileManager, IHost, IImage, ImageConstructor } from '@e-mc/types/lib';
|
|
2
|
+
import type { ExternalAsset } from '@e-mc/types/lib/asset';
|
|
3
|
+
import type { TransformOptions } from '@e-mc/types/lib/image';
|
|
4
|
+
import type { ImageModule, ImageSettings } from '@e-mc/types/lib/settings';
|
|
5
|
+
import type { ExecAction } from '@e-mc/types/lib/module';
|
|
6
|
+
|
|
7
|
+
import type { ImageHandler } from '@e-mc/image/types';
|
|
8
|
+
|
|
9
|
+
import type * as jimp from 'jimp';
|
|
10
|
+
|
|
11
|
+
export interface JimpSettings extends ImageSettings {
|
|
12
|
+
jimp?: {
|
|
13
|
+
exec?: ExecAction;
|
|
14
|
+
cache_expires?: number | string;
|
|
15
|
+
rotate_clockwise?: boolean;
|
|
16
|
+
gifwrap_quantize?: "dekker" | "sorokin" | "wu" | "none";
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ResultCallback<T = unknown, U = void, V = unknown> = (err: V, result: T) => U;
|
|
21
|
+
|
|
22
|
+
export interface IJimpHandler<T extends IHost = IHost, U extends ImageModule = ImageModule> extends ImageHandler<jimp, T, IImage<T, U>> {
|
|
23
|
+
method(): Promise<void>;
|
|
24
|
+
rotate(localFile?: string, callback?: ResultCallback<string>): Promise<this>;
|
|
25
|
+
background(value: number | [number, number, number, number]): void;
|
|
26
|
+
writeAsync(output: string, callback?: ResultCallback): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface JimpImageConstructor<T extends IFileManager<U>, U extends ExternalAsset = ExternalAsset, V extends ImageModule = ImageModule<JimpSettings>> extends ConstructorDerived<ImageConstructor<T, V>> {
|
|
30
|
+
transform<W extends TransformOptions>(file: string, command: string, options?: W): Promise<W extends { tempFile: true } ? string : Null<Buffer>>;
|
|
31
|
+
readonly prototype: IImage<T, V>;
|
|
32
|
+
new(module?: V, ...args: unknown[]): IImage<T, V>;
|
|
33
33
|
}
|