Adds error boundary, improves code shapes types.
This commit is contained in:
parent
69bdab520a
commit
32922b3f85
16 changed files with 518 additions and 76 deletions
|
@ -1,6 +1,6 @@
|
|||
import CodeShape from './index'
|
||||
import { uniqueId } from 'utils'
|
||||
import { ArrowShape, Decoration, ShapeStyles, ShapeType } from 'types'
|
||||
import { ArrowShape, Decoration, ShapeProps, ShapeType } from 'types'
|
||||
import { defaultStyle } from 'state/shape-styles'
|
||||
import { getShapeUtils } from 'state/shape-utils'
|
||||
import Vec from 'utils/vec'
|
||||
|
@ -10,8 +10,7 @@ import Vec from 'utils/vec'
|
|||
*/
|
||||
export default class Arrow extends CodeShape<ArrowShape> {
|
||||
constructor(
|
||||
props = {} as Partial<ArrowShape> &
|
||||
Partial<ShapeStyles> & { start?: number[]; end?: number[] }
|
||||
props = {} as ShapeProps<ArrowShape> & { start: number[]; end: number[] }
|
||||
) {
|
||||
const { start = [0, 0], end = [0, 0] } = props
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue