refactor(types)!: change node and edge types to extend element

* element type provides intersection interface of nodes and edges
* rename isHidden to hidden

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent da54bc3316
commit fe0eeaeae9
6 changed files with 18 additions and 31 deletions
+9
View File
@@ -8,6 +8,15 @@ import { EdgeTypes, NodeTypes } from './components'
export type ElementId = string
export type FlowElement<DataNode = any, DataEdge = any> = GraphNode<DataNode> | GraphEdge<DataEdge>
export type FlowElements<DataNode = any, DataEdge = any> = FlowElement<DataNode, DataEdge>[]
export interface Element<Data = any> {
id: ElementId
label?: string
type?: string
data?: Data
class?: string
style?: CSSProperties
hidden?: boolean
}
export type Elements<DataNode = any, DataEdge = any> = (Node<DataNode> | Edge<DataEdge>)[]
export type NextElements = {