|
@@ -1,4 +1,4 @@
|
1
|
|
-import { Shape } from 'types'
|
|
1
|
+import { Mutable, Shape } from 'types'
|
2
|
2
|
import shapeUtilityMap, {
|
3
|
3
|
createShape,
|
4
|
4
|
getShapeUtils,
|
|
@@ -15,11 +15,11 @@ export const codeShapes = new Set<CodeShape<Shape>>([])
|
15
|
15
|
* shape map, while deleting it removes it from the collected shapes set
|
16
|
16
|
*/
|
17
|
17
|
export default class CodeShape<T extends Shape> {
|
18
|
|
- private _shape: T
|
|
18
|
+ private _shape: Mutable<T>
|
19
|
19
|
private utils: ShapeUtility<T>
|
20
|
20
|
|
21
|
21
|
constructor(props: T) {
|
22
|
|
- this._shape = createShape(props.type, props) as T
|
|
22
|
+ this._shape = createShape(props.type, props) as Mutable<T>
|
23
|
23
|
this.utils = getShapeUtils<T>(this._shape)
|
24
|
24
|
codeShapes.add(this)
|
25
|
25
|
}
|