
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
17 lines
430 B
TypeScript
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!`)
|
|
}
|
|
}
|