@e-mc/image 0.10.2 → 0.10.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/README.md +5 -4
- package/index.d.ts +4 -4
- package/package.json +3 -3
- package/types/index.d.ts +13 -5
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.4/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IHost, ModuleConstructor } from "./index";
|
|
@@ -24,6 +24,7 @@ interface IImage extends IClient<IHost, ImageModule> {
|
|
|
24
24
|
qualityData?: QualityData;
|
|
25
25
|
methodData?: [string, unknown[]?][];
|
|
26
26
|
opacityValue?: number;
|
|
27
|
+
outputType?: string;
|
|
27
28
|
setCommand(value: string | CommandData, outputAs?: string): void;
|
|
28
29
|
getCommand(): string;
|
|
29
30
|
parseCommand(value: string): CommandData;
|
|
@@ -86,9 +87,9 @@ NOTE: Usage without a **Host** is conducted through static methods. The **using*
|
|
|
86
87
|
|
|
87
88
|
## References
|
|
88
89
|
|
|
89
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
90
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
91
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
90
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/asset.d.ts
|
|
91
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/image.d.ts
|
|
92
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/settings.d.ts
|
|
92
93
|
|
|
93
94
|
## LICENSE
|
|
94
95
|
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ImageConstructor } from '
|
|
2
|
-
|
|
3
|
-
declare const Image: ImageConstructor;
|
|
4
|
-
|
|
1
|
+
import type { ImageConstructor } from '@e-mc/types/lib';
|
|
2
|
+
|
|
3
|
+
declare const Image: ImageConstructor;
|
|
4
|
+
|
|
5
5
|
export = Image;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/image",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Image constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"squared-functions"
|
|
18
18
|
],
|
|
19
19
|
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "BSD
|
|
20
|
+
"license": "BSD-3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/core": "0.10.
|
|
23
|
+
"@e-mc/core": "0.10.4"
|
|
24
24
|
}
|
|
25
25
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Point {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface Dimension {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
2
10
|
|
|
3
|
-
export interface ImageHandler<T, U, V> {
|
|
11
|
+
export interface ImageHandler<T, U, V, W = void> {
|
|
4
12
|
readonly handler: T;
|
|
5
13
|
host: U | null;
|
|
6
14
|
instance: V;
|
|
@@ -8,10 +16,10 @@ export interface ImageHandler<T, U, V> {
|
|
|
8
16
|
resize(): void;
|
|
9
17
|
crop(): void;
|
|
10
18
|
opacity(): void;
|
|
11
|
-
quality(): void;
|
|
12
19
|
rotate(...args: unknown[]): unknown;
|
|
20
|
+
quality?(): void;
|
|
13
21
|
background?(value: unknown): void;
|
|
14
|
-
write(output: string, callback?: (err: unknown, result: string) => void):
|
|
22
|
+
write(output: string, callback?: (err: unknown, result: string) => void): W;
|
|
15
23
|
getBuffer(tempFile?: boolean, saveAs?: string): Promise<string | Buffer | null>;
|
|
16
24
|
finalize(output: string, callback: (err: unknown, result: string) => void): void;
|
|
17
25
|
get rotateCount(): number;
|
|
@@ -25,7 +33,7 @@ export interface WebpMuxFrame extends Dimension, Point {
|
|
|
25
33
|
export interface WebpMuxImage extends Readonly<Dimension> {
|
|
26
34
|
readonly anim: { loops: number; bgColor: [number, number, number, number] };
|
|
27
35
|
initLib(): Promise<void>;
|
|
28
|
-
load(value:
|
|
36
|
+
load(value: string | Buffer): Promise<void>;
|
|
29
37
|
demux(options: { path?: string; prefix?: string; buffers?: boolean }): Promise<void>;
|
|
30
38
|
getImageData(): Promise<Uint8Array>;
|
|
31
39
|
getFrameData(frame: number): Promise<Uint8Array>;
|