@e-mc/image 0.8.3 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +57 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,7 +1,61 @@
1
- ### @e-mc/image
1
+ # @e-mc/image
2
2
 
3
- https://e-mc.readthedocs.io
3
+ * NodeJS 14
4
+ * ES2020
4
5
 
5
- ### LICENSE
6
+ ## General Usage
7
+
8
+ * [Read the Docs](https://e-mc.readthedocs.io)
9
+
10
+ ## Interface
11
+
12
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/index.d.ts
13
+
14
+ ```typescript
15
+ import type { IHost, ModuleConstructor } from "./index";
16
+ import type { IFileThread } from "./asset";
17
+ import type { CommandData, CropData, QualityData, ResizeData, RotateData, TransformOptions } from "./image";
18
+ import type { ImageModule } from "./settings";
19
+
20
+ interface IImage extends IClient<IHost, ImageModule> {
21
+ resizeData?: ResizeData;
22
+ cropData?: CropData;
23
+ rotateData?: RotateData;
24
+ qualityData?: QualityData;
25
+ methodData?: [string, unknown[]?][];
26
+ opacityValue?: number;
27
+ setCommand(value: string | CommandData, outputAs?: string): void;
28
+ getCommand(): string;
29
+ parseCommand(value: string): CommandData;
30
+ parseMethod(value: string): [string, unknown[]?][] | undefined;
31
+ parseResize(value: string): ResizeData | undefined;
32
+ parseCrop(value: string): CropData | undefined;
33
+ parseRotate(value: string): RotateData | undefined;
34
+ parseQuality(value: string): QualityData | undefined;
35
+ parseOpacity(value: string): number;
36
+ using?(data: IFileThread, command: string): Promise<unknown>;
37
+ get outputAs(): string;
38
+ }
39
+
40
+ interface ImageConstructor extends ModuleConstructor {
41
+ readonly REGEXP_SIZERANGE: RegExp;
42
+ transform(file: string, command: string, options?: TransformOptions): Promise<Buffer | string | null>;
43
+ clamp(value: unknown, min?: number, max?: number): number;
44
+ isBinary(mime: unknown): mime is string;
45
+ toABGR(buffer: Uint8Array | Buffer): Buffer;
46
+ /* @deprecated - IImage.using */
47
+ using?(this: IHost, instance: IImage, data: IFileThread, command: string): Promise<unknown>;
48
+ readonly prototype: IImage;
49
+ new(module?: ImageModule): IImage;
50
+ }
51
+ ```
52
+
53
+ ## References
54
+
55
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/asset.d.ts
56
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/image.d.ts
57
+ - https://www.unpkg.com/@e-mc/types@0.8.4/lib/settings.d.ts
58
+
59
+ ## LICENSE
6
60
 
7
61
  BSD 3-Clause
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/image",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Image constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,6 +20,6 @@
20
20
  "license": "BSD 3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.8.3"
23
+ "@e-mc/core": "0.8.4"
24
24
  }
25
25
  }