canvas-editor-engine 1.1.15 → 1.1.16
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { IDrawImageArgs, IFilterOptions, IImageOptions } from "../types/image";
|
|
1
|
+
import type { IDrawImageArgs, IFilterOptions, IImageLoggingDataVague, IImageOptions } from "../types/image";
|
|
2
2
|
export default class DrawService {
|
|
3
3
|
static scImage: SCImage;
|
|
4
4
|
static drawImage(ctx: CanvasRenderingContext2D, src: string, options: IDrawImageArgs): void;
|
|
5
5
|
static drawSmoothImage(useStore: boolean, options: IDrawImageArgs, filterOptions: IFilterOptions): void;
|
|
6
|
+
private static updateImageStateAfterVague;
|
|
6
7
|
private static getFilterArgs;
|
|
7
8
|
}
|
|
8
9
|
export declare class SCImage {
|
|
@@ -11,5 +12,5 @@ export declare class SCImage {
|
|
|
11
12
|
constructor(src: string, ctx: CanvasRenderingContext2D);
|
|
12
13
|
get(): HTMLImageElement;
|
|
13
14
|
draw(options: IDrawImageArgs): Promise<unknown>;
|
|
14
|
-
vague(options: IImageOptions, filterOptions: IFilterOptions): Promise<
|
|
15
|
+
vague(options: IImageOptions, filterOptions: IFilterOptions): Promise<IImageLoggingDataVague>;
|
|
15
16
|
}
|
|
@@ -28,19 +28,16 @@ class DrawService {
|
|
|
28
28
|
const filterArgs = DrawService.getFilterArgs(useStore, options);
|
|
29
29
|
event_service_1.default.dispatch('loading-start');
|
|
30
30
|
this.scImage.vague(filterArgs, filterOptions)
|
|
31
|
-
.then(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
.finally(() => {
|
|
42
|
-
event_service_1.default.dispatch('loading-end');
|
|
43
|
-
});
|
|
31
|
+
.then(DrawService.updateImageStateAfterVague)
|
|
32
|
+
.finally(() => event_service_1.default.dispatch('loading-end'));
|
|
33
|
+
}
|
|
34
|
+
static updateImageStateAfterVague(data) {
|
|
35
|
+
const { imageData, position, size, quality } = data;
|
|
36
|
+
store_1.default.store.imageState.reduce({
|
|
37
|
+
tempImageData: imageData,
|
|
38
|
+
position: position,
|
|
39
|
+
size: size,
|
|
40
|
+
}, `[Filter Vague] quality: ${quality}`);
|
|
44
41
|
}
|
|
45
42
|
static getFilterArgs(useStore, options) {
|
|
46
43
|
let filterArgs;
|
package/dist/store/store.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export declare class Store implements StoreService {
|
|
|
9
9
|
}
|
|
10
10
|
export default class AppStore {
|
|
11
11
|
static store: Store;
|
|
12
|
-
static subscribe(to: '
|
|
12
|
+
static subscribe(to: 'history', completeIt: (...args: any) => void): void;
|
|
13
13
|
}
|