@leafer/image 1.0.1 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/image",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "@leafer/image",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/task": "1.0.1",
26
- "@leafer/file": "1.0.1",
27
- "@leafer/platform": "1.0.1"
25
+ "@leafer/task": "1.0.3",
26
+ "@leafer/file": "1.0.3",
27
+ "@leafer/platform": "1.0.3"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.0.1"
30
+ "@leafer/interface": "1.0.3"
31
31
  }
32
32
  }
@@ -41,7 +41,7 @@ export class LeaferImage implements ILeaferImage {
41
41
  this.hasOpacityPixel = ImageManager.hasOpacityPixel(config)
42
42
  }
43
43
 
44
- public load(onSuccess: IFunction, onError: IFunction): number {
44
+ public load(onSuccess?: IFunction, onError?: IFunction): number {
45
45
  if (!this.loading) {
46
46
  this.loading = true
47
47
  ImageManager.tasker.add(async () => await Platform.origin.loadImage(this.url).then((img) => {
package/types/index.d.ts CHANGED
@@ -17,7 +17,7 @@ declare class LeaferImage implements ILeaferImage {
17
17
  protected waitComplete: IFunction[];
18
18
  protected cache: ILeaferImageCacheCanvas;
19
19
  constructor(config: ILeaferImageConfig);
20
- load(onSuccess: IFunction, onError: IFunction): number;
20
+ load(onSuccess?: IFunction, onError?: IFunction): number;
21
21
  unload(index: number, stopEvent?: boolean): void;
22
22
  protected onComplete(isSuccess: boolean): void;
23
23
  getCanvas(width: number, height: number, opacity?: number, _filters?: IObject): any;