[docs] Fix the types in the Shapes example (#1681)

This PR fixes some incorrect types in the example on the Shapes page of
the docs.

### Change Type

- [x] `documentation` — Changes to the documentation only[^2]

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Release Notes

- Documentation: Fix some incorrect types on the Shapes page.
pull/1685/head
Lu Wilson 2023-06-30 13:46:32 +01:00 zatwierdzone przez GitHub
rodzic eb6aa9bbe4
commit f07b915716
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -41,7 +41,7 @@ While tldraw's shapes themselves are simple JSON objects, we use `ShapeUtil` cla
Let's create a `ShapeUtil` class for the shape.
```tsx
import { ShapeUtil, HTMLContainer } from '@tldraw/tldraw'
import { ShapeUtil, HTMLContainer, Box2d } from '@tldraw/tldraw'
class CardShapeUtil extends ShapeUtil<CardShape> {
static type = 'card' as const
@ -53,17 +53,17 @@ class CardShapeUtil extends ShapeUtil<CardShape> {
}
}
getBounds(shape: Shape) {
getBounds(shape: CardShape) {
return new Box2d(0, 0, shape.props.w, shape.props.h)
}
component(shape: Shape) {
component(shape: CardShape) {
return (
<HTMLContainer>Hello</HTMLContainer>
)
}
indicator(shape: Shape) {
indicator(shape: CardShape) {
return (
<rect width={shape.props.w} height={shape.props.h}/>
)