update: move component related types to component-type file
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
58
src/types/components.ts
Normal file
58
src/types/components.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { CSSProperties } from 'vue'
|
||||
import { BackgroundVariant, Dimensions, ElementId, FitViewParams, Position, XYPosition } from './flow'
|
||||
import { Connection } from './connection'
|
||||
import { Node } from '~/types/node'
|
||||
|
||||
export type HandleType = 'source' | 'target'
|
||||
|
||||
export interface HandleElement extends XYPosition, Dimensions {
|
||||
id?: ElementId | null
|
||||
position: Position
|
||||
}
|
||||
|
||||
export type ValidConnectionFunc = (connection: Connection) => boolean
|
||||
|
||||
export interface BackgroundProps {
|
||||
variant?: BackgroundVariant
|
||||
gap?: number
|
||||
color?: string
|
||||
size?: number
|
||||
}
|
||||
|
||||
export interface ControlProps {
|
||||
showZoom?: boolean
|
||||
showFitView?: boolean
|
||||
showInteractive?: boolean
|
||||
fitViewParams?: FitViewParams
|
||||
}
|
||||
|
||||
export interface ControlEvents {
|
||||
(event: 'zoom-in'): void
|
||||
(event: 'zoom-out'): void
|
||||
(event: 'fit-view'): void
|
||||
(event: 'interaction-change', active: boolean): void
|
||||
}
|
||||
|
||||
export type StringFunc = (node: Node) => string
|
||||
export type ShapeRendering = 'inherit' | 'auto' | 'geometricPrecision' | 'optimizeSpeed' | 'crispEdges' | undefined
|
||||
|
||||
interface MiniMapProps {
|
||||
nodeColor?: string | StringFunc
|
||||
nodeStrokeColor?: string | StringFunc
|
||||
nodeClassName?: string | StringFunc
|
||||
nodeBorderRadius?: number
|
||||
nodeStrokeWidth?: number
|
||||
maskColor?: string
|
||||
}
|
||||
|
||||
interface MiniMapNodeProps {
|
||||
x?: number
|
||||
y?: number
|
||||
width?: number
|
||||
height?: number
|
||||
borderRadius?: number
|
||||
color?: string
|
||||
shapeRendering?: CSSProperties['shapeRendering']
|
||||
strokeColor?: string
|
||||
strokeWidth?: number
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ElementId, Position } from './flow'
|
||||
import { HandleType } from './handle'
|
||||
import { HandleType } from './components'
|
||||
|
||||
export enum ConnectionLineType {
|
||||
Bezier = 'default',
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Dimensions, ElementId, Position, XYPosition } from './flow'
|
||||
import { Connection } from './connection'
|
||||
|
||||
export type HandleType = 'source' | 'target'
|
||||
|
||||
export interface HandleElement extends XYPosition, Dimensions {
|
||||
id?: ElementId | null
|
||||
position: Position
|
||||
}
|
||||
|
||||
export type ValidConnectionFunc = (connection: Connection) => boolean
|
||||
@@ -1,7 +1,7 @@
|
||||
export * from './flow'
|
||||
export * from './connection'
|
||||
export * from './edge'
|
||||
export * from './handle'
|
||||
export * from './components'
|
||||
export * from './node'
|
||||
export * from './zoom'
|
||||
export * from './store'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, CSSProperties, DefineComponent } from 'vue'
|
||||
import { XYPosition, ElementId, Position } from './flow'
|
||||
import { HandleElement } from './handle'
|
||||
import { HandleElement } from './components'
|
||||
|
||||
interface VFInternals {
|
||||
position: XYPosition
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
Transform,
|
||||
XYPosition,
|
||||
} from './flow'
|
||||
import { HandleType } from './handle'
|
||||
import { HandleType } from './components'
|
||||
import {
|
||||
ConnectionMode,
|
||||
OnConnectEndFunc,
|
||||
|
||||
Reference in New Issue
Block a user