From f7ee479fa34fc1746f22978763e2a4409e3719d2 Mon Sep 17 00:00:00 2001 From: Dmitrii Polovnev Date: Thu, 12 Sep 2024 03:21:46 +0300 Subject: [PATCH] =?UTF-8?q?#5497=20=E2=80=93=20Refactor=20(Connection.ts):?= =?UTF-8?q?=20Specify=20the=20types=20(amend)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/domain/entities/canvas-matrix/Connection.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ketcher-core/src/domain/entities/canvas-matrix/Connection.ts b/packages/ketcher-core/src/domain/entities/canvas-matrix/Connection.ts index 0562558e61..fe7d91656e 100644 --- a/packages/ketcher-core/src/domain/entities/canvas-matrix/Connection.ts +++ b/packages/ketcher-core/src/domain/entities/canvas-matrix/Connection.ts @@ -1,10 +1,13 @@ import { PolymerBond } from 'domain/entities/PolymerBond'; import { SubChainNode } from 'domain/entities'; +type DirectionInDegrees = 0 | 90 | 180 | 270; +type DirectionOfLastCell = { readonly x: number; readonly y: number }; + export class Connection { constructor( public readonly connectedNode: SubChainNode | null, - public readonly direction: 0 | 90 | 180 | 270 | { x: number; y: number }, + public readonly direction: DirectionInDegrees | DirectionOfLastCell, public readonly isVertical: boolean, public readonly polymerBond: PolymerBond, public xOffset: number,