リファレンス

ConnectionState

GitHubのソース

ConnectionState型は、進行中の接続に関するすべての情報をまとめたものです。これは、useConnectionフックによって返されます。

type NoConnection = {
  inProgress: false;
  isValid: null;
  from: null;
  fromHandle: null;
  fromPosition: null;
  fromNode: null;
  to: null;
  toHandle: null;
  toPosition: null;
  toNode: null;
};
type ConnectionInProgress = {
  inProgress: true;
  isValid: boolean | null;
  from: XYPosition;
  fromHandle: Handle;
  fromPosition: Position;
  fromNode: NodeBase;
  to: XYPosition;
  toHandle: Handle | null;
  toPosition: Position;
  toNode: NodeBase | null;
};
 
type ConnectionState = ConnectionInProgress | NoConnection;

フィールド

#inProgress
boolean
接続が現在進行中かどうかを示します。
#isValid
boolean | null
進行中の接続がハンドル上にあるか、接続半径内にある場合は true または false になります。それ以外の場合は null になります。
#from
XYPosition | null
xy の開始位置を返します。接続が進行中でない場合は null です。
#fromHandle
Handle | null
開始ハンドルを返します。接続が進行中でない場合は null です。
#fromPosition
Position | null
開始ハンドルの側面(位置と呼ばれます)を返します。接続が進行中でない場合は null です。
#fromNode
Node | null
開始ノードを返します。接続が進行中でない場合は null です。
#to
XYPosition | null
xy の終了位置を返します。接続が進行中でない場合は null です。
#toHandle
Handle | null
終了ハンドルを返します。接続が進行中でない場合は null です。
#toPosition
Position | null
終了ハンドルの側面(位置と呼ばれます)を返します。接続が進行中でない場合は null です。
#toNode
Node | null
終了ノードを返します。接続が進行中でない場合は null です。