import type { EPostMessageType, EToolsKey, EventMessageType } from "../core/enum"; import type { ShapeOptions } from "../core/tools"; import type { IUpdateNodeOpt, IworkId } from "../core/types"; import type { _ObjectTrue, EmitEventType } from "../plugin/types"; export declare type DiffOneView = { oldValue?: ISerializableStorageViewData; newValue?: ISerializableStorageViewData; }; export declare type DiffOneScenePath = { oldValue?: ISerializableStorageScenePathData; newValue?: ISerializableStorageScenePathData; viewId: string; }; export declare type DiffOneData = { oldValue: ISerializableStorageData; newValue: ISerializableStorageData; viewId: string; scenePath: string; }; export declare type DiffView = { [K in keyof ISerializableStorageViewData]?: DiffOneView; }; export declare type DiffScenePath = { [K in keyof ISerializableStorageScenePathData]?: DiffOneScenePath; }; export declare type DiffData = { [K in keyof ISerializableStorageData]?: DiffOneData; }; export declare type Diff = { diffData?: DiffData; diffScenePath?: DiffScenePath; diffView?: DiffView; }; export type IStorageValueItem = Partial; export interface INormalPushMsg { workId?: IworkId; toolsType?: EToolsKey; opt?: ShapeOptions; uid?: string; taskId?: number; namespace?: string; op?: number[]; ops?: string; index?: number; w?: number; h?: number; type?: EPostMessageType; removeIds?: Array; updateNodeOpt?: IUpdateNodeOpt; selectIds?: Array; emitEventType?: EmitEventType; /** 是否垂直同步 */ isSync?: boolean; viewId?: string; scenePath?: string; isActive?: string; needUndoTicker?: number; } export interface INormalStorageData { [key: string]: IStorageValueItem | undefined; } export type BaseCollectorReducerAction = INormalPushMsg & Pick; export interface ISerializableStorageData { [key: string]: BaseCollectorReducerAction | undefined; } export type PageId = string; export type ViewId = string; export type WorkId = string; export type ScenePath = string; export type Uid = string | "localSelf"; export type UndoStackId = number; export type ISerializableUndoStackId = `${UndoStackId}-${Uid}`; export declare enum EUndoDataType { Draw = 1, Delete = 2, Update = 3 } export interface ISerializableUndoDataType { dataType: EUndoDataType; data: BaseCollectorReducerAction | [BaseCollectorReducerAction, BaseCollectorReducerAction]; } export declare type DiffGlobalUndoRedoStack = { [K in keyof ISerializableUndoRedoStackViewData]?: DiffViewGlobalUndoRedoData; }; export declare type DiffViewGlobalUndoRedoData = { oldValue?: ISerializableUndoRedoStackData; newValue?: ISerializableUndoRedoStackData; }; export type ISerializableUndoStackItemDataType = { [key: WorkId]: ISerializableUndoDataType; }; export type ISerializableUndoStackItemData = { data: ISerializableUndoStackItemDataType; scenePath: string; }; export type ISerializableUndoStackType = { [key: ISerializableUndoStackId]: ISerializableUndoStackItemData; }; export type ISerializableUndoRedoStackData = { undoStack: ISerializableUndoStackType; redoStack: ISerializableUndoStackType; }; export type ISerializableUndoRedoStackViewData = { [key: ViewId]: ISerializableUndoRedoStackData; }; export interface BaseEventCollectorReducerAction { type?: EventMessageType; uid?: string; memberId?: number; op?: Array; isHide?: boolean; isSync?: boolean; viewId?: ViewId; } export interface ISerializableEventData { [key: WorkId]: Array | undefined; } export interface ISerializableStorageViewData { [key: ViewId]: ISerializableStorageScenePathData; } export interface ISerializableStorageScenePathData { [key: ScenePath]: ISerializableStorageData; } export type ISerializableAuthRenderItemType = { /** 可读用户组, 如果是true, 则为所有用户笔记可渲染 */ render?: _ObjectTrue; /** 可隐藏用户组 如果是true, 则为所有用户笔记可隐藏 */ hide?: _ObjectTrue; /** 可移除笔记用户组 如果是true, 则为所有用户笔记可移除 */ clear?: _ObjectTrue; }; export type ISerializableAuthRenderDataType = { [key: ViewId]: ISerializableAuthRenderItemType; }; export type ISerializableAuthData = { /** viewid区分,用户显示笔记权限 */ renderAuth?: ISerializableAuthRenderDataType; /** viewid区分,用户显示笔记权限 */ pageAuth?: ISerializableStorageRenderViewsData; }; export type ISerializableAuthRenderItemTypeKey = keyof ISerializableAuthRenderItemType; export declare type DiffAuthRender = { [K in keyof ISerializableAuthRenderDataType]?: DiffOneRender; }; export declare type DiffOneRender = { oldValue?: ISerializableAuthRenderItemType; newValue?: ISerializableAuthRenderItemType; }; export type ISerializableStorageRenderViewsData = { [key: ViewId]: ISerializableStorageRenderScenesData; }; export type ISerializableStorageRenderScenesData = { [key: ScenePath]: ISerializableStorageRenderPagesData; }; export type ISerializableStorageRenderPagesData = { render: Uid; pages: ISerializableStorageRenderElementIdsData; }; export type ISerializableStorageRenderElementIdsData = { [key: PageId]: ISerializableStorageRenderElementIdData; }; export type ISerializableStorageRenderElementIdData = { [key: WorkId]: true; }; export declare type DiffAuthPage = { [K in keyof ISerializableStorageRenderViewsData]?: DiffOnePage; }; export declare type DiffOnePage = { oldValue?: ISerializableStorageRenderScenesData; newValue?: ISerializableStorageRenderScenesData; };