UNPKG

@reactodia/workspace

Version:

Reactodia Workspace -- library for visual interaction with graphs in a form of a diagram.

45 lines 1.68 kB
import * as React from 'react'; import type { ElementModel, LinkModel } from '../../data/model'; import { Link } from '../../diagram/elements'; import { EntityElement, RelationLink } from '../../editor/dataElements'; import type { FormInputOrDefaultResolver } from '../../forms/input/inputCommon'; import { DragEditOperation } from './dragEditLayer'; export interface VisualAuthoringProps { propertyEditor?: PropertyEditor; inputResolver?: FormInputOrDefaultResolver; inlineEntityActions?: boolean; } export type PropertyEditor = (options: PropertyEditorOptions) => React.ReactElement; export type PropertyEditorOptions = PropertyEditorOptionsEntity | PropertyEditorOptionsRelation; export interface PropertyEditorOptionsEntity { readonly type: 'entity'; readonly elementData: ElementModel; readonly onSubmit: (newData: ElementModel) => void; readonly onCancel?: () => void; } export interface PropertyEditorOptionsRelation { readonly type: 'relation'; readonly linkData: LinkModel; readonly onSubmit: (newData: LinkModel) => void; readonly onCancel?: () => void; } export interface VisualAuthoringCommands { startDragEdit: { readonly operation: DragEditOperation; }; editEntity: { readonly target: EntityElement; }; findOrCreateEntity: { readonly link: RelationLink; readonly target: EntityElement; }; editRelation: { readonly target: RelationLink; }; renameLink: { readonly target: Link; }; } export declare function VisualAuthoring(props: VisualAuthoringProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=visualAuthoring.d.ts.map