graphic-pixi/lib/operation/JlOperation.d.ts
2023-12-14 13:07:43 +08:00

43 lines
873 B
TypeScript

import { IGraphicApp } from '../app/JlGraphicApp';
import { JlGraphic } from '../core/JlGraphic';
/**
* 操作
*/
export declare abstract class JlOperation {
type: string;
app: IGraphicApp;
obj?: any;
data?: any;
description?: string;
constructor(app: IGraphicApp, type: string);
undo1(): void;
redo1(): void;
abstract undo(): JlGraphic[] | void;
abstract redo(): JlGraphic[] | void;
}
/**
* 操作记录
*/
export declare class OperationRecord {
undoStack: JlOperation[];
redoStack: JlOperation[];
private maxLen;
constructor(maxLen?: number);
get hasUndo(): boolean;
get hasRedo(): boolean;
setMaxLen(v: number): void;
/**
* 记录
* @param op
*/
record(op: JlOperation): void;
/**
* 撤销
*/
undo(): void;
/**
* 重做
*/
redo(): void;
}