UNPKG

@gorpacrate/core-graphics

Version:

A core library for creating shape-based graphic editors

33 lines (32 loc) 1.38 kB
import { IHistoryEvent, IPersistedHistoryEvent } from '../history/history-event'; export declare type EditorAction = IPushHistoryEventAction | IUpdateHistoryEventAction | IDeleteHistoryEventAction; export interface IEditorAction { type: EditorActionType; } export declare enum EditorActionType { PushHistoryEvent = 0, UpdateHistoryEvent = 1, DeleteHistoryEvent = 2 } export interface IPushHistoryEventAction extends IEditorAction { payload: { ev: IHistoryEvent; }; } export interface IUpdateHistoryEventAction extends IEditorAction { payload: { id: string; ev: IPersistedHistoryEvent; }; } export interface IDeleteHistoryEventAction extends IEditorAction { payload: { id: string; }; } export declare function isPushHistoryEventAction(base: IEditorAction): base is IPushHistoryEventAction; export declare function isUpdateHistoryEventAction(base: IEditorAction): base is IUpdateHistoryEventAction; export declare function isDeleteHistoryEventAction(base: IEditorAction): base is IDeleteHistoryEventAction; export declare function pushHistoryEventAction(ev: IHistoryEvent): IPushHistoryEventAction; export declare function updateHistoryEventAction(id: string, ev: IPersistedHistoryEvent): IUpdateHistoryEventAction; export declare function deleteHistoryEventAction(id: string): IDeleteHistoryEventAction;