UNPKG

@dineug/erd-editor

Version:

Entity-Relationship Diagram Editor

32 lines (31 loc) 988 B
import { Reducer } from '@dineug/r-html'; import { EngineContext } from '../../context'; import { RootState } from '../../state'; import { ValuesType } from '../../../internal-types'; export declare const ActionType: { readonly addRelationship: "relationship.add"; readonly removeRelationship: "relationship.remove"; readonly changeRelationshipType: "relationship.changeType"; }; export type ActionType = ValuesType<typeof ActionType>; export type ActionMap = { [ActionType.addRelationship]: { id: string; relationshipType: number; start: RelationshipPoint; end: RelationshipPoint; }; [ActionType.removeRelationship]: { id: string; }; [ActionType.changeRelationshipType]: { id: string; value: number; }; }; export type ReducerType<T extends keyof ActionMap> = Reducer<RootState, T, ActionMap, EngineContext>; type RelationshipPoint = { tableId: string; columnIds: string[]; }; export {};