Ver código fonte

Fix typing

main
Steve Ruiz 4 anos atrás
pai
commit
c52c8f4c76
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3
    3
      lib/code/index.ts

+ 3
- 3
lib/code/index.ts Ver arquivo

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

Carregando…
Cancelar
Salvar