declare enum EditorComponent {
    COMPONENT = "component",
    MENU = "menu",
    MAIN = "main",
    FOOTER = "footer",
    CONTEXTMENU = "contextmenu",
    POPUP = "popup",
    CATALOG = "catalog",
    COMMENT = "comment"
}
declare enum EditorContext {
    PAGE = "page",
    TABLE = "table"
}
declare enum EditorMode {
    EDIT = "edit",
    CLEAN = "clean",
    READONLY = "readonly",
    FORM = "form",
    PRINT = "print",
    DESIGN = "design",
    GRAFFITI = "graffiti"
}
declare enum EditorZone {
    HEADER = "header",
    MAIN = "main",
    FOOTER = "footer"
}
declare enum PageMode {
    PAGING = "paging",
    CONTINUITY = "continuity"
}
declare enum PaperDirection {
    VERTICAL = "vertical",
    HORIZONTAL = "horizontal"
}
declare enum WordBreak {
    BREAK_ALL = "break-all",
    BREAK_WORD = "break-word"
}
declare enum RenderMode {
    SPEED = "speed",
    COMPATIBILITY = "compatibility"
}

declare enum BackgroundSize {
    CONTAIN = "contain",
    COVER = "cover"
}
declare enum BackgroundRepeat {
    REPEAT = "repeat",
    NO_REPEAT = "no-repeat",
    REPEAT_X = "repeat-x",
    REPEAT_Y = "repeat-y"
}

interface IBackgroundOption {
    color?: string;
    image?: string;
    size?: BackgroundSize;
    repeat?: BackgroundRepeat;
    applyPageNumbers?: number[];
}

declare enum VerticalAlign {
    TOP = "top",
    MIDDLE = "middle",
    BOTTOM = "bottom"
}

interface ICheckbox {
    value: boolean | null;
    code?: string;
    disabled?: boolean;
}
interface ICheckboxOption {
    width?: number;
    height?: number;
    gap?: number;
    lineWidth?: number;
    fillStyle?: string;
    strokeStyle?: string;
    verticalAlign?: VerticalAlign;
}

interface IRadio {
    value: boolean | null;
    code?: string;
    disabled?: boolean;
}
interface IRadioOption {
    width?: number;
    height?: number;
    gap?: number;
    lineWidth?: number;
    fillStyle?: string;
    strokeStyle?: string;
    verticalAlign?: VerticalAlign;
}

declare enum MaxHeightRatio {
    HALF = "half",
    ONE_THIRD = "one-third",
    QUARTER = "quarter"
}
declare enum NumberType {
    ARABIC = "arabic",
    CHINESE = "chinese"
}
declare enum ImageDisplay {
    INLINE = "inline",
    BLOCK = "block",
    SURROUND = "surround",
    FLOAT_TOP = "float-top",
    FLOAT_BOTTOM = "float-bottom"
}
declare enum LocationPosition {
    BEFORE = "before",
    AFTER = "after",
    OUTER_BEFORE = "outer-before",
    OUTER_AFTER = "outer-after"
}
declare enum FlexDirection {
    ROW = "row",
    COLUMN = "column"
}

declare enum ControlType {
    TEXT = "text",
    SELECT = "select",
    CHECKBOX = "checkbox",
    RADIO = "radio",
    DATE = "date",
    NUMBER = "number"
}
declare enum ControlComponent {
    PREFIX = "prefix",
    POSTFIX = "postfix",
    PRE_TEXT = "preText",
    POST_TEXT = "postText",
    PLACEHOLDER = "placeholder",
    VALUE = "value",
    CHECKBOX = "checkbox",
    RADIO = "radio"
}
declare enum ControlIndentation {
    ROW_START = "rowStart",
    VALUE_START = "valueStart"
}
declare enum ControlState {
    ACTIVE = "active",
    INACTIVE = "inactive"
}

declare enum MoveDirection {
    UP = "top",
    DOWN = "down",
    LEFT = "left",
    RIGHT = "right"
}

declare enum RowFlex {
    LEFT = "left",
    CENTER = "center",
    RIGHT = "right",
    ALIGNMENT = "alignment",
    JUSTIFY = "justify"
}

declare enum ElementType {
    TEXT = "text",
    IMAGE = "image",
    TABLE = "table",
    HYPERLINK = "hyperlink",
    SUPERSCRIPT = "superscript",
    SUBSCRIPT = "subscript",
    SEPARATOR = "separator",
    PAGE_BREAK = "pageBreak",
    CONTROL = "control",
    AREA = "area",
    CHECKBOX = "checkbox",
    RADIO = "radio",
    LATEX = "latex",
    TAB = "tab",
    DATE = "date",
    BLOCK = "block",
    TITLE = "title",
    LIST = "list",
    LABEL = "label",
    COLUMN_BREAK = "columnBreak"
}

declare enum ListType {
    UL = "ul",
    OL = "ol"
}
declare enum ListStyle {
    DISC = "disc",
    CIRCLE = "circle",
    SQUARE = "square",
    DECIMAL = "decimal",
    CHECKBOX = "checkbox"
}
declare enum OlPreset {
    DEFAULT = "olDefault",
    PARENTHESIS = "olParen",
    OUTLINE = "olOutline",
    UPPER_ALPHA = "olUpperA",
    ROMAN = "olRoman",
    ZERO_PAD = "olZeroPad"
}
declare enum UlPreset {
    DEFAULT = "ulDefault",
    DIAMOND = "ulDiamond",
    HOLLOW_SQ = "ulHollowSq",
    ARROW = "ulArrow",
    STAR = "ulStar",
    CHECK_ARROW = "ulCheckArr"
}

declare enum TitleLevel {
    FIRST = "first",
    SECOND = "second",
    THIRD = "third",
    FOURTH = "fourth",
    FIFTH = "fifth",
    SIXTH = "sixth"
}

declare enum TableBorder {
    ALL = "all",
    EMPTY = "empty",
    EXTERNAL = "external",
    INTERNAL = "internal",
    DASH = "dash"
}
declare enum TdBorder {
    TOP = "top",
    RIGHT = "right",
    BOTTOM = "bottom",
    LEFT = "left"
}
declare enum TdSlash {
    FORWARD = "forward",
    BACK = "back"
}

declare enum AreaMode {
    EDIT = "edit",
    READONLY = "readonly",
    FORM = "form"
}

interface IPlaceholder {
    data: string;
    color?: string;
    opacity?: number;
    size?: number;
    font?: string;
}

interface IRange {
    startIndex: number;
    endIndex: number;
    isCrossRowCol?: boolean;
    tableId?: string;
    startTdIndex?: number;
    endTdIndex?: number;
    startTrIndex?: number;
    endTrIndex?: number;
    zone?: EditorZone;
}
type RangeRowArray = Map<number, number[]>;
type RangeRowMap = Map<number, Set<number>>;
type RangeRect = IElementFillRect;
type RangeContext = {
    isCollapsed: boolean;
    startElement: IElement;
    endElement: IElement;
    startPageNo: number;
    endPageNo: number;
    startRowNo: number;
    endRowNo: number;
    startColNo: number;
    endColNo: number;
    rangeRects: RangeRect[];
    zone: EditorZone;
    isTable: boolean;
    trIndex: number | null;
    tdIndex: number | null;
    tableElement: IElement | null;
    selectionText: string | null;
    selectionElementList: IElement[];
    titleId: string | null;
    titleStartPageNo: number | null;
};
interface IRangeParagraphInfo {
    elementList: IElement[];
    startIndex: number;
}
type IRangeElementStyle = Pick<IElementStyle, 'bold' | 'color' | 'highlight' | 'font' | 'size' | 'italic' | 'underline' | 'strikeout'>;

interface IAreaBasic {
    extension?: unknown;
    placeholder?: IPlaceholder;
}
interface IAreaStyle {
    top?: number;
    borderColor?: string;
    backgroundColor?: string;
}
interface IAreaRule {
    mode?: AreaMode;
    hide?: boolean;
    deletable?: boolean;
}
type IArea = IAreaBasic & IAreaStyle & IAreaRule;
interface IInsertAreaOption {
    id?: string;
    area: IArea;
    value: IElement[];
    position?: LocationPosition;
    range?: Pick<IRange, 'startIndex' | 'endIndex'>;
}
interface ISetAreaValueOption {
    id?: string;
    value: IElement[];
}
interface ISetAreaPropertiesOption {
    id?: string;
    properties: IArea;
}
interface IGetAreaValueOption {
    id?: string;
}
interface IGetAreaValueResult {
    id?: string;
    area: IArea;
    startPageNo: number;
    endPageNo: number;
    value: IElement[];
}
interface IAreaInfo {
    id: string;
    area: IArea;
    elementList: IElement[];
    positionList: IElementPosition[];
}
interface ILocationAreaOption {
    position: LocationPosition;
    isAppendLastLineBreak?: boolean;
}

declare enum BlockType {
    IFRAME = "iframe",
    VIDEO = "video"
}

interface IIFrameBlock {
    src?: string;
    srcdoc?: string;
    sandbox?: string[];
    allow?: string[];
}
interface IVideoBlock {
    src: string;
}
interface IBlock {
    type: BlockType;
    iframeBlock?: IIFrameBlock;
    videoBlock?: IVideoBlock;
}

type Primitive = string | number | boolean | bigint | symbol | undefined | null;
type Builtin = Primitive | Function | Date | Error | RegExp;
type DeepRequired<T> = T extends Error ? Required<T> : T extends Builtin ? T : T extends Map<infer K, infer V> ? Map<DeepRequired<K>, DeepRequired<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepRequired<K>, DeepRequired<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepRequired<K>, DeepRequired<V>> : T extends Set<infer U> ? Set<DeepRequired<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepRequired<U>> : T extends WeakSet<infer U> ? WeakSet<DeepRequired<U>> : T extends Promise<infer U> ? Promise<DeepRequired<U>> : T extends {} ? {
    [K in keyof T]-?: DeepRequired<T[K]>;
} : Required<T>;
type DeepPartial<T> = {
    [P in keyof T]?: DeepPartial<T[P]>;
};
type IPadding = [
    top: number,
    right: number,
    bottom: number,
    left: number
];

declare enum TextDecorationStyle {
    SOLID = "solid",
    DOUBLE = "double",
    DASHED = "dashed",
    DOTTED = "dotted",
    WAVY = "wavy"
}

interface ITextMetrics {
    width: number;
    actualBoundingBoxAscent: number;
    actualBoundingBoxDescent: number;
    actualBoundingBoxLeft: number;
    actualBoundingBoxRight: number;
    fontBoundingBoxAscent: number;
    fontBoundingBoxDescent: number;
}
interface ITextDecoration {
    style?: TextDecorationStyle;
}

interface ITitleSizeOption {
    defaultFirstSize?: number;
    defaultSecondSize?: number;
    defaultThirdSize?: number;
    defaultFourthSize?: number;
    defaultFifthSize?: number;
    defaultSixthSize?: number;
}
type ITitleOption = ITitleSizeOption & {};
interface ITitleRule {
    deletable?: boolean;
    disabled?: boolean;
}
type ITitle = ITitleRule & {
    conceptId?: string;
};
interface IGetTitleValueOption {
    conceptId: string;
}
type IGetTitleValueResult = (ITitle & {
    value: string | null;
    elementList: IElement[];
    zone: EditorZone;
})[];

interface IColgroup {
    id?: string;
    width: number;
}

type IRowElement = IElement & {
    metrics: IElementMetrics;
    style: string;
    left?: number;
};
interface IRow {
    width: number;
    height: number;
    ascent: number;
    rowFlex?: RowFlex;
    startIndex: number;
    isPageBreak?: boolean;
    isColumnBreak?: boolean;
    isList?: boolean;
    listIndex?: number;
    offsetX?: number;
    offsetY?: number;
    elementList: IRowElement[];
    isWidthNotEnough?: boolean;
    rowIndex: number;
    isSurround?: boolean;
    columnNo?: number;
}

interface ITd {
    conceptId?: string;
    id?: string;
    extension?: unknown;
    externalId?: string;
    x?: number;
    y?: number;
    width?: number;
    height?: number;
    colspan: number;
    rowspan: number;
    value: IElement[];
    trIndex?: number;
    tdIndex?: number;
    isLastRowTd?: boolean;
    isLastColTd?: boolean;
    isLastTd?: boolean;
    rowIndex?: number;
    colIndex?: number;
    rowList?: IRow[];
    positionList?: IElementPosition[];
    verticalAlign?: VerticalAlign;
    backgroundColor?: string;
    borderTypes?: TdBorder[];
    slashTypes?: TdSlash[];
    mainHeight?: number;
    realHeight?: number;
    realMinHeight?: number;
    disabled?: boolean;
    deletable?: boolean;
}

interface ITr {
    id?: string;
    extension?: unknown;
    externalId?: string;
    height: number;
    tdList: ITd[];
    minHeight?: number;
    pagingRepeat?: boolean;
}

interface IElementBasic {
    id?: string;
    type?: ElementType;
    value: string;
    extension?: unknown;
    externalId?: string;
}
interface IElementStyle {
    font?: string;
    size?: number;
    width?: number;
    height?: number;
    bold?: boolean;
    color?: string;
    highlight?: string;
    italic?: boolean;
    underline?: boolean;
    strikeout?: boolean;
    rowFlex?: RowFlex;
    rowMargin?: number;
    letterSpacing?: number;
    textDecoration?: ITextDecoration;
}
interface IElementRule {
    hide?: boolean;
}
interface IElementGroup {
    groupIds?: string[];
}
interface ITitleElement {
    valueList?: IElement[];
    level?: TitleLevel;
    titleId?: string;
    title?: ITitle;
}
interface IListElement {
    valueList?: IElement[];
    listType?: ListType;
    listStyle?: ListStyle;
    listId?: string;
    listWrap?: boolean;
    listLevel?: number;
    listPreset?: string;
}
interface ITableAttr {
    colgroup?: IColgroup[];
    trList?: ITr[];
    borderType?: TableBorder;
    borderColor?: string;
    borderWidth?: number;
    borderExternalWidth?: number;
    translateX?: number;
}
interface ITableRule {
    tableToolDisabled?: boolean;
}
interface ITableElement {
    tdId?: string;
    trId?: string;
    tableId?: string;
    conceptId?: string;
    pagingId?: string;
    pagingIndex?: number;
}
type ITable = ITableAttr & ITableRule & ITableElement;
interface IHyperlinkElement {
    valueList?: IElement[];
    url?: string;
    hyperlinkId?: string;
}
interface ISuperscriptSubscript {
    actualSize?: number;
}
interface ISeparator {
    dashArray?: number[];
    lineWidth?: number;
}
interface IControlElement {
    control?: IControl;
    controlId?: string;
    controlComponent?: ControlComponent;
}
interface ICheckboxElement {
    checkbox?: ICheckbox;
}
interface IRadioElement {
    radio?: IRadio;
}
interface ILaTexElement {
    laTexSVG?: string;
}
interface IDateElement {
    dateFormat?: string;
    dateId?: string;
}
interface IImageRule {
    imgToolDisabled?: boolean;
    imgPreviewDisabled?: boolean;
}
interface IImageCrop {
    x: number;
    y: number;
    width: number;
    height: number;
}
interface IImageBasic {
    imgDisplay?: ImageDisplay;
    imgFloatPosition?: {
        x: number;
        y: number;
        pageNo?: number;
    };
    imgCrop?: IImageCrop;
}
type IImageElement = IImageBasic & IImageRule;
interface IBlockElement {
    block?: IBlock;
}
interface IAreaElement {
    valueList?: IElement[];
    areaId?: string;
    areaIndex?: number;
    area?: IArea;
}
interface ILabelElement {
    labelId?: string;
    label?: {
        color?: string;
        backgroundColor?: string;
        borderColor?: string;
        borderRadius?: number;
        padding?: IPadding;
    };
}
type IElement = IElementBasic & IElementStyle & IElementRule & IElementGroup & ITable & IHyperlinkElement & ISuperscriptSubscript & ISeparator & IControlElement & ICheckboxElement & IRadioElement & ILaTexElement & IDateElement & IImageElement & IBlockElement & ITitleElement & IListElement & IAreaElement & ILabelElement;
interface IElementMetrics {
    width: number;
    height: number;
    boundingBoxAscent: number;
    boundingBoxDescent: number;
}
interface IElementPosition {
    pageNo: number;
    index: number;
    value: string;
    rowIndex: number;
    rowNo: number;
    columnNo: number;
    ascent: number;
    lineHeight: number;
    left: number;
    metrics: IElementMetrics;
    isFirstLetter: boolean;
    isLastLetter: boolean;
    coordinate: {
        leftTop: number[];
        leftBottom: number[];
        rightTop: number[];
        rightBottom: number[];
    };
}
interface IElementFillRect {
    x: number;
    y: number;
    width: number;
    height: number;
}
interface IUpdateElementByIdOption {
    id?: string;
    conceptId?: string;
    properties: Omit<Partial<IElement>, 'id'>;
}
interface IDeleteElementByIdOption {
    id?: string;
    conceptId?: string;
}
interface IGetElementByIdOption {
    id?: string;
    conceptId?: string;
}
interface IInsertElementListOption {
    isReplace?: boolean;
    isSubmitHistory?: boolean;
    ignoreContextKeys?: Array<keyof IElement>;
}
interface ISpliceElementListOption {
    isIgnoreDeletedRule?: boolean;
}

interface IDrawOption {
    curIndex?: number;
    isSetCursor?: boolean;
    isSubmitHistory?: boolean;
    isCompute?: boolean;
    isLazy?: boolean;
    isInit?: boolean;
    isSourceHistory?: boolean;
    isFirstRender?: boolean;
}
interface IForceUpdateOption {
    isSubmitHistory?: boolean;
}
interface IDrawImagePayload {
    id?: string;
    conceptId?: string;
    width: number;
    height: number;
    value: string;
    imgDisplay?: ImageDisplay;
    extension?: unknown;
}
interface IDrawRowPayload {
    elementList: IElement[];
    positionList: IElementPosition[];
    rowList: IRow[];
    pageNo: number;
    startIndex: number;
    innerWidth: number;
    zone?: EditorZone;
    isDrawLineBreak?: boolean;
    isDrawWhiteSpace?: boolean;
}
interface IPainterOption {
    isDblclick: boolean;
}
interface IGetValueOption {
    pageNo?: number;
    extraPickAttrs?: Array<keyof IElement>;
}
type IGetOriginValueOption = Omit<IGetValueOption, 'extraPickAttrs'>;
interface IAppendElementListOption {
    isPrepend?: boolean;
    isSubmitHistory?: boolean;
}
interface IGetImageOption {
    pixelRatio?: number;
    mode?: EditorMode;
}
interface IComputeRowListPayload {
    innerWidth: number;
    elementList: IElement[];
    startX?: number;
    startY?: number;
    isFromTable?: boolean;
    isPagingMode?: boolean;
    pageHeight?: number;
    mainOuterHeight?: number;
    surroundElementList?: IElement[];
}

interface ICurrentPosition {
    index: number;
    x?: number;
    y?: number;
    isCheckbox?: boolean;
    isRadio?: boolean;
    isControl?: boolean;
    isImage?: boolean;
    isLabel?: boolean;
    isTable?: boolean;
    isDirectHit?: boolean;
    trIndex?: number;
    tdIndex?: number;
    tdValueIndex?: number;
    tdId?: string;
    trId?: string;
    tableId?: string;
    zone?: EditorZone;
    hitLineStartIndex?: number;
}
interface IGetPositionByXYPayload {
    x: number;
    y: number;
    pageNo?: number;
    isTable?: boolean;
    td?: ITd;
    tablePosition?: IElementPosition;
    elementList?: IElement[];
    positionList?: IElementPosition[];
}
type IGetFloatPositionByXYPayload = IGetPositionByXYPayload & {
    imgDisplays: ImageDisplay[];
};
interface IPositionContext {
    isTable: boolean;
    isCheckbox?: boolean;
    isRadio?: boolean;
    isControl?: boolean;
    isImage?: boolean;
    isLabel?: boolean;
    isDirectHit?: boolean;
    index?: number;
    trIndex?: number;
    tdIndex?: number;
    tdId?: string;
    trId?: string;
    tableId?: string;
}
interface IComputeRowPositionPayload {
    row: IRow;
    innerWidth: number;
}
interface IComputePageRowPositionPayload {
    positionList: IElementPosition[];
    rowList: IRow[];
    pageNo: number;
    startRowIndex: number;
    startIndex: number;
    startX: number;
    startY: number;
    innerWidth: number;
    rowNoOffset?: number;
    columnNo?: number;
    isTable?: boolean;
    index?: number;
    tdIndex?: number;
    trIndex?: number;
    tdValueIndex?: number;
    zone?: EditorZone;
}
interface IComputePageRowPositionResult {
    x: number;
    y: number;
    index: number;
}
interface IFloatPosition {
    pageNo: number;
    element: IElement;
    position: IElementPosition;
    isTable?: boolean;
    index?: number;
    tdIndex?: number;
    trIndex?: number;
    tdValueIndex?: number;
    zone?: EditorZone;
}
interface ISetSurroundPositionPayload {
    row: IRow;
    rowElement: IRowElement;
    rowElementRect: IElementFillRect;
    pageNo: number;
    availableWidth: number;
    surroundElementList: IElement[];
}

interface IValueSet {
    value: string;
    code: string;
}
interface IControlSelect {
    code: string | null;
    valueSets: IValueSet[];
    isMultiSelect?: boolean;
    multiSelectDelimiter?: string;
    selectExclusiveOptions?: {
        inputAble?: boolean;
    };
}
interface IControlCheckbox {
    code: string | null;
    min?: number;
    max?: number;
    flexDirection: FlexDirection;
    valueSets: IValueSet[];
}
interface IControlRadio {
    code: string | null;
    flexDirection: FlexDirection;
    valueSets: IValueSet[];
}
interface IControlDate {
    dateFormat?: string;
}
interface IControlNumber {
    numberExclusiveOptions?: {
        calculatorDisabled?: boolean;
    };
}
interface IControlHighlightRule {
    keyword: string;
    alpha?: number;
    backgroundColor?: string;
}
interface IControlHighlight {
    ruleList: IControlHighlightRule[];
    id?: string;
    conceptId?: string;
}
interface IControlRule {
    deletable?: boolean;
    disabled?: boolean;
    pasteDisabled?: boolean;
    hide?: boolean;
}
interface IControlBasic {
    type: ControlType;
    value: IElement[] | null;
    placeholder?: string;
    conceptId?: string;
    groupId?: string;
    prefix?: string;
    postfix?: string;
    minWidth?: number;
    underline?: boolean;
    border?: boolean;
    extension?: unknown;
    indentation?: ControlIndentation;
    rowFlex?: RowFlex;
    preText?: string;
    postText?: string;
}
interface IControlStyle {
    font?: string;
    size?: number;
    bold?: boolean;
    highlight?: string;
    italic?: boolean;
    strikeout?: boolean;
}
type IControl = IControlBasic & IControlRule & Partial<IControlStyle> & Partial<IControlSelect> & Partial<IControlCheckbox> & Partial<IControlRadio> & Partial<IControlDate> & Partial<IControlNumber>;
interface IControlOption {
    placeholderColor?: string;
    bracketColor?: string;
    prefix?: string;
    postfix?: string;
    borderWidth?: number;
    borderColor?: string;
    activeBackgroundColor?: string;
    disabledBackgroundColor?: string;
    existValueBackgroundColor?: string;
    noValueBackgroundColor?: string;
}
interface IControlInitOption {
    index: number;
    isTable?: boolean;
    trIndex?: number;
    tdIndex?: number;
    tdValueIndex?: number;
}
interface IControlInstance {
    setElement(element: IElement): void;
    getElement(): IElement;
    getValue(context?: IControlContext): IElement[];
    setValue(data: IElement[], context?: IControlContext, options?: IControlRuleOption): number;
    keydown(evt: KeyboardEvent): number | null;
    cut(): number;
}
interface IControlContext {
    range?: IRange;
    elementList?: IElement[];
}
interface IControlRuleOption {
    isIgnoreDisabledRule?: boolean;
    isIgnoreDeletedRule?: boolean;
    isAddPlaceholder?: boolean;
}
interface IGetControlValueOption {
    id?: string;
    groupId?: string;
    conceptId?: string;
    areaId?: string;
}
type IGetControlValueResult = (Omit<IControl, 'value'> & {
    value: string | null;
    innerText: string | null;
    zone: EditorZone;
    elementList?: IElement[];
})[];
interface ISetControlValueOption {
    id?: string;
    groupId?: string;
    conceptId?: string;
    areaId?: string;
    value: string | IElement[] | null;
    isSubmitHistory?: boolean;
}
interface ISetControlExtensionOption {
    id?: string;
    groupId?: string;
    conceptId?: string;
    areaId?: string;
    extension: unknown;
}
type ISetControlHighlightOption = IControlHighlight[];
type ISetControlProperties = {
    id?: string;
    groupId?: string;
    conceptId?: string;
    areaId?: string;
    properties: Partial<Omit<IControl, 'value'>>;
    isSubmitHistory?: boolean;
};
type IRepaintControlOption = Pick<IDrawOption, 'curIndex' | 'isCompute' | 'isSubmitHistory' | 'isSetCursor'>;
interface IControlChangeOption {
    context?: IControlContext;
    controlElement?: IElement;
    controlValue?: IElement[];
}
interface INextControlContext {
    positionContext: IPositionContext;
    nextIndex: number;
}
interface IInitNextControlOption {
    direction?: MoveDirection;
}
interface ILocationControlOption {
    position: LocationPosition;
}
interface ISetControlRowFlexOption {
    row: IRow;
    rowElement: IRowElement;
    availableWidth: number;
    controlRealWidth: number;
}
interface IControlChangeResult {
    state: ControlState;
    control: IControl;
    controlId: string;
}
interface IControlContentChangeResult {
    control: IControl;
    controlId: string;
}
interface IDestroyControlOption {
    isEmitEvent?: boolean;
}
interface IRemoveControlOption {
    id?: string;
    conceptId?: string;
}

interface ICursorOption {
    width?: number;
    color?: string;
    dragWidth?: number;
    dragColor?: string;
    dragFloatImageDisabled?: boolean;
}

interface IFooter {
    bottom?: number;
    inactiveAlpha?: number;
    maxHeightRadio?: MaxHeightRatio;
    disabled?: boolean;
    editable?: boolean;
    backgroundColor?: string;
}

interface IGroup {
    opacity?: number;
    backgroundColor?: string;
    activeOpacity?: number;
    activeBackgroundColor?: string;
    disabled?: boolean;
    deletable?: boolean;
}

interface IHeader {
    top?: number;
    inactiveAlpha?: number;
    maxHeightRadio?: MaxHeightRatio;
    disabled?: boolean;
    editable?: boolean;
}

interface ILabelOption {
    defaultColor?: string;
    defaultBackgroundColor?: string;
    defaultBorderRadius?: number;
    defaultPadding?: IPadding;
}

interface ILineBreakOption {
    disabled?: boolean;
    color?: string;
    lineWidth?: number;
}

type IMargin = [top: number, right: number, bottom: number, left: number];

interface IPageBreak {
    font?: string;
    fontSize?: number;
    lineDash?: number[];
}

interface IPageNumber {
    bottom?: number;
    size?: number;
    font?: string;
    color?: string;
    rowFlex?: RowFlex;
    format?: string;
    numberType?: NumberType;
    disabled?: boolean;
    startPageNo?: number;
    fromPageNo?: number;
    maxPageNo?: number | null;
}

declare enum WatermarkType {
    TEXT = "text",
    IMAGE = "image"
}

interface IWatermark {
    data: string;
    type?: WatermarkType;
    width?: number;
    height?: number;
    color?: string;
    opacity?: number;
    size?: number;
    font?: string;
    repeat?: boolean;
    numberType?: NumberType;
    gap?: [horizontal: number, vertical: number];
    rotation?: number;
    inFront?: boolean;
}

interface IZoneOption {
    tipDisabled?: boolean;
}

interface ISeparatorOption {
    strokeStyle?: string;
    lineWidth?: number;
}

interface ITableOption {
    tdPadding?: IPadding;
    defaultTrMinHeight?: number;
    defaultColMinWidth?: number;
    defaultBorderColor?: string;
    overflow?: boolean;
}

declare enum LineNumberType {
    PAGE = "page",
    CONTINUITY = "continuity"
}

interface ILineNumberOption {
    size?: number;
    font?: string;
    color?: string;
    disabled?: boolean;
    right?: number;
    type?: LineNumberType;
}

interface IPageBorderOption {
    color?: string;
    lineWidth?: number;
    padding?: IPadding;
    disabled?: boolean;
}

interface IBadge {
    top?: number;
    left?: number;
    width: number;
    height: number;
    value: string;
}
interface IBadgeOption {
    top?: number;
    left?: number;
}
interface IAreaBadge {
    areaId: string;
    badge: IBadge;
}

interface IGraffitiStroke {
    lineWidth?: number;
    lineColor?: string;
    points: number[];
}
interface IGraffitiData {
    pageNo: number;
    strokes: IGraffitiStroke[];
}
interface IGraffitiOption {
    defaultLineWidth?: number;
    defaultLineColor?: string;
}

interface IWhiteSpaceOption {
    disabled?: boolean;
    color?: string;
    radius?: number;
}

interface IColumnOption {
    count?: number;
    gap?: number;
}
interface IEditorData {
    header?: IElement[];
    main: IElement[];
    footer?: IElement[];
    graffiti?: IGraffitiData[];
}
interface IEditorOption {
    mode?: EditorMode;
    locale?: string;
    defaultType?: string;
    defaultColor?: string;
    defaultFont?: string;
    defaultSize?: number;
    minSize?: number;
    maxSize?: number;
    defaultBasicRowMarginHeight?: number;
    defaultRowMargin?: number;
    defaultTabWidth?: number;
    width?: number;
    height?: number;
    scale?: number;
    pageGap?: number;
    underlineColor?: string;
    strikeoutColor?: string;
    rangeColor?: string;
    rangeAlpha?: number;
    rangeMinWidth?: number;
    searchMatchColor?: string;
    searchNavigateMatchColor?: string;
    searchMatchAlpha?: number;
    highlightAlpha?: number;
    highlightMarginHeight?: number;
    resizerColor?: string;
    resizerSize?: number;
    marginIndicatorSize?: number;
    marginIndicatorColor?: string;
    margins?: IMargin;
    pageMode?: PageMode;
    renderMode?: RenderMode;
    defaultHyperlinkColor?: string;
    paperDirection?: PaperDirection;
    inactiveAlpha?: number;
    historyMaxRecordCount?: number;
    printPixelRatio?: number;
    maskMargin?: IMargin;
    letterClass?: string[];
    contextMenuDisableKeys?: string[];
    shortcutDisableKeys?: string[];
    scrollContainerSelector?: string;
    pageOuterSelectionDisable?: boolean;
    wordBreak?: WordBreak;
    table?: ITableOption;
    header?: IHeader;
    footer?: IFooter;
    pageNumber?: IPageNumber;
    watermark?: IWatermark;
    control?: IControlOption;
    checkbox?: ICheckboxOption;
    radio?: IRadioOption;
    cursor?: ICursorOption;
    title?: ITitleOption;
    placeholder?: IPlaceholder;
    group?: IGroup;
    pageBreak?: IPageBreak;
    zone?: IZoneOption;
    background?: IBackgroundOption;
    lineBreak?: ILineBreakOption;
    whiteSpace?: IWhiteSpaceOption;
    separator?: ISeparatorOption;
    lineNumber?: ILineNumberOption;
    pageBorder?: IPageBorderOption;
    badge?: IBadgeOption;
    modeRule?: IModeRule;
    graffiti?: IGraffitiOption;
    label?: ILabelOption;
    column?: IColumnOption;
}
interface IEditorResult {
    version: string;
    data: IEditorData;
    options: IEditorOption;
}
interface IEditorHTML {
    header: string;
    main: string;
    footer: string;
}
type IEditorText = IEditorHTML;
type IUpdateOption = Omit<IEditorOption, 'mode' | 'width' | 'height' | 'scale' | 'pageGap' | 'pageMode' | 'paperDirection' | 'historyMaxRecordCount' | 'scrollContainerSelector'>;
interface ISetValueOption {
    isSetCursor?: boolean;
}
interface IFocusOption {
    rowNo?: number;
    range?: IRange;
    position?: LocationPosition;
    isMoveCursorToVisible?: boolean;
}
interface IPrintModeRule {
    imagePreviewerDisabled?: boolean;
    backgroundDisabled?: boolean;
}
interface IReadonlyModeRule {
    imagePreviewerDisabled?: boolean;
}
interface IFormModeRule {
    controlDeletableDisabled?: boolean;
}
interface IModeRule {
    [EditorMode.PRINT]?: IPrintModeRule;
    [EditorMode.READONLY]?: IReadonlyModeRule;
    [EditorMode.FORM]?: IFormModeRule;
}

interface ICatalogItem {
    id: string;
    name: string;
    level: TitleLevel;
    pageNo: number;
    subCatalog: ICatalogItem[];
}
type ICatalog = ICatalogItem[];

interface IPasteOption {
    isPlainText: boolean;
}
interface ITableInfoByEvent {
    element: IElement;
    trIndex: number;
    tdIndex: number;
}
interface IPositionContextByEventResult {
    pageNo: number;
    element: IElement | null;
    rangeRect: RangeRect | null;
    tableInfo: ITableInfoByEvent | null;
}
interface IPositionContextByEventOption {
    isMustDirectHit?: boolean;
}
interface ICopyOption {
    isPlainText: boolean;
}

interface ISearchResultBasic {
    type: EditorContext;
    index: number;
    groupId: string;
}
interface ISearchResultRestArgs {
    tableId?: string;
    tableIndex?: number;
    trIndex?: number;
    tdIndex?: number;
    tdId?: string;
    startIndex?: number;
}
type ISearchResult = ISearchResultBasic & ISearchResultRestArgs;
interface ISearchResultContext {
    range: IRange;
    startPosition: IElementPosition;
    endPosition: IElementPosition;
}
interface IReplaceOption {
    index?: number;
}
interface ISearchOption {
    isRegEnable?: boolean;
    isIgnoreCase?: boolean;
    isLimitSelection?: boolean;
}

interface ICompositionInfo {
    elementList: IElement[];
    startIndex: number;
    endIndex: number;
    value: string;
    defaultStyle: IRangeElementStyle | null;
}
declare class CanvasEvent {
    isAllowSelection: boolean;
    isComposing: boolean;
    compositionInfo: ICompositionInfo | null;
    isAllowDrag: boolean;
    isAllowDrop: boolean;
    cacheRange: IRange | null;
    cacheElementList: IElement[] | null;
    cachePositionList: IElementPosition[] | null;
    cachePositionContext: IPositionContext | null;
    mouseDownStartPosition: ICurrentPosition | null;
    private draw;
    private pageContainer;
    private pageList;
    private range;
    private position;
    constructor(draw: Draw);
    getDraw(): Draw;
    register(): void;
    setIsAllowSelection(payload: boolean): void;
    setIsAllowDrag(payload: boolean): void;
    clearPainterStyle(): void;
    applyPainterStyle(): void;
    selectAll(): void;
    mousemove(evt: MouseEvent): void;
    mousedown(evt: MouseEvent): void;
    click(): void;
    mouseup(evt: MouseEvent): void;
    mouseleave(evt: MouseEvent): void;
    keydown(evt: KeyboardEvent): void;
    dblclick(evt: MouseEvent): void;
    threeClick(): void;
    input(data: string): void;
    cut(): Promise<void>;
    copy(options?: ICopyOption): Promise<void>;
    compositionstart(): void;
    compositionend(evt: CompositionEvent): void;
    drop(evt: DragEvent): void;
    dragover(evt: DragEvent | MouseEvent): void;
}

type IDrawCursorOption = ICursorOption & {
    isShow?: boolean;
    isBlink?: boolean;
    isFocus?: boolean;
    hitLineStartIndex?: number;
};
interface IMoveCursorToVisibleOption {
    direction: MoveDirection;
    cursorPosition: IElementPosition;
}
declare class Cursor {
    private readonly ANIMATION_CLASS;
    private draw;
    private container;
    private options;
    private position;
    private cursorDom;
    private cursorAgent;
    private blinkTimeout;
    private hitLineStartIndex;
    constructor(draw: Draw, canvasEvent: CanvasEvent);
    getCursorDom(): HTMLDivElement;
    getAgentDom(): HTMLTextAreaElement;
    getAgentIsActive(): boolean;
    getAgentDomValue(): string;
    clearAgentDomValue(): void;
    getHitLineStartIndex(): number | undefined;
    private _blinkStart;
    private _blinkStop;
    private _setBlinkTimeout;
    private _clearBlinkTimeout;
    focus(): void;
    drawCursor(payload?: IDrawCursorOption): void;
    recoveryCursor(): void;
    moveCursorToVisible(payload: IMoveCursorToVisibleOption): void;
}

declare class GlobalEvent {
    private draw;
    private options;
    private cursor;
    private canvasEvent;
    private range;
    private previewer;
    private tableTool;
    private hyperlinkParticle;
    private control;
    private dateParticle;
    private imageParticle;
    private dprMediaQueryList;
    constructor(draw: Draw, canvasEvent: CanvasEvent);
    register(): void;
    private addEvent;
    removeEvent(): void;
    clearSideEffect: (evt: Event) => void;
    setCanvasEventAbility: () => void;
    watchCursorActive(): void;
    setPageScale: (evt: WheelEvent) => void;
    private _handleVisibilityChange;
    private _handleDprChange;
}

declare class HistoryManager {
    private undoStack;
    private redoStack;
    private maxRecordCount;
    constructor(draw: Draw);
    undo(): void;
    redo(): void;
    execute(fn: Function): void;
    isCanUndo(): boolean;
    isCanRedo(): boolean;
    isStackEmpty(): boolean;
    recovery(): void;
    popUndo(): Function | undefined;
}

interface IRangeStyle {
    type: ElementType | null;
    undo: boolean;
    redo: boolean;
    painter: boolean;
    font: string;
    size: number;
    bold: boolean;
    italic: boolean;
    underline: boolean;
    strikeout: boolean;
    color: string | null;
    highlight: string | null;
    rowFlex: RowFlex | null;
    rowMargin: number;
    dashArray: number[];
    level: TitleLevel | null;
    listType: ListType | null;
    listStyle: ListStyle | null;
    groupIds: string[] | null;
    textDecoration: ITextDecoration | null;
    extension?: unknown | null;
}
type IRangeStyleChange = (payload: IRangeStyle) => void;
type IVisiblePageNoListChange = (payload: number[]) => void;
type IIntersectionPageNoChange = (payload: number) => void;
type IPageSizeChange = (payload: number) => void;
type IPageScaleChange = (payload: number) => void;
type ISaved = (payload: IEditorResult) => void;
type IContentChange = () => void;
type IControlChange = (payload: IControlChangeResult) => void;
type IControlContentChange = (payload: IControlContentChangeResult) => void;
type IPageModeChange = (payload: PageMode) => void;
type IZoneChange = (payload: EditorZone) => void;
type IMouseEventChange = (evt: MouseEvent) => void;
type IInputEventChange = (evt: Event) => void;
interface IPositionContextChangePayload {
    value: IPositionContext;
    oldValue: IPositionContext;
}
type IPositionContextChange = (payload: IPositionContextChangePayload) => void;
type IImageSizeChange = (payload: {
    element: IElement;
}) => void;
type IImageMousedown = (payload: {
    evt: MouseEvent;
    element: IElement;
}) => void;
type IImageDblclick = (payload: {
    evt: MouseEvent;
    element: IElement;
}) => void;
type ILabelMousedown = (payload: {
    evt: MouseEvent;
    element: IElement;
}) => void;

declare class Listener {
    rangeStyleChange: IRangeStyleChange | null;
    visiblePageNoListChange: IVisiblePageNoListChange | null;
    intersectionPageNoChange: IIntersectionPageNoChange | null;
    pageSizeChange: IPageSizeChange | null;
    pageScaleChange: IPageScaleChange | null;
    saved: ISaved | null;
    contentChange: IContentChange | null;
    controlChange: IControlChange | null;
    controlContentChange: IControlContentChange | null;
    pageModeChange: IPageModeChange | null;
    zoneChange: IZoneChange | null;
    constructor();
}

declare class Position {
    private cursorPosition;
    private positionContext;
    private positionList;
    private floatPositionList;
    private draw;
    private eventBus;
    private options;
    constructor(draw: Draw);
    getFloatPositionList(): IFloatPosition[];
    getTablePositionList(sourceElementList: IElement[]): IElementPosition[];
    getPositionList(): IElementPosition[];
    getMainPositionList(): IElementPosition[];
    getOriginalPositionList(): IElementPosition[];
    getOriginalMainPositionList(): IElementPosition[];
    getSelectionPositionList(): IElementPosition[] | null;
    setPositionList(payload: IElementPosition[]): void;
    setFloatPositionList(payload: IFloatPosition[]): void;
    computePageRowPosition(payload: IComputePageRowPositionPayload): IComputePageRowPositionResult;
    computePositionList(): void;
    computeRowPosition(payload: IComputeRowPositionPayload): IElementPosition[];
    setCursorPosition(position: IElementPosition | null): void;
    getCursorPosition(): IElementPosition | null;
    getPositionContext(): IPositionContext;
    setPositionContext(payload: IPositionContext): void;
    getPositionByXY(payload: IGetPositionByXYPayload): ICurrentPosition;
    getFloatPositionByXY(payload: IGetFloatPositionByXYPayload): ICurrentPosition | void;
    adjustPositionContext(payload: IGetPositionByXYPayload): ICurrentPosition | null;
    setSurroundPosition(payload: ISetSurroundPositionPayload): {
        x: number;
        rowIncreaseWidth: number;
    };
}

declare class RangeManager {
    private draw;
    private options;
    private range;
    private listener;
    private eventBus;
    private position;
    private historyManager;
    private defaultStyle;
    constructor(draw: Draw);
    getRange(): IRange;
    clearRange(): void;
    setDefaultStyle(style: IRangeElementStyle | null): void;
    getDefaultStyle(): IRangeElementStyle | null;
    getRangeAnchorStyle(elementList: IElement[], anchorIndex: number): IElement | null;
    getIsRangeChange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): boolean;
    getIsCollapsed(): boolean;
    getIsSelection(): boolean;
    getSelection(): IElement[] | null;
    getSelectionElementList(): IElement[] | null;
    getTextLikeSelection(): IElement[] | null;
    getTextLikeSelectionElementList(): IElement[] | null;
    getRangeRow(): RangeRowMap | null;
    getRangeRowElementList(): IElement[] | null;
    getRangeParagraph(): RangeRowArray | null;
    getRangeParagraphInfo(): IRangeParagraphInfo | null;
    getRangeParagraphElementList(): IElement[] | null;
    getRangeTableElement(): IElement | null;
    getIsSelectAll(): boolean;
    getIsPointInRange(x: number, y: number): boolean;
    getKeywordRangeList(payload: string): IRange[];
    getIsCanInput(): boolean;
    setRange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): void;
    replaceRange(range: IRange): void;
    shrinkRange(): void;
    setRangeStyle(): void;
    recoveryRangeStyle(): void;
    shrinkBoundary(context?: IControlContext): void;
    render(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number): void;
    toString(): string;
}

interface INavigateInfo {
    index: number;
    count: number;
}
declare class Search {
    private draw;
    private options;
    private position;
    private range;
    private searchKeyword;
    private searchNavigateIndex;
    private searchOptions;
    private searchMatchList;
    constructor(draw: Draw);
    getSearchKeyword(): string | null;
    setSearchKeyword(payload: string | null, options?: ISearchOption): void;
    searchNavigatePre(): number | null;
    searchNavigateNext(): number | null;
    searchNavigateScrollIntoView(position: IElementPosition): void;
    getSearchNavigateIndexList(): any[];
    getSearchMatchList(): ISearchResult[];
    getSearchNavigateInfo(): null | INavigateInfo;
    getMatchList(payload: string, originalElementList: IElement[]): ISearchResult[];
    compute(payload: string): void;
    render(ctx: CanvasRenderingContext2D, pageIndex: number): void;
    replace(payload: string, option?: IReplaceOption): void;
}

declare class ImageParticle {
    private draw;
    protected options: Required<IEditorOption>;
    protected imageCache: Map<string, HTMLImageElement>;
    private container;
    private floatImageContainer;
    private floatImage;
    constructor(draw: Draw);
    getOriginalMainImageList(): IElement[];
    createFloatImage(element: IElement): void;
    dragFloatImage(movementX: number, movementY: number): void;
    destroyFloatImage(): void;
    protected addImageObserver(promise: Promise<unknown>): void;
    protected getFallbackImage(width: number, height: number): HTMLImageElement;
    private _drawImageWithCrop;
    render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
}

interface IMeasureWordResult {
    width: number;
    endElement: IElement | null;
}
declare class TextParticle {
    private draw;
    private options;
    private ctx;
    private curX;
    private curY;
    private text;
    private curStyle;
    private curColor?;
    cacheMeasureText: Map<string, TextMetrics>;
    constructor(draw: Draw);
    measureBasisWord(ctx: CanvasRenderingContext2D, font: string): ITextMetrics;
    measureWord(ctx: CanvasRenderingContext2D, elementList: IElement[], curIndex: number): IMeasureWordResult;
    measurePunctuationWidth(ctx: CanvasRenderingContext2D, element: IElement): number;
    measureText(ctx: CanvasRenderingContext2D, element: IElement): ITextMetrics;
    getBasisWordBoundingBoxAscent(ctx: CanvasRenderingContext2D, font: string): number;
    complete(): void;
    record(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
    private _setCurXY;
    private _render;
}

declare class TableParticle {
    private draw;
    private range;
    private options;
    constructor(draw: Draw);
    getTrListGroupByCol(payload: ITr[]): ITr[];
    getRangeRowCol(): ITd[][] | null;
    private _drawOuterBorder;
    private _drawSlash;
    private _drawBorder;
    private _drawBackgroundColor;
    getTableWidth(element: IElement): number;
    getTableHeight(element: IElement): number;
    getRowCountByColIndex(trList: ITr[], colIndex: number): number;
    getTdListByColIndex(trList: ITr[], colIndex: number): ITd[];
    getTdListByRowIndex(trList: ITr[], rowIndex: number): ITd[];
    computeRowColInfo(element: IElement): void;
    drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
    render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
}

declare class TableTool {
    private readonly MIN_TD_WIDTH;
    private readonly ROW_COL_OFFSET;
    private readonly ROW_COL_QUICK_WIDTH;
    private readonly ROW_COL_QUICK_OFFSET;
    private readonly ROW_COL_QUICK_POSITION;
    private readonly BORDER_VALUE;
    private readonly TABLE_SELECT_OFFSET;
    private draw;
    private canvas;
    private options;
    private position;
    private range;
    private container;
    private toolRowContainer;
    private toolRowAddBtn;
    private toolColAddBtn;
    private toolTableSelectBtn;
    private toolColContainer;
    private toolBorderContainer;
    private anchorLine;
    private mousedownX;
    private mousedownY;
    constructor(draw: Draw);
    dispose(): void;
    render(): void;
    private _setAnchorActive;
    private _mousedown;
    private _mousemove;
}

declare class HyperlinkParticle {
    private draw;
    private options;
    private container;
    private hyperlinkPopupContainer;
    private hyperlinkDom;
    constructor(draw: Draw);
    private _createHyperlinkPopupDom;
    drawHyperlinkPopup(element: IElement, position: IElementPosition): void;
    clearHyperlinkPopup(): void;
    openHyperlink(element: IElement): void;
    render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
}

declare class Header {
    private draw;
    private position;
    private zone;
    private options;
    private elementList;
    private rowList;
    private positionList;
    constructor(draw: Draw, data?: IElement[]);
    getRowList(): IRow[];
    setElementList(elementList: IElement[]): void;
    getElementList(): IElement[];
    getPositionList(): IElementPosition[];
    compute(): void;
    recovery(): void;
    private _computeRowList;
    private _computePositionList;
    getHeaderTop(): number;
    getMaxHeight(): number;
    getHeight(): number;
    getRowHeight(): number;
    getEffectiveBottomY(): number;
    getExtraHeight(): number;
    render(ctx: CanvasRenderingContext2D, pageNo: number): void;
}

interface IMoveCursorResult {
    newIndex: number;
    newElement: IElement;
}
declare class Control {
    private controlBorder;
    private draw;
    private range;
    private listener;
    private eventBus;
    private controlSearch;
    private options;
    private controlOptions;
    private activeControl;
    private activeControlValue;
    private preElement;
    constructor(draw: Draw);
    setHighlightList(payload: IControlHighlight[]): void;
    computeHighlightList(): void;
    renderHighlightList(ctx: CanvasRenderingContext2D, pageNo: number): void;
    getDraw(): Draw;
    filterAssistElement(elementList: IElement[]): IElement[];
    getIsRangeCanCaptureEvent(): boolean;
    getIsRangeInPostfix(): boolean;
    getIsRangeWithinControl(): boolean;
    getIsElementListContainFullControl(elementList: IElement[]): boolean;
    getIsDisabledControl(context?: IControlContext): boolean;
    getIsDisabledPasteControl(context?: IControlContext): boolean;
    getIsExistValueByElementListIndex(elementList: IElement[], index: number): boolean;
    getControlHighlight(elementList: IElement[], index: number): string;
    getContainer(): HTMLDivElement;
    getElementList(): IElement[];
    getPosition(): IElementPosition | null;
    getPreY(): number;
    getRange(): IRange;
    getValueRange(context?: IControlContext): IRange | null;
    shrinkBoundary(context?: IControlContext): void;
    getActiveControl(): IControlInstance | null;
    getControlElementList(context?: IControlContext): IElement[];
    updateActiveControlValue(): void;
    emitControlChange(state: ControlState): void;
    initControl(): void;
    destroyControl(options?: IDestroyControlOption): void;
    repaintControl(options?: IRepaintControlOption): void;
    emitControlContentChange(options?: IControlChangeOption): void;
    reAwakeControl(): void;
    selectValue(): boolean;
    moveCursor(position: IControlInitOption): IMoveCursorResult;
    removeControl(startIndex: number, context?: IControlContext): number | null;
    removePlaceholder(startIndex: number, context?: IControlContext): void;
    addPlaceholder(startIndex: number, context?: IControlContext): void;
    setValue(data: IElement[]): number;
    setControlProperties(properties: Partial<IControl>, context?: IControlContext): void;
    keydown(evt: KeyboardEvent): number | null;
    cut(): number;
    getValueById(payload: IGetControlValueOption): IGetControlValueResult;
    setValueListById(payload: ISetControlValueOption[]): void;
    setExtensionListById(payload: ISetControlExtensionOption[]): void;
    setPropertiesListById(payload: ISetControlProperties[]): void;
    getList(): IElement[];
    recordBorderInfo(x: number, y: number, width: number, height: number): void;
    drawBorder(ctx: CanvasRenderingContext2D): void;
    getPreControlContext(): INextControlContext | null;
    getNextControlContext(): INextControlContext | null;
    initNextControl(option?: IInitNextControlOption): void;
    setMinWidthControlInfo(option: ISetControlRowFlexOption): void;
}

interface ICheckboxRenderOption {
    ctx: CanvasRenderingContext2D;
    x: number;
    y: number;
    row: IRow;
    index: number;
}
declare class CheckboxParticle {
    private draw;
    private options;
    constructor(draw: Draw);
    setSelect(element: IElement): void;
    render(payload: ICheckboxRenderOption): void;
}

interface IRadioRenderOption {
    ctx: CanvasRenderingContext2D;
    x: number;
    y: number;
    row: IRow;
    index: number;
}
declare class RadioParticle {
    private draw;
    private options;
    constructor(draw: Draw);
    setSelect(element: IElement): void;
    render(payload: IRadioRenderOption): void;
}

declare class WorkerManager {
    private draw;
    constructor(draw: Draw);
    getWordCount(): Promise<number>;
    getCatalog(): Promise<ICatalog | null>;
    getGroupIds(): Promise<string[]>;
    getValue(options?: IGetValueOption): Promise<IEditorResult>;
}

interface IPreviewerDrawOption {
    mime?: 'png' | 'jpg' | 'jpeg' | 'svg';
    srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>;
    dragDisable?: boolean;
}

declare class Previewer {
    private container;
    private canvas;
    private draw;
    private options;
    private curElement;
    private curElementSrc;
    private previewerDrawOption;
    private curPosition;
    private eventBus;
    private imageList;
    private curShowElement;
    private imageCount;
    private imagePre;
    private imageNext;
    private resizerSelection;
    private resizerHandleList;
    private resizerImageContainer;
    private resizerImage;
    private resizerSize;
    private width;
    private height;
    private mousedownX;
    private mousedownY;
    private curHandleIndex;
    private previewerContainer;
    private previewerImage;
    constructor(draw: Draw);
    private _getElementPosition;
    private _createResizerDom;
    private _keydown;
    private _mousedown;
    private _mousemove;
    private _drawPreviewer;
    private _updateImageNavigate;
    _setPreviewerTransform(scale: number, rotate: number, x: number, y: number): void;
    private _clearPreviewer;
    _updateResizerRect(width: number, height: number): void;
    _updateResizerSizeView(width: number, height: number): void;
    render(): void;
    drawResizer(element: IElement, position?: IElementPosition | null, options?: IPreviewerDrawOption): void;
    updateResizer(element: IElement, position?: IElementPosition | null): void;
    clearResizer(): void;
}

declare class DateParticle {
    private draw;
    private range;
    private datePicker;
    private options;
    constructor(draw: Draw);
    private _setValue;
    getDateElementRange(): [number, number] | null;
    clearDatePicker(): void;
    renderDatePicker(element: IElement, position: IElementPosition): void;
}

interface IDatePickerLang {
    now: string;
    confirm: string;
    return: string;
    timeSelect: string;
    weeks: {
        sun: string;
        mon: string;
        tue: string;
        wed: string;
        thu: string;
        fri: string;
        sat: string;
    };
    year: string;
    month: string;
    hour: string;
    minute: string;
    second: string;
}

interface IContextMenuContext {
    startElement: IElement | null;
    endElement: IElement | null;
    isReadonly: boolean;
    editorHasSelection: boolean;
    editorTextFocus: boolean;
    isInTable: boolean;
    isCrossRowCol: boolean;
    zone: EditorZone;
    trIndex: number | null;
    tdIndex: number | null;
    tableElement: IElement | null;
    options: DeepRequired<IEditorOption>;
}
interface IRegisterContextMenu {
    key?: string;
    i18nPath?: string;
    isDivider?: boolean;
    icon?: string;
    name?: string;
    shortCut?: string;
    disable?: boolean;
    when?: (payload: IContextMenuContext) => boolean;
    callback?: (command: Command, context: IContextMenuContext) => void;
    childMenus?: IRegisterContextMenu[];
}
interface IContextmenuLang {
    global: {
        cut: string;
        copy: string;
        paste: string;
        selectAll: string;
        print: string;
    };
    control: {
        delete: string;
    };
    hyperlink: {
        delete: string;
        cancel: string;
        edit: string;
    };
    image: {
        change: string;
        saveAs: string;
        textWrap: string;
        textWrapType: {
            embed: string;
            upDown: string;
        };
    };
    table: {
        insertRowCol: string;
        insertTopRow: string;
        insertBottomRow: string;
        insertLeftCol: string;
        insertRightCol: string;
        deleteRowCol: string;
        deleteRow: string;
        deleteCol: string;
        deleteTable: string;
        mergeCell: string;
        mergeCancelCell: string;
    };
}

interface ILang {
    contextmenu: IContextmenuLang;
    datePicker: IDatePickerLang;
}

declare class I18n {
    private currentLocale;
    private langMap;
    constructor(locale: string);
    registerLangMap(locale: string, lang: DeepPartial<ILang>): void;
    getLocale(): string;
    setLocale(locale: string): void;
    getLang(): ILang;
    t(path: string): string;
}

declare class ImageObserver {
    private promiseList;
    constructor();
    add(payload: Promise<unknown>): void;
    clearAll(): void;
    allSettled(): Promise<PromiseSettledResult<unknown>[]>;
}

declare class Zone {
    private readonly INDICATOR_PADDING;
    private readonly INDICATOR_TITLE_TRANSLATE;
    private draw;
    private options;
    private i18n;
    private container;
    private currentZone;
    private indicatorContainer;
    private dropdownContainer;
    private dropdownClickHandler;
    constructor(draw: Draw);
    isHeaderActive(): boolean;
    isMainActive(): boolean;
    isFooterActive(): boolean;
    getZone(): EditorZone;
    setZone(payload: EditorZone): void;
    getZoneByY(y: number): EditorZone;
    drawZoneIndicator(): void;
    private _toggleDropdown;
    private _closeDropdown;
    private _openFormatDialog;
    private _clearZoneIndicator;
}

declare class Footer {
    private readonly MIN_BAR_HEIGHT;
    private draw;
    private position;
    private zone;
    private options;
    private elementList;
    private rowList;
    private positionList;
    constructor(draw: Draw, data?: IElement[]);
    getRowList(): IRow[];
    setElementList(elementList: IElement[]): void;
    getElementList(): IElement[];
    getPositionList(): IElementPosition[];
    compute(): void;
    recovery(): void;
    private _computeRowList;
    private _computePositionList;
    getFooterBottom(): number;
    getMaxHeight(): number;
    getHeight(): number;
    getRowHeight(): number;
    getEffectiveTopY(): number;
    getExtraHeight(): number;
    render(ctx: CanvasRenderingContext2D, pageNo: number): void;
}

declare class ListParticle {
    private draw;
    private range;
    private options;
    private readonly UN_COUNT_STYLE_WIDTH;
    private readonly MEASURE_BASE_TEXT;
    private readonly LIST_GAP;
    constructor(draw: Draw);
    setList(listType: ListType | null, listStyle?: ListStyle): void;
    setListWithPreset(listType: ListType, listStyle: ListStyle, preset: string): void;
    indent(): void;
    outdent(): void;
    unsetList(): void;
    getListIndentWidth(element: IElement): number;
    computeListStyle(ctx: CanvasRenderingContext2D, elementList: IElement[]): Map<string, number>;
    getListStyleWidth(ctx: CanvasRenderingContext2D, listElementList: IElement[]): number;
    private _getOlStyleForLevel;
    private _getUlBulletForLevel;
    drawListStyle(ctx: CanvasRenderingContext2D, row: IRow, position: IElementPosition): void;
}

declare class EventBus<EventMap> {
    private eventHub;
    constructor();
    on<K extends string & keyof EventMap>(eventName: K, callback: EventMap[K]): void;
    emit<K extends string & keyof EventMap>(eventName: K, payload?: EventMap[K] extends (payload: infer P) => void ? P : never): any;
    off<K extends string & keyof EventMap>(eventName: K, callback: EventMap[K]): void;
    isSubscribe<K extends string & keyof EventMap>(eventName: K): boolean;
    dangerouslyClearAll(): void;
}

interface EventBusMap {
    rangeStyleChange: IRangeStyleChange;
    visiblePageNoListChange: IVisiblePageNoListChange;
    intersectionPageNoChange: IIntersectionPageNoChange;
    pageSizeChange: IPageSizeChange;
    pageScaleChange: IPageScaleChange;
    saved: ISaved;
    contentChange: IContentChange;
    controlChange: IControlChange;
    controlContentChange: IControlContentChange;
    pageModeChange: IPageModeChange;
    zoneChange: IZoneChange;
    mousemove: IMouseEventChange;
    mouseleave: IMouseEventChange;
    mouseenter: IMouseEventChange;
    mousedown: IMouseEventChange;
    mouseup: IMouseEventChange;
    click: IMouseEventChange;
    input: IInputEventChange;
    positionContextChange: IPositionContextChange;
    imageSizeChange: IImageSizeChange;
    imageMousedown: IImageMousedown;
    imageDblclick: IImageDblclick;
    labelMousedown: ILabelMousedown;
}

declare class Group {
    private draw;
    private options;
    private range;
    private fillRectMap;
    constructor(draw: Draw);
    setGroup(): string | null;
    getElementListByGroupId(elementList: IElement[], groupId: string): IElement[];
    deleteGroup(groupId: string): void;
    getContextByGroupId(elementList: IElement[], groupId: string): (IRange & IPositionContext) | null;
    clearFillInfo(): void;
    recordFillInfo(element: IElement, x: number, y: number, width: number, height: number): void;
    render(ctx: CanvasRenderingContext2D): void;
}

interface IOverrideResult {
    preventDefault?: boolean;
}
declare class Override {
    paste: ((evt?: ClipboardEvent) => unknown | IOverrideResult) | undefined;
    copy: (() => unknown | IOverrideResult) | undefined;
    drop: ((evt: DragEvent) => unknown | IOverrideResult) | undefined;
}

declare class LineBreakParticle {
    private options;
    static readonly WIDTH = 12;
    static readonly HEIGHT = 9;
    static readonly GAP = 3;
    constructor(draw: Draw);
    render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
}

declare class TableOperate {
    private draw;
    private range;
    private position;
    private tableTool;
    private tableParticle;
    private options;
    constructor(draw: Draw);
    insertTable(row: number, col: number): void;
    insertTableTopRow(): void;
    insertTableBottomRow(): void;
    adjustColWidth(element: IElement): void;
    insertTableLeftCol(): void;
    insertTableRightCol(): void;
    deleteTableRow(): void;
    deleteTableCol(): void;
    deleteTable(): void;
    mergeTableCell(): void;
    cancelMergeTableCell(): void;
    splitVerticalTableCell(): void;
    splitHorizontalTableCell(): void;
    tableTdVerticalAlign(payload: VerticalAlign): void;
    tableBorderType(payload: TableBorder): void;
    tableBorderColor(payload: string): void;
    tableTdBorderType(payload: TdBorder): void;
    tableTdSlashType(payload: TdSlash): void;
    tableTdBackgroundColor(payload: string): void;
    tableSelectAll(): void;
}

declare class Area {
    private draw;
    private zone;
    private range;
    private position;
    private options;
    private areaInfoMap;
    constructor(draw: Draw);
    getAreaInfo(): Map<string, IAreaInfo>;
    getActiveAreaId(): string | null;
    getActiveAreaInfo(): IAreaInfo | null;
    isReadonly(): boolean;
    insertArea(payload: IInsertAreaOption): string | null;
    render(ctx: CanvasRenderingContext2D, pageNo: number): void;
    compute(): void;
    getAreaValue(options?: IGetAreaValueOption): IGetAreaValueResult | null;
    getContextByAreaId(areaId: string, options?: ILocationAreaOption): {
        range: IRange;
        elementPosition: IElementPosition;
    } | null;
    setAreaProperties(payload: ISetAreaPropertiesOption): void;
    setAreaValue(payload: ISetAreaValueOption): void;
}

declare class Badge {
    private draw;
    private options;
    private imageCache;
    private mainBadge;
    private areaBadgeMap;
    constructor(draw: Draw);
    setMainBadge(payload: IBadge | null): void;
    setAreaBadgeMap(payload: IAreaBadge[]): void;
    private _drawImage;
    render(ctx: CanvasRenderingContext2D, pageNo: number): void;
}

declare class Graffiti {
    private draw;
    private options;
    private data;
    private pageContainer;
    private isDrawing;
    private startStroke;
    constructor(draw: Draw, data?: IGraffitiData[]);
    private register;
    private start;
    private stop;
    private drawing;
    getValue(): IGraffitiData[];
    compute(): void;
    clear(): void;
    render(ctx: CanvasRenderingContext2D, pageNo: number): void;
}

declare class Draw {
    private container;
    private pageContainer;
    private pageList;
    private ctxList;
    private pageNo;
    private renderCount;
    private pagePixelRatio;
    private mode;
    private options;
    private position;
    private zone;
    private elementList;
    private listener;
    private eventBus;
    private override;
    private i18n;
    private canvasEvent;
    private globalEvent;
    private cursor;
    private range;
    private margin;
    private background;
    private badge;
    private search;
    private group;
    private area;
    private underline;
    private strikeout;
    private highlight;
    private historyManager;
    private previewer;
    private imageParticle;
    private laTexParticle;
    private textParticle;
    private tableParticle;
    private tableTool;
    private tableOperate;
    private pageNumber;
    private lineNumber;
    private waterMark;
    private placeholder;
    private header;
    private footer;
    private hyperlinkParticle;
    private labelParticle;
    private dateParticle;
    private separatorParticle;
    private pageBreakParticle;
    private columnBreakParticle;
    private superscriptParticle;
    private subscriptParticle;
    private checkboxParticle;
    private radioParticle;
    private blockParticle;
    private listParticle;
    private lineBreakParticle;
    private whiteSpaceParticle;
    private control;
    private pageBorder;
    private workerManager;
    private scrollObserver;
    private selectionObserver;
    private imageObserver;
    private graffiti;
    private LETTER_REG;
    private WORD_LIKE_REG;
    private rowList;
    private pageRowList;
    private painterStyle;
    private painterOptions;
    private visiblePageNoList;
    private intersectionPageNo;
    private lazyRenderIntersectionObserver;
    private printModeData;
    constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>, override: Override);
    setPrintData(): void;
    clearPrintData(): void;
    getLetterReg(): RegExp;
    getMode(): EditorMode;
    setMode(payload: EditorMode): void;
    isReadonly(): boolean;
    isDisabled(): boolean;
    isDesignMode(): boolean;
    isPrintMode(): boolean;
    isGraffitiMode(): boolean;
    getOriginalWidth(): number;
    getOriginalHeight(): number;
    getWidth(): number;
    getHeight(): number;
    getMainHeight(): number;
    getMainOuterHeight(): number;
    getCanvasWidth(pageNo?: number): number;
    getCanvasHeight(pageNo?: number): number;
    getInnerWidth(): number;
    getColumnCount(): number;
    getColumnWidth(): number;
    getOriginalInnerWidth(): number;
    getContextInnerWidth(): number;
    getMargins(): IMargin;
    getOriginalMargins(): number[];
    getPageGap(): number;
    getOriginalPageGap(): number;
    getPageNumberBottom(): number;
    getMarginIndicatorSize(): number;
    getDefaultBasicRowMarginHeight(): number;
    getHighlightMarginHeight(): number;
    getTdPadding(): IPadding;
    getContainer(): HTMLDivElement;
    getPageContainer(): HTMLDivElement;
    getVisiblePageNoList(): number[];
    setVisiblePageNoList(payload: number[]): void;
    getIntersectionPageNo(): number;
    setIntersectionPageNo(payload: number): void;
    getPageNo(): number;
    setPageNo(payload: number): void;
    getRenderCount(): number;
    getPage(pageNo?: number): HTMLCanvasElement;
    getPageList(): HTMLCanvasElement[];
    getPageCount(): number;
    getTableRowList(sourceElementList: IElement[]): IRow[];
    getOriginalRowList(): IRow[];
    getRowList(): IRow[];
    getPageRowList(): IRow[][];
    getCtx(): CanvasRenderingContext2D;
    getOptions(): DeepRequired<IEditorOption>;
    getSearch(): Search;
    getGroup(): Group;
    getArea(): Area;
    getBadge(): Badge;
    getHistoryManager(): HistoryManager;
    getPosition(): Position;
    getZone(): Zone;
    getRange(): RangeManager;
    getLineBreakParticle(): LineBreakParticle;
    getTextParticle(): TextParticle;
    getHeaderElementList(): IElement[];
    getTableElementList(sourceElementList: IElement[]): IElement[];
    getElementList(): IElement[];
    getMainElementList(): IElement[];
    getOriginalElementList(): IElement[];
    getOriginalMainElementList(): IElement[];
    getFooterElementList(): IElement[];
    getTd(): ITd | null;
    insertElementList(payload: IElement[], options?: IInsertElementListOption): void;
    appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
    spliceElementList(elementList: IElement[], start: number, deleteCount: number, items?: IElement[], options?: ISpliceElementListOption): void;
    getCanvasEvent(): CanvasEvent;
    getGlobalEvent(): GlobalEvent;
    getListener(): Listener;
    getEventBus(): EventBus<EventBusMap>;
    getOverride(): Override;
    getCursor(): Cursor;
    getPreviewer(): Previewer;
    getImageParticle(): ImageParticle;
    getTableTool(): TableTool;
    getTableOperate(): TableOperate;
    getTableParticle(): TableParticle;
    getHeader(): Header;
    getFooter(): Footer;
    getHyperlinkParticle(): HyperlinkParticle;
    getDateParticle(): DateParticle;
    getListParticle(): ListParticle;
    getCheckboxParticle(): CheckboxParticle;
    getRadioParticle(): RadioParticle;
    getControl(): Control;
    getWorkerManager(): WorkerManager;
    getImageObserver(): ImageObserver;
    getI18n(): I18n;
    getGraffiti(): Graffiti;
    getRowCount(): number;
    getDataURL(payload?: IGetImageOption): Promise<string[]>;
    getPainterStyle(): IElementStyle | null;
    getPainterOptions(): IPainterOption | null;
    setPainterStyle(payload: IElementStyle | null, options?: IPainterOption): void;
    setDefaultRange(): void;
    getIsPagingMode(): boolean;
    setPageMode(payload: PageMode): void;
    setColumnCount(count: number): void;
    setColumnGap(gap: number): void;
    setPageScale(payload: number): void;
    getPagePixelRatio(): number;
    setPagePixelRatio(payload: number | null): void;
    setPageDevicePixel(): void;
    setPaperSize(width: number, height: number): void;
    setPaperDirection(payload: PaperDirection): void;
    setPaperMargin(payload: IMargin): void;
    getOriginValue(options?: IGetOriginValueOption): Required<IEditorData>;
    getValue(options?: IGetValueOption): IEditorResult;
    setValue(payload: Partial<IEditorData>, options?: ISetValueOption): void;
    setEditorData(payload: Partial<Omit<IEditorData, 'graffiti'>>): void;
    private _wrapContainer;
    private _formatContainer;
    private _createPageContainer;
    private _createPage;
    private _initPageContext;
    getElementFont(el: IElement, scale?: number): string;
    getElementSize(el: IElement): number;
    getElementRowMargin(el: IElement): number;
    computeRowList(payload: IComputeRowListPayload): IRow[];
    private _computePageList;
    private _drawHighlight;
    drawRow(ctx: CanvasRenderingContext2D, payload: IDrawRowPayload): void;
    private _drawFloat;
    private _clearPage;
    private _drawColumnGuide;
    private _drawPage;
    private _disconnectLazyRender;
    private _lazyRender;
    private _immediateRender;
    render(payload?: IDrawOption): void;
    setCursor(curIndex: number | undefined): number | undefined;
    submitHistory(curIndex: number | undefined): void;
    destroy(): void;
    clearSideEffect(): void;
}

interface IRichtextOption {
    isIgnoreDisabledRule: boolean;
}

declare class CommandAdapt {
    private draw;
    private range;
    private position;
    private historyManager;
    private canvasEvent;
    private options;
    private control;
    private workerManager;
    private searchManager;
    private i18n;
    private zone;
    private tableOperate;
    constructor(draw: Draw);
    mode(payload: EditorMode): void;
    cut(): Promise<void>;
    copy(payload?: ICopyOption): Promise<void>;
    paste(payload?: IPasteOption): void;
    selectAll(): void;
    backspace(): void;
    setRange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): void;
    replaceRange(range: IRange): void;
    setPositionContext(range: IRange): void;
    forceUpdate(options?: IForceUpdateOption): void;
    blur(): void;
    undo(): void;
    redo(): void;
    painter(options: IPainterOption): void;
    applyPainterStyle(): void;
    format(options?: IRichtextOption): void;
    font(payload: string, options?: IRichtextOption): void;
    size(payload: number, options?: IRichtextOption): void;
    sizeAdd(options?: IRichtextOption): void;
    sizeMinus(options?: IRichtextOption): void;
    bold(options?: IRichtextOption): void;
    italic(options?: IRichtextOption): void;
    underline(textDecoration?: ITextDecoration, options?: IRichtextOption): void;
    strikeout(options?: IRichtextOption): void;
    superscript(options?: IRichtextOption): void;
    subscript(options?: IRichtextOption): void;
    color(payload: string | null, options?: IRichtextOption): void;
    highlight(payload: string | null, options?: IRichtextOption): void;
    title(payload: TitleLevel | null): void;
    list(listType: ListType | null, listStyle?: ListStyle): void;
    listWithPreset(listType: ListType, listStyle: ListStyle, preset: string): void;
    listIndent(): void;
    listOutdent(): void;
    rowFlex(payload: RowFlex): void;
    rowMargin(payload: number): void;
    insertTable(row: number, col: number): void;
    insertTableTopRow(): void;
    insertTableBottomRow(): void;
    insertTableLeftCol(): void;
    insertTableRightCol(): void;
    deleteTableRow(): void;
    deleteTableCol(): void;
    deleteTable(): void;
    mergeTableCell(): void;
    cancelMergeTableCell(): void;
    splitVerticalTableCell(): void;
    splitHorizontalTableCell(): void;
    tableTdVerticalAlign(payload: VerticalAlign): void;
    tableBorderType(payload: TableBorder): void;
    tableBorderColor(payload: string): void;
    tableTdBorderType(payload: TdBorder): void;
    tableTdSlashType(payload: TdSlash): void;
    tableTdBackgroundColor(payload: string): void;
    tableSelectAll(): void;
    hyperlink(payload: Pick<IElement, 'valueList' | 'hyperlinkId' | 'url'>): void;
    getHyperlinkRange(): [number, number] | null;
    deleteHyperlink(): void;
    cancelHyperlink(): void;
    editHyperlink(payload: string): void;
    separator(dashArray: number[], option?: {
        lineWidth?: number;
        color?: string;
    }): void;
    pageBreak(): void;
    addWatermark(payload: IWatermark): void;
    deleteWatermark(): void;
    image(payload: IDrawImagePayload): string | null;
    search(payload: string | null, options?: ISearchOption): void;
    searchNavigatePre(): void;
    searchNavigateNext(): void;
    getSearchNavigateInfo(): null | INavigateInfo;
    replace(payload: string, option?: IReplaceOption): void;
    print(): Promise<void>;
    replaceImageElement(payload: string): void;
    saveAsImageElement(): void;
    setImageCrop(crop: IImageCrop): void;
    changeImageDisplay(element: IElement, display: ImageDisplay): void;
    getImage(payload?: IGetImageOption): Promise<string[]>;
    getOptions(): DeepRequired<IEditorOption>;
    getValue(options?: IGetValueOption): IEditorResult;
    getValueAsync(options?: IGetValueOption): Promise<IEditorResult>;
    getAreaValue(options?: IGetAreaValueOption): IGetAreaValueResult | null;
    getHTML(): IEditorHTML;
    getText(): IEditorText;
    getWordCount(): Promise<number>;
    getCursorPosition(): IElementPosition | null;
    getRange(): IRange;
    getRangeText(): string;
    getRangeContext(): RangeContext | null;
    getRangeRow(): IElement[] | null;
    getRangeParagraph(): IElement[] | null;
    getKeywordRangeList(payload: string): IRange[];
    getKeywordContext(payload: string): ISearchResultContext[] | null;
    pageMode(payload: PageMode): void;
    pageScale(scale: number): void;
    pageScaleRecovery(): void;
    pageScaleMinus(): void;
    pageScaleAdd(): void;
    paperSize(width: number, height: number): void;
    paperDirection(payload: PaperDirection): void;
    getPaperMargin(): number[];
    setPaperMargin(payload: IMargin): void;
    setMainBadge(payload: IBadge | null): void;
    setAreaBadge(payload: IAreaBadge[]): void;
    insertElementList(payload: IElement[], options?: IInsertElementListOption): void;
    appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
    updateElementById(payload: IUpdateElementByIdOption): void;
    deleteElementById(payload: IDeleteElementByIdOption): void;
    getElementById(payload: IGetElementByIdOption): IElement[];
    setValue(payload: Partial<IEditorData>, options?: ISetValueOption): void;
    removeControl(payload?: IRemoveControlOption): void;
    translate(path: string): string;
    setLocale(payload: string): void;
    getLocale(): string;
    getCatalog(): Promise<ICatalog | null>;
    locationCatalog(titleId: string): void;
    wordTool(): void;
    setHTML(payload: Partial<IEditorHTML>): void;
    setGroup(): string | null;
    deleteGroup(groupId: string): void;
    getGroupIds(): Promise<string[]>;
    locationGroup(groupId: string): void;
    setZone(zone: EditorZone): void;
    getControlValue(payload: IGetControlValueOption): IGetControlValueResult | null;
    setControlValue(payload: ISetControlValueOption): void;
    setControlValueList(payload: ISetControlValueOption[]): void;
    setControlExtension(payload: ISetControlExtensionOption): void;
    setControlExtensionList(payload: ISetControlExtensionOption[]): void;
    setControlProperties(payload: ISetControlProperties): void;
    setControlPropertiesList(payload: ISetControlProperties[]): void;
    setControlHighlight(payload: ISetControlHighlightOption): void;
    updateOptions(payload: IUpdateOption): void;
    getControlList(): IElement[];
    locationControl(controlId: string, options?: ILocationControlOption): void;
    insertControl(payload: IElement): void;
    jumpControl(payload?: {
        direction?: MoveDirection;
    }): void;
    getContainer(): HTMLDivElement;
    getTitleValue(payload: IGetTitleValueOption): IGetTitleValueResult | null;
    getPositionContextByEvent(evt: MouseEvent, options?: IPositionContextByEventOption): IPositionContextByEventResult | null;
    insertTitle(payload: IElement): void;
    focus(payload?: IFocusOption): void;
    insertArea(payload: IInsertAreaOption): string | null;
    setAreaValue(payload: ISetAreaValueOption): void;
    setAreaProperties(payload: ISetAreaPropertiesOption): void;
    locationArea(areaId: string, options?: ILocationAreaOption): void;
    clearGraffiti(): void;
    columnCount(payload: number): void;
    columnBreak(): void;
    columnGap(gap: number): void;
}

declare class Command {
    executeMode: CommandAdapt['mode'];
    executeCut: CommandAdapt['cut'];
    executeCopy: CommandAdapt['copy'];
    executePaste: CommandAdapt['paste'];
    executeSelectAll: CommandAdapt['selectAll'];
    executeBackspace: CommandAdapt['backspace'];
    executeSetRange: CommandAdapt['setRange'];
    executeReplaceRange: CommandAdapt['replaceRange'];
    executeSetPositionContext: CommandAdapt['setPositionContext'];
    executeForceUpdate: CommandAdapt['forceUpdate'];
    executeBlur: CommandAdapt['blur'];
    executeUndo: CommandAdapt['undo'];
    executeRedo: CommandAdapt['redo'];
    executePainter: CommandAdapt['painter'];
    executeApplyPainterStyle: CommandAdapt['applyPainterStyle'];
    executeFormat: CommandAdapt['format'];
    executeFont: CommandAdapt['font'];
    executeSize: CommandAdapt['size'];
    executeSizeAdd: CommandAdapt['sizeAdd'];
    executeSizeMinus: CommandAdapt['sizeMinus'];
    executeBold: CommandAdapt['bold'];
    executeItalic: CommandAdapt['italic'];
    executeUnderline: CommandAdapt['underline'];
    executeStrikeout: CommandAdapt['strikeout'];
    executeSuperscript: CommandAdapt['superscript'];
    executeSubscript: CommandAdapt['subscript'];
    executeColor: CommandAdapt['color'];
    executeHighlight: CommandAdapt['highlight'];
    executeTitle: CommandAdapt['title'];
    executeList: CommandAdapt['list'];
    executeListWithPreset: CommandAdapt['listWithPreset'];
    executeListIndent: CommandAdapt['listIndent'];
    executeListOutdent: CommandAdapt['listOutdent'];
    executeRowFlex: CommandAdapt['rowFlex'];
    executeRowMargin: CommandAdapt['rowMargin'];
    executeInsertTable: CommandAdapt['insertTable'];
    executeInsertTableTopRow: CommandAdapt['insertTableTopRow'];
    executeInsertTableBottomRow: CommandAdapt['insertTableBottomRow'];
    executeInsertTableLeftCol: CommandAdapt['insertTableLeftCol'];
    executeInsertTableRightCol: CommandAdapt['insertTableRightCol'];
    executeDeleteTableRow: CommandAdapt['deleteTableRow'];
    executeDeleteTableCol: CommandAdapt['deleteTableCol'];
    executeDeleteTable: CommandAdapt['deleteTable'];
    executeMergeTableCell: CommandAdapt['mergeTableCell'];
    executeCancelMergeTableCell: CommandAdapt['cancelMergeTableCell'];
    executeSplitVerticalTableCell: CommandAdapt['splitVerticalTableCell'];
    executeSplitHorizontalTableCell: CommandAdapt['splitHorizontalTableCell'];
    executeTableTdVerticalAlign: CommandAdapt['tableTdVerticalAlign'];
    executeTableBorderType: CommandAdapt['tableBorderType'];
    executeTableBorderColor: CommandAdapt['tableBorderColor'];
    executeTableTdBorderType: CommandAdapt['tableTdBorderType'];
    executeTableTdSlashType: CommandAdapt['tableTdSlashType'];
    executeTableTdBackgroundColor: CommandAdapt['tableTdBackgroundColor'];
    executeTableSelectAll: CommandAdapt['tableSelectAll'];
    executeImage: CommandAdapt['image'];
    executeHyperlink: CommandAdapt['hyperlink'];
    executeDeleteHyperlink: CommandAdapt['deleteHyperlink'];
    executeCancelHyperlink: CommandAdapt['cancelHyperlink'];
    executeEditHyperlink: CommandAdapt['editHyperlink'];
    executeSeparator: CommandAdapt['separator'];
    executePageBreak: CommandAdapt['pageBreak'];
    executeAddWatermark: CommandAdapt['addWatermark'];
    executeDeleteWatermark: CommandAdapt['deleteWatermark'];
    executeSearch: CommandAdapt['search'];
    executeSearchNavigatePre: CommandAdapt['searchNavigatePre'];
    executeSearchNavigateNext: CommandAdapt['searchNavigateNext'];
    executeReplace: CommandAdapt['replace'];
    executePrint: CommandAdapt['print'];
    executeReplaceImageElement: CommandAdapt['replaceImageElement'];
    executeSaveAsImageElement: CommandAdapt['saveAsImageElement'];
    executeSetImageCrop: CommandAdapt['setImageCrop'];
    executeChangeImageDisplay: CommandAdapt['changeImageDisplay'];
    executePageMode: CommandAdapt['pageMode'];
    executePageScale: CommandAdapt['pageScale'];
    executePageScaleRecovery: CommandAdapt['pageScaleRecovery'];
    executePageScaleMinus: CommandAdapt['pageScaleMinus'];
    executePageScaleAdd: CommandAdapt['pageScaleAdd'];
    executePaperSize: CommandAdapt['paperSize'];
    executePaperDirection: CommandAdapt['paperDirection'];
    executeSetPaperMargin: CommandAdapt['setPaperMargin'];
    executeSetMainBadge: CommandAdapt['setMainBadge'];
    executeSetAreaBadge: CommandAdapt['setAreaBadge'];
    executeInsertElementList: CommandAdapt['insertElementList'];
    executeInsertArea: CommandAdapt['insertArea'];
    executeSetAreaValue: CommandAdapt['setAreaValue'];
    executeSetAreaProperties: CommandAdapt['setAreaProperties'];
    executeLocationArea: CommandAdapt['locationArea'];
    executeClearGraffiti: CommandAdapt['clearGraffiti'];
    executeColumnCount: CommandAdapt['columnCount'];
    executeColumnBreak: CommandAdapt['columnBreak'];
    executeColumnGap: CommandAdapt['columnGap'];
    executeAppendElementList: CommandAdapt['appendElementList'];
    executeUpdateElementById: CommandAdapt['updateElementById'];
    executeDeleteElementById: CommandAdapt['deleteElementById'];
    executeSetValue: CommandAdapt['setValue'];
    executeRemoveControl: CommandAdapt['removeControl'];
    executeTranslate: CommandAdapt['translate'];
    executeSetLocale: CommandAdapt['setLocale'];
    executeLocationCatalog: CommandAdapt['locationCatalog'];
    executeWordTool: CommandAdapt['wordTool'];
    executeSetHTML: CommandAdapt['setHTML'];
    executeSetGroup: CommandAdapt['setGroup'];
    executeDeleteGroup: CommandAdapt['deleteGroup'];
    executeLocationGroup: CommandAdapt['locationGroup'];
    executeSetZone: CommandAdapt['setZone'];
    executeSetControlValue: CommandAdapt['setControlValue'];
    executeSetControlValueList: CommandAdapt['setControlValueList'];
    executeSetControlExtension: CommandAdapt['setControlExtension'];
    executeSetControlExtensionList: CommandAdapt['setControlExtensionList'];
    executeSetControlProperties: CommandAdapt['setControlProperties'];
    executeSetControlPropertiesList: CommandAdapt['setControlPropertiesList'];
    executeSetControlHighlight: CommandAdapt['setControlHighlight'];
    executeLocationControl: CommandAdapt['locationControl'];
    executeInsertControl: CommandAdapt['insertControl'];
    executeJumpControl: CommandAdapt['jumpControl'];
    executeUpdateOptions: CommandAdapt['updateOptions'];
    executeInsertTitle: CommandAdapt['insertTitle'];
    executeFocus: CommandAdapt['focus'];
    getCatalog: CommandAdapt['getCatalog'];
    getImage: CommandAdapt['getImage'];
    getOptions: CommandAdapt['getOptions'];
    getValue: CommandAdapt['getValue'];
    getValueAsync: CommandAdapt['getValueAsync'];
    getAreaValue: CommandAdapt['getAreaValue'];
    getHTML: CommandAdapt['getHTML'];
    getText: CommandAdapt['getText'];
    getWordCount: CommandAdapt['getWordCount'];
    getCursorPosition: CommandAdapt['getCursorPosition'];
    getRange: CommandAdapt['getRange'];
    getRangeText: CommandAdapt['getRangeText'];
    getRangeContext: CommandAdapt['getRangeContext'];
    getRangeRow: CommandAdapt['getRangeRow'];
    getRangeParagraph: CommandAdapt['getRangeParagraph'];
    getKeywordRangeList: CommandAdapt['getKeywordRangeList'];
    getKeywordContext: CommandAdapt['getKeywordContext'];
    getPaperMargin: CommandAdapt['getPaperMargin'];
    getSearchNavigateInfo: CommandAdapt['getSearchNavigateInfo'];
    getLocale: CommandAdapt['getLocale'];
    getGroupIds: CommandAdapt['getGroupIds'];
    getControlValue: CommandAdapt['getControlValue'];
    getControlList: CommandAdapt['getControlList'];
    getContainer: CommandAdapt['getContainer'];
    getTitleValue: CommandAdapt['getTitleValue'];
    getPositionContextByEvent: CommandAdapt['getPositionContextByEvent'];
    getElementById: CommandAdapt['getElementById'];
    constructor(adapt: CommandAdapt);
}

declare enum KeyMap {
    Delete = "Delete",
    Backspace = "Backspace",
    Enter = "Enter",
    Left = "ArrowLeft",
    Right = "ArrowRight",
    Up = "ArrowUp",
    Down = "ArrowDown",
    ESC = "Escape",
    TAB = "Tab",
    META = "Meta",
    LEFT_BRACKET = "[",
    RIGHT_BRACKET = "]",
    COMMA = ",",
    PERIOD = ".",
    LEFT_ANGLE_BRACKET = "<",
    RIGHT_ANGLE_BRACKET = ">",
    EQUAL = "=",
    MINUS = "-",
    PLUS = "+",
    A = "a",
    B = "b",
    C = "c",
    D = "d",
    E = "e",
    F = "f",
    G = "g",
    H = "h",
    I = "i",
    J = "j",
    K = "k",
    L = "l",
    M = "m",
    N = "n",
    O = "o",
    P = "p",
    Q = "q",
    R = "r",
    S = "s",
    T = "t",
    U = "u",
    V = "v",
    W = "w",
    X = "x",
    Y = "y",
    Z = "z",
    A_UPPERCASE = "A",
    B_UPPERCASE = "B",
    C_UPPERCASE = "C",
    D_UPPERCASE = "D",
    E_UPPERCASE = "E",
    F_UPPERCASE = "F",
    G_UPPERCASE = "G",
    H_UPPERCASE = "H",
    I_UPPERCASE = "I",
    J_UPPERCASE = "J",
    K_UPPERCASE = "K",
    L_UPPERCASE = "L",
    M_UPPERCASE = "M",
    N_UPPERCASE = "N",
    O_UPPERCASE = "O",
    P_UPPERCASE = "P",
    Q_UPPERCASE = "Q",
    R_UPPERCASE = "R",
    S_UPPERCASE = "S",
    T_UPPERCASE = "T",
    U_UPPERCASE = "U",
    V_UPPERCASE = "V",
    W_UPPERCASE = "W",
    X_UPPERCASE = "X",
    Y_UPPERCASE = "Y",
    Z_UPPERCASE = "Z",
    ZERO = "0",
    ONE = "1",
    TWO = "2",
    THREE = "3",
    FOUR = "4",
    FIVE = "5",
    SIX = "6",
    SEVEN = "7",
    EIGHT = "8",
    NINE = "9"
}

interface IRegisterShortcut {
    key: KeyMap;
    ctrl?: boolean;
    meta?: boolean;
    mod?: boolean;
    shift?: boolean;
    alt?: boolean;
    isGlobal?: boolean;
    callback?: (command: Command) => void;
    disable?: boolean;
}

declare class ContextMenu {
    private options;
    private draw;
    private command;
    private range;
    private position;
    private i18n;
    private container;
    private contextMenuList;
    private contextMenuContainerList;
    private contextMenuRelationShip;
    private context;
    constructor(draw: Draw, command: Command);
    getContextMenuList(): IRegisterContextMenu[];
    private _addEvent;
    removeEvent(): void;
    private _filterMenuList;
    private _proxyContextMenuEvent;
    private _handleSideEffect;
    private _getContext;
    private _createContextMenuContainer;
    private _render;
    private _removeSubMenu;
    private _setHoverStatus;
    private _formatName;
    registerContextMenuList(payload: IRegisterContextMenu[]): void;
    dispose(): void;
}

declare class Shortcut {
    private command;
    private globalShortcutList;
    private agentShortcutList;
    constructor(draw: Draw, command: Command);
    private _addEvent;
    removeEvent(): void;
    private _addShortcutList;
    registerShortcutList(payload: IRegisterShortcut[]): void;
    private _globalKeydown;
    private _agentKeydown;
    private _execute;
}

interface IRegisterPayload {
    contextMenu: ContextMenu;
    shortcut: Shortcut;
    i18n: I18n;
}
declare class Register {
    contextMenuList: (payload: IRegisterContextMenu[]) => void;
    getContextMenuList: () => IRegisterContextMenu[];
    shortcutList: (payload: IRegisterShortcut[]) => void;
    langMap: (locale: string, lang: DeepPartial<ILang>) => void;
    constructor(payload: IRegisterPayload);
}

declare const EDITOR_COMPONENT = "editor-component";
declare const EDITOR_CLIPBOARD = "ce-clipboard";

type PluginFunction<Options> = (editor: Editor, options?: Options) => void;
type UsePlugin = <Options>(pluginFunction: PluginFunction<Options>, options?: Options) => void;

declare const LETTER_CLASS: {
    ENGLISH: string;
    SPANISH: string;
    FRENCH: string;
    GERMAN: string;
    RUSSIAN: string;
    PORTUGUESE: string;
    ITALIAN: string;
    DUTCH: string;
    SWEDISH: string;
    GREEK: string;
};

declare const INTERNAL_CONTEXT_MENU_KEY: {
    GLOBAL: {
        CUT: string;
        COPY: string;
        PASTE: string;
        SELECT_ALL: string;
        PRINT: string;
    };
    CONTROL: {
        DELETE: string;
    };
    HYPERLINK: {
        DELETE: string;
        CANCEL: string;
        EDIT: string;
    };
    IMAGE: {
        CHANGE: string;
        SAVE_AS: string;
        TEXT_WRAP: string;
        TEXT_WRAP_EMBED: string;
        TEXT_WRAP_UP_DOWN: string;
        TEXT_WRAP_SURROUND: string;
        TEXT_WRAP_FLOAT_TOP: string;
        TEXT_WRAP_FLOAT_BOTTOM: string;
    };
    TABLE: {
        BORDER: string;
        BORDER_ALL: string;
        BORDER_EMPTY: string;
        BORDER_DASH: string;
        BORDER_EXTERNAL: string;
        BORDER_INTERNAL: string;
        BORDER_TD: string;
        BORDER_TD_TOP: string;
        BORDER_TD_RIGHT: string;
        BORDER_TD_BOTTOM: string;
        BORDER_TD_LEFT: string;
        BORDER_TD_FORWARD: string;
        BORDER_TD_BACK: string;
        VERTICAL_ALIGN: string;
        VERTICAL_ALIGN_TOP: string;
        VERTICAL_ALIGN_MIDDLE: string;
        VERTICAL_ALIGN_BOTTOM: string;
        INSERT_ROW_COL: string;
        INSERT_TOP_ROW: string;
        INSERT_BOTTOM_ROW: string;
        INSERT_LEFT_COL: string;
        INSERT_RIGHT_COL: string;
        DELETE_ROW_COL: string;
        DELETE_ROW: string;
        DELETE_COL: string;
        DELETE_TABLE: string;
        MERGE_CELL: string;
        CANCEL_MERGE_CELL: string;
    };
};

declare function splitText(text: string): string[];

declare function createDomFromElementList(elementList: IElement[], options?: IEditorOption): HTMLDivElement;
interface IGetElementListByHTMLOption {
    innerWidth: number;
}
declare function getElementListByHTML(htmlText: string, options: IGetElementListByHTMLOption): IElement[];
declare function getTextFromElementList(elementList: IElement[]): string;

declare const INTERNAL_SHORTCUT_KEY: {
    PAGE_SCALE: string;
};

interface IDialogData {
    type: string;
    label?: string;
    name: string;
    value?: string;
    options?: {
        label: string;
        value: string;
    }[];
    placeholder?: string;
    width?: number;
    height?: number;
    required?: boolean;
    step?: string;
}
interface IDialogConfirm {
    name: string;
    value: string;
}
interface IDialogOptions {
    onClose?: () => void;
    onCancel?: () => void;
    onConfirm?: (payload: IDialogConfirm[]) => void;
    title: string;
    data: IDialogData[];
}
declare class Dialog {
    private options;
    private mask;
    private container;
    private inputList;
    constructor(options: IDialogOptions);
    private _render;
    private _dispose;
}

interface ISignatureResult {
    value: string;
    width: number;
    height: number;
}
interface ISignatureOptions {
    width?: number;
    height?: number;
    onClose?: () => void;
    onCancel?: () => void;
    onConfirm?: (payload: ISignatureResult | null) => void;
}
declare class Signature {
    private readonly MAX_RECORD_COUNT;
    private readonly DEFAULT_WIDTH;
    private readonly DEFAULT_HEIGHT;
    private undoStack;
    private x;
    private y;
    private isDrawing;
    private isDrawn;
    private linePoints;
    private canvasWidth;
    private canvasHeight;
    private options;
    private mask;
    private container;
    private trashContainer;
    private undoContainer;
    private canvas;
    private ctx;
    private preTimeStamp;
    private dpr;
    constructor(options: ISignatureOptions);
    private _render;
    private _bindEvent;
    private _undo;
    private _saveUndoFn;
    private _clearUndoFn;
    private _clearCanvas;
    private _startDraw;
    private _draw;
    private _stopDraw;
    private _toData;
    private registerTouchmove;
    private registerTouchstart;
    private registerTouchend;
    private registerTouchEvent;
    private _dispose;
}

declare class Editor {
    command: Command;
    version: string;
    listener: Listener;
    eventBus: EventBus<EventBusMap>;
    override: Override;
    register: Register;
    destroy: () => void;
    use: UsePlugin;
    constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
}

export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, type IBadge, type IBlock, type ICatalog, type ICatalogItem, type IContextMenuContext, type IEditorData, type IEditorOption, type IEditorResult, type IElement, type IGetElementListByHTMLOption, type ILang, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, type INavigateInfo, type IRange, type IRangeStyle, type IRegisterContextMenu, type IWatermark, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, OlPreset, PageMode, PaperDirection, RenderMode, RowFlex, Signature, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, UlPreset, VerticalAlign, WatermarkType, WordBreak, createDomFromElementList, Editor as default, getElementListByHTML, getTextFromElementList, splitText };
