From 0c4d53ccc93a8f674461fa5f0e1e1cb8a63f8c22 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Wed, 12 Jul 2023 17:50:52 +0800 Subject: [PATCH] types: update IPainterOption interface --- src/editor/core/command/CommandAdapt.ts | 4 ++-- src/editor/core/draw/Draw.ts | 8 ++++---- src/editor/interface/Draw.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/editor/core/command/CommandAdapt.ts b/src/editor/core/command/CommandAdapt.ts index eb258b4..4c63fc7 100644 --- a/src/editor/core/command/CommandAdapt.ts +++ b/src/editor/core/command/CommandAdapt.ts @@ -12,7 +12,7 @@ import { TableBorder } from '../../dataset/enum/table/Table' import { TitleLevel } from '../../dataset/enum/Title' import { VerticalAlign } from '../../dataset/enum/VerticalAlign' import { ICatalog } from '../../interface/Catalog' -import { IAppendElementListOption, IDrawImagePayload, IGetValueOption, IPainterOptions } from '../../interface/Draw' +import { IAppendElementListOption, IDrawImagePayload, IGetValueOption, IPainterOption } from '../../interface/Draw' import { IEditorData, IEditorOption, IEditorResult } from '../../interface/Editor' import { IElement, IElementStyle } from '../../interface/Element' import { IMargin } from '../../interface/Margin' @@ -142,7 +142,7 @@ export class CommandAdapt { this.historyManager.redo() } - public painter(options: IPainterOptions) { + public painter(options: IPainterOption) { const isReadonly = this.draw.isReadonly() if (isReadonly) return const selection = this.range.getSelection() diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 8c3a664..8e75b43 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -1,7 +1,7 @@ import { version } from '../../../../package.json' import { ZERO } from '../../dataset/constant/Common' import { RowFlex } from '../../dataset/enum/Row' -import { IAppendElementListOption, IDrawOption, IDrawPagePayload, IDrawRowPayload, IGetValueOption, IPainterOptions } from '../../interface/Draw' +import { IAppendElementListOption, IDrawOption, IDrawPagePayload, IDrawRowPayload, IGetValueOption, IPainterOption } from '../../interface/Draw' import { IEditorData, IEditorOption, IEditorResult } from '../../interface/Editor' import { IElement, IElementMetrics, IElementFillRect, IElementStyle } from '../../interface/Element' import { IRow, IRowElement } from '../../interface/Row' @@ -113,7 +113,7 @@ export class Draw { private rowList: IRow[] private pageRowList: IRow[][] private painterStyle: IElementStyle | null - private painterOptions: IPainterOptions | null + private painterOptions: IPainterOption | null private visiblePageNoList: number[] private intersectionPageNo: number private lazyRenderIntersectionObserver: IntersectionObserver | null @@ -599,11 +599,11 @@ export class Draw { return this.painterStyle && Object.keys(this.painterStyle).length ? this.painterStyle : null } - public getPainterOptions(): IPainterOptions | null { + public getPainterOptions(): IPainterOption | null { return this.painterOptions } - public setPainterStyle(payload: IElementStyle | null, options?: IPainterOptions) { + public setPainterStyle(payload: IElementStyle | null, options?: IPainterOption) { this.painterStyle = payload this.painterOptions = options || null if (this.getPainterStyle()) { diff --git a/src/editor/interface/Draw.ts b/src/editor/interface/Draw.ts index 42eb4f7..8a40eb2 100644 --- a/src/editor/interface/Draw.ts +++ b/src/editor/interface/Draw.ts @@ -33,7 +33,7 @@ export interface IDrawPagePayload { pageNo: number; } -export interface IPainterOptions { +export interface IPainterOption { isDblclick: boolean; }