@dineug/erd-editor
Version:
Entity-Relationship Diagram Editor
111 lines (110 loc) • 3.83 kB
TypeScript
import { Reducer } from '@dineug/r-html';
import { EngineContext } from '../../context';
import { RootState } from '../../state';
import { LWW, ValuesType } from '../../../internal-types';
import { FocusType, MoveKey, SelectType } from './state';
export declare const ActionType: {
readonly changeHasHistory: "editor.changeHasHistory";
readonly selectAll: "editor.selectAll";
readonly unselectAll: "editor.unselectAll";
readonly select: "editor.select";
readonly changeViewport: "editor.changeViewport";
readonly clear: "editor.clear";
readonly loadJson: "editor.loadJson";
readonly initialClear: "editor.initialClear";
readonly initialLoadJson: "editor.initialLoadJson";
readonly focusTable: "editor.focusTable";
readonly focusColumn: "editor.focusColumn";
readonly focusTableEnd: "editor.focusTableEnd";
readonly focusMoveTable: "editor.focusMoveTable";
readonly editTable: "editor.editTable";
readonly editTableEnd: "editor.editTableEnd";
readonly selectAllColumn: "editor.selectAllColumn";
readonly drawStartRelationship: "editor.drawStartRelationship";
readonly drawStartAddRelationship: "editor.drawStartAddRelationship";
readonly drawEndRelationship: "editor.drawEndRelationship";
readonly drawRelationship: "editor.drawRelationship";
readonly hoverColumnMap: "editor.hoverColumnMap";
readonly hoverRelationshipMap: "editor.hoverRelationshipMap";
readonly changeOpenMap: "editor.changeOpenMap";
readonly dragstartColumn: "editor.dragstartColumn";
readonly dragendColumn: "editor.dragendColumn";
readonly sharedMouseTracker: "editor.sharedMouseTracker";
readonly validationIds: "editor.validationIds";
readonly getLWW: "editor.getLWW";
readonly mergeLWW: "editor.mergeLWW";
};
export type ActionType = ValuesType<typeof ActionType>;
export type ActionMap = {
[]: {
hasUndo: boolean;
hasRedo: boolean;
};
[]: void;
[]: void;
[]: Record<string, SelectType>;
[]: {
width: number;
height: number;
};
[]: void;
[]: {
value: string;
};
[]: void;
[]: {
value: string;
};
[]: {
tableId: string;
focusType?: FocusType;
};
[]: {
tableId: string;
columnId: string;
focusType: FocusType;
$mod: boolean;
shiftKey: boolean;
};
[]: void;
[]: {
moveKey: MoveKey;
shiftKey: boolean;
};
[]: void;
[]: void;
[]: void;
[]: {
relationshipType: number;
};
[]: {
tableId: string;
};
[]: void;
[]: {
x: number;
y: number;
};
[]: {
columnIds: string[];
};
[]: {
relationshipIds: string[];
};
[]: Record<string, boolean>;
[]: {
tableId: string;
columnIds: string[];
};
[]: void;
[]: {
x: number;
y: number;
};
[]: void;
[]: void;
[]: {
lww: LWW;
};
};
export type ReducerType<T extends keyof ActionMap> = Reducer<RootState, T, ActionMap, EngineContext>;