Fix typing

This commit is contained in:
Steve Ruiz 2021-06-06 12:05:51 +01:00
parent 704e92faa4
commit c52c8f4c76

View file

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