From d474901280a529cf4a250743b84ef5f87c287591 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:54:11 +0200 Subject: [PATCH] refactor: use constants when inserting edges (#142) Demonstrate that is possible to use "constants" in TypeScript application configured with isolatedModules set to true. This is available as of maxGraph 0.9.0. --- projects/_shared/src/generate-graph.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/_shared/src/generate-graph.ts b/projects/_shared/src/generate-graph.ts index e32c3a9..c05fec7 100644 --- a/projects/_shared/src/generate-graph.ts +++ b/projects/_shared/src/generate-graph.ts @@ -1,4 +1,5 @@ import { + constants, Graph, InternalEvent, Perimeter, @@ -55,10 +56,7 @@ export const initializeGraph = (container: HTMLElement) => { ); // use the legacy insertEdge method graph.insertEdge(parent, null, 'an orthogonal style edge', vertex01, vertex02, { - // TODO cannot use constants.EDGESTYLE.ORTHOGONAL - // TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided. - // See https://github.com/maxGraph/maxGraph/issues/205 - edgeStyle: 'orthogonalEdgeStyle', + edgeStyle: constants.EDGESTYLE.ORTHOGONAL, rounded: true, });