UNPKG

@dineug/erd-editor

Version:

Entity-Relationship Diagram Editor

60 lines (59 loc) 1.59 kB
import { Reducer } from '@dineug/r-html'; import { EngineContext } from '../../context'; import { RootState } from '../../state'; import { ValuesType } from '../../../internal-types'; export declare const ActionType: { readonly addMemo: "memo.add"; readonly moveMemo: "memo.move"; readonly moveToMemo: "memo.moveTo"; readonly removeMemo: "memo.remove"; readonly changeMemoValue: "memo.changeValue"; readonly changeMemoColor: "memo.changeColor"; readonly resizeMemo: "memo.resize"; readonly changeZIndex: "memo.changeZIndex"; }; export type ActionType = ValuesType<typeof ActionType>; export type ActionMap = { [ActionType.addMemo]: { id: string; ui: { x: number; y: number; zIndex: number; }; }; [ActionType.moveMemo]: { movementX: number; movementY: number; ids: string[]; }; [ActionType.moveToMemo]: { id: string; x: number; y: number; }; [ActionType.removeMemo]: { id: string; }; [ActionType.changeMemoValue]: { id: string; value: string; }; [ActionType.changeMemoColor]: { id: string; color: string; prevColor: string; }; [ActionType.resizeMemo]: { id: string; x: number; y: number; width: number; height: number; }; [ActionType.changeZIndex]: { id: string; zIndex: number; }; }; export type ReducerType<T extends keyof ActionMap> = Reducer<RootState, T, ActionMap, EngineContext>;