🎥 Make videos programmatically with React
typescript magic in circle
Jonny Burger27453be765cf
diff --git a/packages/docs/docs/shapes/make-triangle.md b/packages/docs/docs/shapes/make-triangle.mdindex 12d46efeb5..3b31e3512e 100644--- a/packages/docs/docs/shapes/make-triangle.md+++ b/packages/docs/docs/shapes/make-triangle.md@@ -38,4 +38,6 @@ Source code stems mostly from [triangle](https://stackblitz.com/edit/react-trian## See also+import {MakeShapeSeeAlso} from "../../components/shapes/shapes-info"+<MakeShapeSeeAlso shape="triangle"/>diff --git a/packages/shapes/src/utils/make-circle.ts b/packages/shapes/src/utils/make-circle.tsindex bbfb8e855c..71e88aea45 100644--- a/packages/shapes/src/utils/make-circle.ts+++ b/packages/shapes/src/utils/make-circle.ts@@ -1,9 +1,16 @@import type {ShapeInfo} from './shape-info';-export type MakeCircleProps = {- radius: number;+const circleParams = {+ name: 'radius' as const,+ description: 'The radius of the circle',+ exampleValue: 10 as number,};+const options = [circleParams] as const;++type Values = typeof options[number];+export type MakeCircleProps = {[key in Values['name']]: Values['exampleValue']};+export const makeCircle = ({radius}: MakeCircleProps): ShapeInfo => {const cx = radius;const cy = radius;diff --git a/packages/shapes/src/utils/shape-info.ts b/packages/shapes/src/utils/shape-info.tsindex 7784a5a90a..db6b0cdbbb 100644--- a/packages/shapes/src/utils/shape-info.ts+++ b/packages/shapes/src/utils/shape-info.ts@@ -3,3 +3,9 @@ export type ShapeInfo = {width: number;height: number;};++export type ShapeOption<Name, Type> = {+ name: Name;+ description: string;+ exampleValue: Type;+};