Skip to content

🎥 Make videos programmatically with React

ts magic

Jonny Burger5e42823f83b1
diff --git a/packages/shapes/src/utils/make-circle.ts b/packages/shapes/src/utils/make-circle.ts
index 71e88aea45..c604af97dc 100644
--- a/packages/shapes/src/utils/make-circle.ts
+++ b/packages/shapes/src/utils/make-circle.ts
@@ -1,12 +1,12 @@
import type {ShapeInfo} from './shape-info';
-const circleParams = {
+const radiusParam = {
name: 'radius' as const,
description: 'The radius of the circle',
exampleValue: 10 as number,
};
-const options = [circleParams] as const;
+const options = [radiusParam] as const;
type Values = typeof options[number];
export type MakeCircleProps = {[key in Values['name']]: Values['exampleValue']};
diff --git a/packages/shapes/src/utils/make-ellipse.ts b/packages/shapes/src/utils/make-ellipse.ts
index 494ad43797..0506e4a128 100644
--- a/packages/shapes/src/utils/make-ellipse.ts
+++ b/packages/shapes/src/utils/make-ellipse.ts
@@ -1,8 +1,23 @@
import type {ShapeInfo} from './shape-info';
+const rxParam = {
+ name: 'rx' as const,
+ description: 'The x-radius of the ellipse',
+ exampleValue: 10 as number,
+};
+
+const ryParam = {
+ name: 'ry' as const,
+ description: 'The y-radius of the ellipse',
+ exampleValue: 10 as number,
+};
+
+const options = [rxParam, ryParam] as const;
+
+type Values = typeof options[number];
+
export type MakeEllipseOptions = {
- rx: number;
- ry: number;
+ [key in Values['name']]: Values['exampleValue'];
};
export const makeEllipse = ({rx, ry}: MakeEllipseOptions): ShapeInfo => {