@eventcatalog/visualizer
Version:
ReactFlow nodes and visualizer components for EventCatalog Visualizer and Studio
204 lines (186 loc) • 5.77 kB
text/typescript
import { Connection, MarkerType, Node } from '@xyflow/react';
import * as react_jsx_runtime from 'react/jsx-runtime';
type NodeConfiguration = {
type: string;
icon: React.ComponentType;
color: string;
targetCanConnectTo?: string[];
sourceCanConnectTo?: string[];
validateConnection?: (connection: Connection) => boolean;
getEdgeOptions?: (connection: Connection) => {
label: string;
markerEnd: {
type: MarkerType;
color: string;
};
};
defaultData?: any;
editor?: {
title: string;
subtitle: string;
schema: any;
};
};
type RegisteredNode = {
type: string;
category: string;
component: React.ComponentType<any>;
configuration: NodeConfiguration;
};
type NodeCategory = {
type: string;
label: string;
icon: React.ComponentType;
};
type EventCatalogResource = {
mode: 'simple' | 'full';
collection?: string;
filePath?: string;
id?: string;
};
type Message = {
name: string;
version: string;
summary: string;
owners?: string[];
producers?: string[];
consumers?: string[];
};
type Service$1 = {
name: string;
version: string;
summary: string;
owners?: string[];
sends?: string[];
receives?: string[];
};
type Channel$1 = {
name: string;
version: string;
summary: string;
owners?: string[];
parameters?: Record<string, string>;
protocols?: string[];
address?: string;
};
type ExternalSystem$1 = {
name: string;
version: string;
summary: string;
};
type Data$1 = {
name: string;
version: string;
summary: string;
owners?: string[];
type?: string;
schemas?: string[];
};
type View$1 = {
name: string;
version: string;
summary: string;
owners?: string[];
screenshot?: string;
};
type MessageNodeData = EventCatalogResource & {
message: Message;
};
type EventNode = Node<MessageNodeData, 'event'>;
declare function Event(props: EventNode): react_jsx_runtime.JSX.Element;
declare const _default$3: NodeConfiguration;
type CommandNodeData = EventCatalogResource & {
message: Message;
};
type CommandNode = Node<CommandNodeData, 'command'>;
declare function Command(props: CommandNode): react_jsx_runtime.JSX.Element;
type QueryNodeData = EventCatalogResource & {
message: Message;
};
type QueryNode = Node<QueryNodeData, 'query'>;
declare function Query(props: QueryNode): react_jsx_runtime.JSX.Element;
type ServiceNodeData = EventCatalogResource & {
service: Service$1;
};
type ServiceNode = Node<ServiceNodeData, 'service'>;
declare function Service(props: ServiceNode): react_jsx_runtime.JSX.Element;
type ChannelNodeData = EventCatalogResource & {
channel: Channel$1;
};
type ChannelNode = Node<ChannelNodeData, 'channel'>;
declare function Channel(props: ChannelNode): react_jsx_runtime.JSX.Element;
type NoteNodeData = {
id: string;
text: string;
color?: string;
readOnly?: boolean;
};
type NoteNode = Node<NoteNodeData, 'note'>;
interface NoteNodeProps extends NoteNode {
onTextChange?: (id: string, text: string) => void;
onColorChange?: (id: string, color: string) => void;
showResizer?: boolean;
readOnly?: boolean;
}
declare function NoteNodeComponent({ id, data, selected, onTextChange, onColorChange, readOnly, }: NoteNodeProps): react_jsx_runtime.JSX.Element;
type DataNodeData = EventCatalogResource & {
data: Data$1;
};
type DataNode = Node<DataNodeData, 'data'>;
declare function Data(props: DataNode): react_jsx_runtime.JSX.Element;
declare const _default$2: NodeConfiguration;
type ViewNodeData = EventCatalogResource & {
view: View$1;
};
type ViewNode = Node<ViewNodeData, 'view'>;
declare function View(props: ViewNode): react_jsx_runtime.JSX.Element;
type ActorNodeData = EventCatalogResource & {
name: string;
summary: string;
};
type ActorNode = Node<ActorNodeData, 'actor'>;
declare function Actor(props: ActorNode): react_jsx_runtime.JSX.Element;
declare const _default$1: NodeConfiguration;
type ExternalSystemNodeData = EventCatalogResource & {
externalSystem: ExternalSystem$1;
};
type ExternalSystemNode = Node<ExternalSystemNodeData, 'external-system'>;
declare function ExternalSystem(props: ExternalSystemNode): react_jsx_runtime.JSX.Element;
declare const _default: NodeConfiguration;
declare const nodes: {
event: {
component: typeof Event;
config: NodeConfiguration;
};
data: {
component: typeof Data;
config: NodeConfiguration;
};
actor: {
component: typeof Actor;
config: NodeConfiguration;
};
externalSystem: {
component: typeof ExternalSystem;
config: NodeConfiguration;
};
};
declare const nodeConfigs: {
event: NodeConfiguration;
data: NodeConfiguration;
actor: NodeConfiguration;
externalSystem: NodeConfiguration;
};
declare const nodeComponents: {
event: typeof Event;
command: typeof Command;
query: typeof Query;
service: typeof Service;
channel: typeof Channel;
note: typeof NoteNodeComponent;
externalSystem: typeof ExternalSystem;
data: typeof Data;
view: typeof View;
actor: typeof Actor;
};
export { Actor, type ActorNode, Channel, type ChannelNode, Command, type CommandNode, Data, type DataNode, Event, type EventNode, ExternalSystem, type ExternalSystemNode, type NodeCategory, type NodeConfiguration, NoteNodeComponent as Note, type NoteNode, Query, type QueryNode, type RegisteredNode, Service, type ServiceNode, View, type ViewNode, _default$1 as actorConfig, _default$2 as dataNodeConfig, _default$3 as eventConfig, _default as externalSystemConfig, nodeComponents, nodeConfigs, nodes };