mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-28 05:59:42 -08:00
fix types
This commit is contained in:
parent
198f9c02c3
commit
09c7dccc65
|
@ -42,7 +42,16 @@ declare module 'jsplumb' {
|
||||||
targetNodeName: string,
|
targetNodeName: string,
|
||||||
targetOutputIndex: number,
|
targetOutputIndex: number,
|
||||||
};
|
};
|
||||||
connector?: any;
|
connector?: {
|
||||||
|
setTargetPos: (pos: XYPosition) => void;
|
||||||
|
resetTargetPos: () => void;
|
||||||
|
bounds: {
|
||||||
|
minX: number;
|
||||||
|
maxX: number;
|
||||||
|
minY: number;
|
||||||
|
maxY: number;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// bind(event: string, (connection: Connection): void;): void; // tslint:disable-line:no-any
|
// bind(event: string, (connection: Connection): void;): void; // tslint:disable-line:no-any
|
||||||
bind(event: string, callback: Function): void;
|
bind(event: string, callback: Function): void;
|
||||||
|
|
|
@ -241,7 +241,9 @@ export const showOrHideMidpointArrow = (connection: Connection) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getConnectorLengths = (connection: Connection): [number, number] => {
|
export const getConnectorLengths = (connection: Connection): [number, number] => {
|
||||||
// @ts-ignore
|
if (!connection.connector) {
|
||||||
|
return [0, 0];
|
||||||
|
}
|
||||||
const bounds = connection.connector.bounds;
|
const bounds = connection.connector.bounds;
|
||||||
const diffX = Math.abs(bounds.maxX - bounds.minX);
|
const diffX = Math.abs(bounds.maxX - bounds.minX);
|
||||||
const diffY = Math.abs(bounds.maxY - bounds.minY);
|
const diffY = Math.abs(bounds.maxY - bounds.minY);
|
||||||
|
|
Loading…
Reference in a new issue