refactor(types): use types for prop type functions

This commit is contained in:
moklick
2020-05-15 21:53:13 +02:00
parent b887568ac8
commit 1e447a204c
8 changed files with 32 additions and 36 deletions
+11 -2
View File
@@ -109,7 +109,7 @@ export interface NodeComponentProps {
targetPosition?: Position;
sourcePosition?: Position;
onClick?: (node: Node) => void | undefined;
onNodeDragStop?: () => any;
onNodeDragStop?: (node: Node) => void;
style?: CSSProperties;
}
@@ -147,13 +147,22 @@ export type Connection = {
target: ElementId | null;
};
export type OnConnectFunc = (params: Connection) => void;
export type OnConnectFunc = (connection: Connection) => void;
export interface HandleElement extends XYPosition, Dimensions {
id?: ElementId | null;
position: Position;
}
export interface HandleProps {
type: HandleType;
position: Position;
onConnect?: OnConnectFunc;
isValidConnection?: (connection: Connection) => boolean;
id?: string;
style?: CSSProperties;
}
export interface EdgeCompProps {
id: ElementId;
source: ElementId;