From b4c5dc5d2f306f22e4baf6569fb4f74798509f03 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 29 Dec 2022 09:09:17 +0100 Subject: [PATCH] refactor(core,store): correct default edge types object interface Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- packages/core/src/types/components.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/core/src/types/components.ts b/packages/core/src/types/components.ts index 36fc6483..b952ce2e 100644 --- a/packages/core/src/types/components.ts +++ b/packages/core/src/types/components.ts @@ -1,6 +1,8 @@ import type { CSSProperties, Component, DefineComponent, SVGAttributes, VNode } from 'vue' import type { NodeProps } from './node' import type { EdgeProps } from './edge' +import type BezierEdge from '~/components/Edges/BezierEdge' +import type { SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge } from '~/components' /** Global component names are components registered to the vue instance and are "autoloaded" by their string name */ type GlobalComponentName = string @@ -15,7 +17,14 @@ export type EdgeTypesObject = { [key in keyof DefaultEdgeTypes]?: EdgeComponent /** Edge Components can either be a component definition or a string name */ export type EdgeComponent = Component | DefineComponent | GlobalComponentName -export type DefaultEdgeTypes = { [key in 'default' | 'straight' | 'smoothstep' | 'step' | 'simplebezier']: EdgeComponent } +export interface DefaultEdgeTypes { + default: typeof BezierEdge + straight: typeof StraightEdge + simplebezier: typeof SimpleBezierEdge + step: typeof StepEdge + smoothstep: typeof SmoothStepEdge +} + export type DefaultNodeTypes = { [key in 'input' | 'output' | 'default']: NodeComponent } /** these props are passed to edge texts */