added types for handles
This commit is contained in:
@@ -23,13 +23,26 @@ export type ConnectionData = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type HandleComponentProps = {
|
export type HandleComponentProps = {
|
||||||
|
/** type of the handle
|
||||||
|
* @example HandleType.Source, HandleType.Target
|
||||||
|
*/
|
||||||
type: HandleType;
|
type: HandleType;
|
||||||
|
/** position of the handle
|
||||||
|
* @example Position.TopLeft, Position.TopRight,
|
||||||
|
* Position.BottomLeft, Position.BottomRight
|
||||||
|
*/
|
||||||
position?: Position;
|
position?: Position;
|
||||||
|
/** id of the handle
|
||||||
|
* @remarks optional if there is only one handle of this type
|
||||||
|
*/
|
||||||
id?: string;
|
id?: string;
|
||||||
class?: string;
|
class?: string;
|
||||||
style?: string;
|
style?: string;
|
||||||
|
/** should you be able to connect from/to this handle */
|
||||||
isConnectable?: boolean;
|
isConnectable?: boolean;
|
||||||
|
/** shoould you be able to connect from this handle */
|
||||||
isConnectableStart?: boolean;
|
isConnectableStart?: boolean;
|
||||||
|
/** should you be able to connect to this handle */
|
||||||
isConnectableEnd?: boolean;
|
isConnectableEnd?: boolean;
|
||||||
onconnect?: (connections: Connection[]) => void;
|
onconnect?: (connections: Connection[]) => void;
|
||||||
ondisconnect?: (connections: Connection[]) => void;
|
ondisconnect?: (connections: Connection[]) => void;
|
||||||
|
|||||||
@@ -27,12 +27,29 @@ export type ConnectionHandle = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type HandleProps = {
|
export type HandleProps = {
|
||||||
|
/** type of the handle
|
||||||
|
* @example HandleType.Source, HandleType.Target
|
||||||
|
*/
|
||||||
type: HandleType;
|
type: HandleType;
|
||||||
|
/** position of the handle
|
||||||
|
* @example Position.TopLeft, Position.TopRight,
|
||||||
|
* Position.BottomLeft, Position.BottomRight
|
||||||
|
*/
|
||||||
position: Position;
|
position: Position;
|
||||||
|
/** should you be able to connect to/from this handle */
|
||||||
isConnectable?: boolean;
|
isConnectable?: boolean;
|
||||||
|
/** shoud you be able to connect from this handle */
|
||||||
isConnectableStart?: boolean;
|
isConnectableStart?: boolean;
|
||||||
|
/** should you be able to connect to this handle */
|
||||||
isConnectableEnd?: boolean;
|
isConnectableEnd?: boolean;
|
||||||
|
/** callback called when connection is made */
|
||||||
onConnect?: OnConnect;
|
onConnect?: OnConnect;
|
||||||
|
/** callback if connection is valid
|
||||||
|
* @remarks connection becomes an edge if isValidConnection returns true
|
||||||
|
*/
|
||||||
isValidConnection?: IsValidConnection;
|
isValidConnection?: IsValidConnection;
|
||||||
|
/** id of the handle
|
||||||
|
* @remarks optional if there is only one handle of this type
|
||||||
|
*/
|
||||||
id?: string;
|
id?: string;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user