canvas-editor-engine 2.0.11 → 2.0.13

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 (42) hide show
  1. package/dist/components/canvas.component.d.ts +21 -0
  2. package/dist/components/excretions.component.d.ts +32 -0
  3. package/dist/components/loading.component.d.ts +14 -0
  4. package/dist/components/pipette.component.d.ts +23 -0
  5. package/dist/components/slot.component.d.ts +10 -0
  6. package/dist/config.d.ts +23 -0
  7. package/dist/filters/collection/vague.d.ts +13 -0
  8. package/dist/filters/index.d.ts +2 -0
  9. package/dist/index.d.ts +18 -574
  10. package/dist/index.mjs +2148 -0
  11. package/dist/services/component.service.d.ts +5 -0
  12. package/dist/services/crop.service.d.ts +7 -0
  13. package/dist/services/download.service.d.ts +4 -0
  14. package/dist/services/draw.service.d.ts +17 -0
  15. package/dist/services/event.service.d.ts +16 -0
  16. package/dist/services/logger.service.d.ts +20 -0
  17. package/dist/services/projects.service.d.ts +11 -0
  18. package/dist/services/pull-project.service.d.ts +8 -0
  19. package/dist/services/store.service.d.ts +6 -0
  20. package/dist/services/through-history.service.d.ts +12 -0
  21. package/dist/services/tool-layers.service.d.ts +4 -0
  22. package/dist/services/tool.service.d.ts +10 -0
  23. package/dist/store/history.state.d.ts +15 -0
  24. package/dist/store/image.state.d.ts +30 -0
  25. package/dist/store/store.d.ts +13 -0
  26. package/dist/types/canvas.d.ts +10 -0
  27. package/dist/types/cursor.d.ts +9 -0
  28. package/dist/types/excretion.d.ts +27 -0
  29. package/dist/types/general.d.ts +24 -0
  30. package/dist/types/history.d.ts +7 -0
  31. package/dist/types/image.d.ts +48 -0
  32. package/dist/types/log.d.ts +13 -0
  33. package/dist/types/pipette.d.ts +1 -0
  34. package/dist/types/project.d.ts +38 -0
  35. package/dist/utils/convert.d.ts +12 -0
  36. package/dist/utils/filter.d.ts +21 -0
  37. package/dist/utils/guid4.d.ts +13 -0
  38. package/dist/utils/project-file-serializer.d.ts +13 -0
  39. package/dist/web-component.d.ts +30 -0
  40. package/package.json +11 -5
  41. package/dist/index.mjs.js +0 -2
  42. package/dist/index.mjs.js.LICENSE.txt +0 -8
@@ -0,0 +1,21 @@
1
+ import { TSubscribeAction, TSubscriptionTypes } from "../types/canvas";
2
+ import { ICursorPosition, TCursorStyleName } from "../types/cursor";
3
+ import ComponentService from "../services/component.service";
4
+ export default class CanvasComponent extends ComponentService {
5
+ private static template;
6
+ private static css;
7
+ static eventListener: HTMLDivElement;
8
+ static canvas: HTMLCanvasElement;
9
+ static ctx: CanvasRenderingContext2D | null;
10
+ private static subscriptions;
11
+ private static _cursorStyle;
12
+ static getComponent(): {
13
+ canvasTemplate: HTMLElement;
14
+ canvasStyle: HTMLStyleElement;
15
+ };
16
+ static getCanvasSelector(): string;
17
+ static set cursorStyle(styleName: TCursorStyleName | undefined | null);
18
+ static getCursorPosition(event: MouseEvent): ICursorPosition;
19
+ static subscribe(eventName: TSubscriptionTypes, action: TSubscribeAction): void;
20
+ static simulateSubscriptions(): void;
21
+ }
@@ -0,0 +1,32 @@
1
+ import ComponentService from "../services/component.service";
2
+ import type { IExcretionsCoords, TExcretionStyle, TExcretionToolState } from "../types/excretion";
3
+ export default class ExcretionsComponent extends ComponentService {
4
+ private static template;
5
+ private static templateExcretion;
6
+ private static _excretionDefaultStyle;
7
+ private static css;
8
+ static excretionWrap: HTMLElement;
9
+ private static _excretions;
10
+ private static _excretionState;
11
+ private static _excretionActivity;
12
+ private static _excretionToolState;
13
+ private static _tempCoords;
14
+ static excretionsCoords: IExcretionsCoords[];
15
+ private static _additionStyle;
16
+ static get additionStyle(): TExcretionStyle;
17
+ static set additionStyle(value: TExcretionStyle);
18
+ private static applyExcretionStyle;
19
+ private static determineCropStyle;
20
+ private static determineDefaultStyle;
21
+ private static tool;
22
+ static getComponent(): {
23
+ excretionsTemplate: HTMLElement;
24
+ excretionsStyle: HTMLStyleElement;
25
+ };
26
+ private static set excretionState(value);
27
+ static setToolState(toolState: TExcretionToolState): void;
28
+ static clearExcretionsCoords(): void;
29
+ private static getTempCoords;
30
+ private static endExcretion;
31
+ private static emmit;
32
+ }
@@ -0,0 +1,14 @@
1
+ import ComponentService from "../services/component.service";
2
+ export default class LoadingComponent extends ComponentService {
3
+ private static template;
4
+ private static css;
5
+ static loading: HTMLElement;
6
+ static getComponent(): {
7
+ loadingTemplate: HTMLElement;
8
+ loadingStyle: HTMLStyleElement;
9
+ };
10
+ static hide(): void;
11
+ static view(): void;
12
+ private static subscribeLoadingStart;
13
+ private static subscribeLoadingEnd;
14
+ }
@@ -0,0 +1,23 @@
1
+ import { TPipetteState } from "../types/pipette";
2
+ import { THEXColor } from "../types/general";
3
+ import ComponentService from "../services/component.service";
4
+ export default class PipetteComponent extends ComponentService {
5
+ static template: string;
6
+ static css: string;
7
+ static pipette: HTMLElement;
8
+ private static _pipetteColor;
9
+ static set pipetteColor(color: THEXColor);
10
+ static get pipetteColor(): THEXColor;
11
+ private static _pipetteColorElement;
12
+ private static _pipetteState;
13
+ private static tool;
14
+ static getComponent(): {
15
+ pipetteTemplate: HTMLElement;
16
+ pipetteStyle: HTMLStyleElement;
17
+ };
18
+ static setState(state: TPipetteState): void;
19
+ static emmit(): void;
20
+ private static setColorFromChoosenPixel;
21
+ private static show;
22
+ private static hide;
23
+ }
@@ -0,0 +1,10 @@
1
+ import ComponentService from "../services/component.service";
2
+ export default class SlotComponent extends ComponentService {
3
+ private static template;
4
+ private static css;
5
+ static slot: HTMLSlotElement;
6
+ static getComponent(slotName: string): {
7
+ slotTemplate: HTMLElement;
8
+ slotStyle: HTMLStyleElement;
9
+ };
10
+ }
@@ -0,0 +1,23 @@
1
+ import { ICanvasSize } from "./types/canvas";
2
+ export interface ILayer {
3
+ name: string;
4
+ index: number;
5
+ }
6
+ export declare abstract class ConfigStore {
7
+ static _WEB_COMPONENT_TAG_NAME: string;
8
+ static _CANVAS_SIZE: ICanvasSize;
9
+ static _LAYERS: ILayer[];
10
+ }
11
+ export declare class ConfigFabric implements ConfigStore {
12
+ protected static _WEB_COMPONENT_TAG_NAME: string;
13
+ protected static _CANVAS_SIZE: ICanvasSize;
14
+ protected static _LAYERS: ILayer[];
15
+ }
16
+ export default class AppConfig extends ConfigFabric {
17
+ static get WEB_COMPONENT_TAG_NAME(): string;
18
+ static set WEB_COMPONENT_TAG_NAME(value: string | undefined);
19
+ static get CANVAS_SIZE(): ICanvasSize;
20
+ static set CANVAS_SIZE(value: ICanvasSize | undefined);
21
+ static get LAYERS(): ILayer[];
22
+ static set LAYERS(value: ILayer[]);
23
+ }
@@ -0,0 +1,13 @@
1
+ import type { IFilterOptions, IImageLoggingDataVague, IImageOptions, TFilterMethod } from "../../types/image";
2
+ import { Filter } from "../../utils/filter";
3
+ export default class VagueFilter extends Filter {
4
+ options: IImageOptions;
5
+ filterList: TFilterMethod[];
6
+ constructor(ctx: CanvasRenderingContext2D, options: IImageOptions);
7
+ on(action: TFilterMethod, filterOptions: IFilterOptions): Promise<IImageLoggingDataVague>;
8
+ pixel(imageData: ImageData, filterOptions: IFilterOptions): ImageData;
9
+ private getQualityProcessedRemainder;
10
+ private getQualityBuff;
11
+ private getMostCommonQuanlityBuff;
12
+ private getMostCommonElement;
13
+ }
@@ -0,0 +1,2 @@
1
+ import VagueFilter from './collection/vague';
2
+ export { VagueFilter, };