tldraw/apps/examples/src/8-error-boundary/ErrorShapeUtil.ts
Steve Ruiz 0f89309604
Renaming types, shape utils, tools (#1513)
This PR renames all exported types to include the `TL` prefix. It also
removes the `TL` prefix from things that are not types, including:
- shape utils (e.g. `TLArrowUtil` becomes `ArrowShapeUtil`)
- tools (e.g. `TLArrowTool` becomes `ArrowShapeTool`, `TLSelectTool`
becomes `SelectTool`)

### Change Type

- [x] `major` — Breaking Change

### Release Notes

- Renaming of types, shape utils, tools
2023-06-04 10:38:53 +00:00

17 lines
430 B
TypeScript

import { BaseBoxShapeUtil } from '@tldraw/tldraw'
import { ErrorShape } from './ErrorShape'
export class ErrorShapeUtil extends BaseBoxShapeUtil<ErrorShape> {
static override type = 'error'
override type = 'error' as const
defaultProps() {
return { message: 'Error!', w: 100, h: 100 }
}
render(shape: ErrorShape) {
throw new Error(shape.props.message)
}
indicator() {
throw new Error(`Error shape indicator!`)
}
}