UNPKG

@gorpacrate/core-graphics

Version:

A core library for creating shape-based graphic editors

34 lines (33 loc) 2.31 kB
import { IGraphicalContextData } from '../declarations'; import { HistoryEventType } from '../history/history-event'; export declare type ICompressedPointsArray = number[]; export interface ICompressedShapeData { 0: string; 1: string; 2: ICompressedPointsArray; 3: any; 4: IGraphicalContextData; } export interface ICompressedPersistedHistoryEvent { 0: string; 1: string; 2: boolean; 3: ICompressedHistoryEvent; } export declare type ICompressedHistoryEvent = ICompressedIdentityEvent | ICompressedShapeAddEvent | ICompressedShapeUpdateEvent | ICompressedShapeChangeOrderEvent | ICompressedShapeRemoveEvent | ICompressedEraseAllEvent | ICompressedHistoryEventsGroup; export declare type ICompressedIdentityEvent = [HistoryEventType.Identity]; export declare type ICompressedShapeAddEvent = [HistoryEventType.AddShape, ICompressedShapeData]; export declare type ICompressedShapeUpdateEvent = [HistoryEventType.UpdateShape, string, ICompressedShapeData]; export declare type ICompressedShapeChangeOrderEvent = [HistoryEventType.ChangeShapeOrder, string, number, boolean]; export declare type ICompressedShapeRemoveEvent = [HistoryEventType.RemoveShape, string]; export declare type ICompressedEraseAllEvent = [HistoryEventType.EraseAll]; export interface ICompressedHistoryEvents extends Array<ICompressedHistoryEvent> { } export declare type ICompressedHistoryEventsGroup = [HistoryEventType.Grouped, ICompressedHistoryEvents]; export declare function isCompressedIdentityEvent(base: ICompressedHistoryEvent): base is ICompressedIdentityEvent; export declare function isCompressedShapeAddEvent(base: ICompressedHistoryEvent): base is ICompressedShapeAddEvent; export declare function isCompressedShapeUpdateEvent(base: ICompressedHistoryEvent): base is ICompressedShapeUpdateEvent; export declare function isCompressedShapeRemoveEvent(base: ICompressedHistoryEvent): base is ICompressedShapeRemoveEvent; export declare function isCompressedShapeChangeOrderEvent(base: ICompressedHistoryEvent): base is ICompressedShapeChangeOrderEvent; export declare function isCompressedEraseAllEvent(base: ICompressedHistoryEvent): base is ICompressedEraseAllEvent; export declare function isCompressedHistoryEventsGroup(base: ICompressedHistoryEvent): base is ICompressedHistoryEventsGroup;