@etsoo/editor
Version:
ETSOO Free WYSIWYG HTML Editor
136 lines (135 loc) • 2.97 kB
TypeScript
import { EOImageEditorLabelLanguage } from "./EOImageEditorLabels";
import { EOPopup } from "./EOPopup";
import type * as FabricType from "fabric";
/**
* EOEditor Image Editor commands
*/
export interface EOImageEditorCommand {
/**
* Name
*/
name: string;
/**
* Icon
*/
icon: string;
/**
* Label
*/
label: string;
}
/**
* EOEditor Image Editor separator
*/
export declare const EOImageEditorSeparator: EOImageEditorCommand;
/**
* EOEditor Image Editor
* http://fabricjs.com/docs/fabric.Canvas.html
*/
export declare class EOImageEditor extends HTMLElement {
/**
* Canvas
*/
readonly canvas: HTMLCanvasElement;
/**
* Fabric canvas
*/
private fc?;
/**
* Main image
*/
private image?;
/**
* Current active object
*/
private activeObject?;
/**
* Complete callback
*/
private callback?;
/**
* Popup
*/
readonly popup: EOPopup;
/**
* Fonts
*/
readonly fonts: string[];
/**
* Modal div
*/
readonly modalDiv: HTMLDivElement;
private readonly xs;
private palette;
private readonly container;
private readonly toolbar;
private readonly icons;
private pngFormat?;
private readonly mover;
private readonly settings;
private history?;
private redo?;
private undo?;
private fcSize?;
private containerRect?;
private rect?;
private originalWidth?;
private originalHeight?;
private _labels?;
/**
* Labels
*/
get labels(): EOImageEditorLabelLanguage | undefined;
/**
* Panel color
*/
get panelColor(): string | null;
set panelColor(value: string | null);
/**
* Language
*/
get language(): string | null;
set language(value: string | null);
constructor();
private loadStyles;
private preventEvent;
connectedCallback(): Promise<void>;
disconnectedCallback(): void;
private onKeypress;
private onResize;
private createCommands;
private createSVG;
private clear;
private setCursor;
private _textInput;
private get textInput();
private set textInput(value);
private doAction;
private updateZoomSize;
private findFilter;
private cropSettings;
private filterSettings;
private imageSettings;
private getTextSettings;
private textSettings;
private showSettings;
private isSettingShowing;
private doRotate;
private setPngFormat;
addImage(image: FabricType.FabricImage): void;
/**
* Open editor
* http://fabricjs.com/fabric-filters
* @param img Image to edit
* @param callback Callback when doen
*/
open(img: HTMLImageElement | null, callback?: (data: string) => void): void;
private imageSize;
/**
* Reset editor
*/
reset(): void;
private setup;
private updateStatus;
private updateSize;
}