1- import { Layer , PathProperty } from 'expression-globals-typescript' ;
1+ import {
2+ Layer ,
3+ PathProperty ,
4+ Points ,
5+ Vector2D ,
6+ } from 'expression-globals-typescript' ;
27
38// Creating layer and property mocks
49const thisLayer = new Layer ( ) ;
@@ -7,8 +12,6 @@ const thisProperty = new PathProperty([[0, 0]]);
712// eBox types
813type Anchor = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft' | 'center' ;
914type Rounding = [ number , number , number , number ] ;
10- type Vector2D = [ number , number ] ;
11- type Points = Array < Vector2D > ;
1215
1316interface BoxProps {
1417 size : Vector2D ;
@@ -121,7 +124,7 @@ function createBox({
121124 thisLayer . add ( pBl , [ 0 , - rBl ] ) ,
122125 ] ;
123126
124- const inTangents = [
127+ const inTangents = ( [
125128 // Top left
126129 [ 0 , 0 ] ,
127130 [ - rTl , 0 ] ,
@@ -134,8 +137,9 @@ function createBox({
134137 // Bottom left
135138 [ 0 , 0 ] ,
136139 [ 0 , rBl ] ,
137- ] . map ( p => thisLayer . mul ( p , tangentMult ) ) ;
138- const outTangents = [
140+ ] as Vector2D [ ] ) . map ( p => thisLayer . mul ( p , tangentMult ) ) ;
141+
142+ const outTangents = ( [
139143 // Top left
140144 [ 0 , - rTl ] ,
141145 [ 0 , 0 ] ,
@@ -148,7 +152,7 @@ function createBox({
148152 // Bottom left
149153 [ - rBl , 0 ] ,
150154 [ 0 , 0 ] ,
151- ] . map ( p => thisLayer . mul ( p , tangentMult ) ) ;
155+ ] as Vector2D [ ] ) . map ( p => thisLayer . mul ( p , tangentMult ) ) ;
152156
153157 return thisProperty . createPath (
154158 cornerPoints ,
0 commit comments