@e-mc/image 0.12.9 → 0.13.1
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 +5 -5
- package/package.json +2 -2
- package/types/index.d.ts +1 -24
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @e-mc/image
|
|
2
2
|
|
|
3
|
-
* NodeJS 18
|
|
3
|
+
* NodeJS 18.20.5 LTS
|
|
4
4
|
* ES2022
|
|
5
5
|
|
|
6
6
|
## General Usage
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.13.1/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IHost, ModuleConstructor } from "./index";
|
|
@@ -95,9 +95,9 @@ NOTE: Usage without a **Host** is conducted through static methods. The **using*
|
|
|
95
95
|
|
|
96
96
|
## References
|
|
97
97
|
|
|
98
|
-
- https://www.unpkg.com/@e-mc/types@0.
|
|
99
|
-
- https://www.unpkg.com/@e-mc/types@0.
|
|
100
|
-
- https://www.unpkg.com/@e-mc/types@0.
|
|
98
|
+
- https://www.unpkg.com/@e-mc/types@0.13.1/lib/asset.d.ts
|
|
99
|
+
- https://www.unpkg.com/@e-mc/types@0.13.1/lib/image.d.ts
|
|
100
|
+
- https://www.unpkg.com/@e-mc/types@0.13.1/lib/settings.d.ts
|
|
101
101
|
|
|
102
102
|
## LICENSE
|
|
103
103
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Image constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"license": "BSD-3-Clause",
|
|
20
20
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@e-mc/core": "0.
|
|
22
|
+
"@e-mc/core": "0.13.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Dimension, Point } from '@e-mc/types/lib/image';
|
|
2
|
-
|
|
3
1
|
export interface ImageHandler<T, U, V, W = void, X = void> {
|
|
4
2
|
readonly handler: T;
|
|
5
3
|
host: U | null;
|
|
@@ -12,29 +10,8 @@ export interface ImageHandler<T, U, V, W = void, X = void> {
|
|
|
12
10
|
quality?(): void;
|
|
13
11
|
background?(value: unknown): void;
|
|
14
12
|
write(output: string, callback?: (err: unknown, result: string) => void): W;
|
|
15
|
-
getBuffer(tempFile?: boolean, saveAs?: string): Promise<
|
|
13
|
+
getBuffer(tempFile?: boolean, saveAs?: string): Promise<Bufferable | null>;
|
|
16
14
|
finalize(output: string, callback: (err: unknown, result: string) => void): void;
|
|
17
15
|
get rotateCount(): number;
|
|
18
16
|
get aborted(): boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface WebpMuxFrame extends Dimension, Point {
|
|
22
|
-
delay: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface WebpMuxImage extends Readonly<Dimension> {
|
|
26
|
-
readonly anim: { loops: number; bgColor: [number, number, number, number] };
|
|
27
|
-
initLib(): Promise<void>;
|
|
28
|
-
load(value: string | Buffer): Promise<void>;
|
|
29
|
-
demux(options: { path?: string; prefix?: string; buffers?: boolean }): Promise<void>;
|
|
30
|
-
getImageData(): Promise<Uint8Array>;
|
|
31
|
-
getFrameData(frame: number): Promise<Uint8Array>;
|
|
32
|
-
setFrameData(frame: number, source: Buffer, options: Dimension & { preset?: string; quality?: number; exact?: boolean; lossless?: number; method?: number }): Promise<void>;
|
|
33
|
-
save(path: string, options: Dimension & { bgColor?: number[] }): Promise<void>;
|
|
34
|
-
get hasAnim(): boolean;
|
|
35
|
-
get frames(): WebpMuxFrame[];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface WebpMux {
|
|
39
|
-
Image: new() => WebpMuxImage;
|
|
40
17
|
}
|