From f07b91571698cb110632f953c8f2243a837bb83a Mon Sep 17 00:00:00 2001 From: Lu Wilson Date: Fri, 30 Jun 2023 13:46:32 +0100 Subject: [PATCH] [docs] Fix the types in the Shapes example (#1681) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/docs/shapes.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/shapes.mdx b/docs/docs/shapes.mdx index 64788b0bf..fa273f5a8 100644 --- a/docs/docs/shapes.mdx +++ b/docs/docs/shapes.mdx @@ -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 { static type = 'card' as const @@ -53,17 +53,17 @@ class CardShapeUtil extends ShapeUtil { } } - getBounds(shape: Shape) { + getBounds(shape: CardShape) { return new Box2d(0, 0, shape.props.w, shape.props.h) } - component(shape: Shape) { + component(shape: CardShape) { return ( Hello ) } - indicator(shape: Shape) { + indicator(shape: CardShape) { return ( )