Skip to content

🎥 Make videos programmatically with React

chore: ref doc links from @remotion/path: getLength() through @remotion/shapes

kaf-lamed-beyt278ba73be56f
diff --git a/packages/google-fonts/src/base.ts b/packages/google-fonts/src/base.ts
index 4f14c2209c..99e57de7d4 100644
--- a/packages/google-fonts/src/base.ts
+++ b/packages/google-fonts/src/base.ts
@@ -11,6 +11,14 @@ export type FontInfo = {
fonts: Record<string, Record<string, Record<string, string>>>;
};
+/**
+ * @description Load a Google Font for use in Remotion.
+ * @param meta
+ * @param {string} style The font style we want to load. While each font has a different set of styles, common options are: normal, italic etc.
+ * @param {Array} options
+ * @returns An object with the following properties: fontFamily, unicodeRanges, fonts
+ * @see [Documentation](https://www.remotion.dev/docs/google-fonts/load-font)
+ */
export const loadFonts = (
meta: FontInfo,
style?: string,
diff --git a/packages/noise/src/index.ts b/packages/noise/src/index.ts
index 9a1af88b8f..bf67bfbd47 100644
--- a/packages/noise/src/index.ts
+++ b/packages/noise/src/index.ts
@@ -60,7 +60,7 @@ const generate4DNoise = (seed: string | number) => {
/**
* @description Creates 2D noise.
- * @link https://remotion.dev/docs/noise/noise-2d
+ * @see [Documentation](https://www.remotion.dev/docs/noise/noise-2d)
* @param {string | number} seed Seed value for deterministic results
* @param {number} x First dimensional value
* @param {number} y Second dimensional value
@@ -76,7 +76,7 @@ export const noise2D = (
/**
* @description Creates 3D noise.
- * @link https://remotion.dev/docs/noise/noise-3d
+ * @see [Documentation](https://remotion.dev/docs/noise/noise-3d)
* @param {string | number} seed Seed value for deterministic results
* @param {number} x First dimensional value
* @param {number} y Second dimensional value
@@ -92,7 +92,7 @@ export const noise3D = (
/**
* @description Creates 4D noise.
- * @link https://remotion.dev/docs/noise/noise-4d
+ * @see [Documentation](https://remotion.dev/docs/noise/noise-4d)
* @param {string | number} seed Seed value for deterministic results
* @param {number} x First dimensional value
* @param {number} y Second dimensional value
diff --git a/packages/paths/src/evolve-path.ts b/packages/paths/src/evolve-path.ts
index 454b846b3e..9209523c71 100644
--- a/packages/paths/src/evolve-path.ts
+++ b/packages/paths/src/evolve-path.ts
@@ -1,10 +1,10 @@
import {getLength} from './get-length';
/**
- * Animates an SVG from being invisible to it's full length.
+ * @description Animates an SVG from being invisible to it's full length.
* @param {string} path A valid SVG path
* @param {number} progress The first valid SVG path
- * @link https://remotion.dev/docs/paths/evolve-path
+ * @see [Documentation](https://remotion.dev/docs/paths/evolve-path)
*/
export const evolvePath = (progress: number, path: string) => {
const length = getLength(path);
diff --git a/packages/paths/src/extend-viewbox.ts b/packages/paths/src/extend-viewbox.ts
index 81cdc821cc..14424d9862 100644
--- a/packages/paths/src/extend-viewbox.ts
+++ b/packages/paths/src/extend-viewbox.ts
@@ -1,7 +1,7 @@
/**
- * Extends a viewbox in all directions by a scale factor.
+ * @description Extends a viewbox in all directions by a scale factor.
* @param {string} currentViewBox A valid SVG viewBox
- * @link https://remotion.dev/docs/paths/extend-viewbox
+ * @see [Documentation](https://remotion.dev/docs/paths/extend-viewbox)
*/
export const extendViewBox = (currentViewBox: string, scale: number) => {
const relativeScale = scale - 1;
diff --git a/packages/paths/src/get-bounding-box.ts b/packages/paths/src/get-bounding-box.ts
index e9be102aa4..6d258849e2 100644
--- a/packages/paths/src/get-bounding-box.ts
+++ b/packages/paths/src/get-bounding-box.ts
@@ -88,6 +88,11 @@ function minmaxC(A: [number, number, number, number]): minMax {
return [min, max];
}
+/**
+ * @description Returns the bounding box of the given path, suitable for calculating the viewBox value that you need to pass to an SVG.
+ * @param {string} d
+ * @see [Documentation](https://www.remotion.dev/docs/paths/get-bounding-box)
+ */
export const getBoundingBox = (d: string): BoundingBox => {
const parsed = parsePath(d) as AbsoluteInstruction[];
const unarced = removeATSHVInstructions(normalizeInstructions(parsed));
diff --git a/packages/paths/src/get-length.ts b/packages/paths/src/get-length.ts
index c89d9efd3f..baa1d319b9 100644
--- a/packages/paths/src/get-length.ts
+++ b/packages/paths/src/get-length.ts
@@ -3,7 +3,7 @@
import {construct} from './helpers/construct';
/**
- * Gets the length of an SVG path.
+ * @description Gets the length of an SVG path.
* @param {string} path A valid SVG path
* @see [Documentation](https://remotion.dev/docs/paths/get-length)
*/
diff --git a/packages/paths/src/get-parts.ts b/packages/paths/src/get-parts.ts
index b74d57bd7f..39d6c62df9 100644
--- a/packages/paths/src/get-parts.ts
+++ b/packages/paths/src/get-parts.ts
@@ -2,9 +2,9 @@ import {construct} from './helpers/construct';
import type {Part} from './helpers/types';
/**
- * Splits a valid SVG path into it's parts.
+ * @description Splits a valid SVG path into it's parts.
* @param {string} path A valid SVG path
- * @link https://remotion.dev/docs/paths/get-parts
+ * @see [Documentation](https://remotion.dev/docs/paths/get-parts)
* @deprecated In favor of getSubpaths()
*/
export const getParts = (path: string): Part[] => {
diff --git a/packages/paths/src/get-point-at-length.ts b/packages/paths/src/get-point-at-length.ts
index 97f5b9b382..1271a3875f 100644
--- a/packages/paths/src/get-point-at-length.ts
+++ b/packages/paths/src/get-point-at-length.ts
@@ -2,11 +2,11 @@ import {construct} from './helpers/construct';
import {getPartAtLength} from './helpers/get-part-at-length';
/**
- * Gets the coordinates of a point which is on an SVG path.
+ * @description Gets the coordinates of a point which is on an SVG path.
* @param {string} path A valid SVG path
* @param {number} length The length at which the point should be sampled
- * @link https://remotion.dev/docs/paths/get-point-at-length
- */
+ * @see [Documentation](https://remotion.dev/docs/paths/get-point-at-length)
+*/
export const getPointAtLength = (path: string, length: number) => {
const constructed = construct(path);
const fractionPart = getPartAtLength(path, length);
diff --git a/packages/paths/src/get-subpaths.ts b/packages/paths/src/get-subpaths.ts
index 253c9fd4e8..e074133b32 100644
--- a/packages/paths/src/get-subpaths.ts
+++ b/packages/paths/src/get-subpaths.ts
@@ -2,9 +2,9 @@ import {construct} from './helpers/construct';
import {serializeInstructions} from './serialize-instructions';
/**
- * Splits a valid SVG path into it's parts.
+ * @description Splits a valid SVG path into it's parts.
* @param {string} path A valid SVG path
- * @link https://remotion.dev/docs/paths/get-subpaths
+ * @see [Documentation](https://remotion.dev/docs/paths/get-subpaths)
*/
export const getSubpaths = (path: string): string[] => {
const {segments} = construct(path);
diff --git a/packages/paths/src/get-tangent-at-length.ts b/packages/paths/src/get-tangent-at-length.ts
index 23cfe8273e..cc60d553a8 100644
--- a/packages/paths/src/get-tangent-at-length.ts
+++ b/packages/paths/src/get-tangent-at-length.ts
@@ -2,11 +2,12 @@ import {construct} from './helpers/construct';
import {getPartAtLength} from './helpers/get-part-at-length';
/**
- * Gets tangent values x and y of a point which is on an SVG path
+ * @description Gets tangent values x and y of a point which is on an SVG path
* @param {string} path A valid SVG path
* @param {number} length The length at which the tangent should be sampled
- * @link https://remotion.dev/docs/paths/get-tangent-at-length
+ * @see [Documentation](https://remotion.dev/docs/paths/get-tangent-at-length)
*/
+
export const getTangentAtLength = (path: string, length: number) => {
const constructed = construct(path);
diff --git a/packages/paths/src/interpolate-path.ts b/packages/paths/src/interpolate-path.ts
index e384ce0369..768801225a 100644
--- a/packages/paths/src/interpolate-path.ts
+++ b/packages/paths/src/interpolate-path.ts
@@ -418,11 +418,11 @@ function interpolatePathCommands(
}
/**
- * Interpolates between two SVG paths.
+ * @description Interpolates between two SVG paths.
* @param {number} value A number - 0 means first path, 1 means second path, any other values will be interpolated
* @param {string} firstPath The first valid SVG path
* @param {string} secondPath The second valid SVG path
- * @link https://remotion.dev/docs/paths/interpolate-path
+ * @see [Documentation](https://remotion.dev/docs/paths/interpolate-path)
*/
export const interpolatePath = (
value: number,
diff --git a/packages/paths/src/normalize-path.ts b/packages/paths/src/normalize-path.ts
index a0b32d69ba..a59da5448f 100644
--- a/packages/paths/src/normalize-path.ts
+++ b/packages/paths/src/normalize-path.ts
@@ -3,9 +3,9 @@ import {parsePath} from './parse-path';
import {serializeInstructions} from './serialize-instructions';
/**
- * Removes all relative coordinates from an SVG path and converts them into absolute coordinates.
+ * @description Removes all relative coordinates from an SVG path and converts them into absolute coordinates.
* @param {string} path A valid SVG path
- * @link https://remotion.dev/docs/paths/normalize-path
+ * @see [Documentation](https://remotion.dev/docs/paths/normalize-path)
*/
export const normalizePath = (path: string): string => {
const instructions = parsePath(path);
diff --git a/packages/paths/src/parse-path.ts b/packages/paths/src/parse-path.ts
index 42ce3461cf..a42a0b48fa 100644
--- a/packages/paths/src/parse-path.ts
+++ b/packages/paths/src/parse-path.ts
@@ -60,6 +60,12 @@ const makeInstructions = (
const segmentRegExp = /([astvzqmhlc])([^astvzqmhlc]*)/gi;
const numberRegExp = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
+/**
+ * @description Parses an SVG string path into an array of Instruction's.
+ * @param {string} path
+ * @returns an array of objects containing the Instructions
+ * @see [Documentation](https://www.remotion.dev/docs/paths/parse-path)
+ */
export const parsePath = (path: string): Instruction[] => {
if (!path) {
throw new Error('No path provided');
diff --git a/packages/paths/src/reduce-instructions.ts b/packages/paths/src/reduce-instructions.ts
index eff4b7841c..bf99192173 100644
--- a/packages/paths/src/reduce-instructions.ts
+++ b/packages/paths/src/reduce-instructions.ts
@@ -2,6 +2,11 @@ import {removeATSHVInstructions} from './helpers/remove-a-s-t-curves';
import type {Instruction, ReducedInstruction} from './helpers/types';
import {normalizeInstructions} from './normalize-path';
+/**
+ * @description Takes an array of Instruction's and reduces the amount of instruction types them so the path only consists of M, L, C, Q and Z instructions.
+ * @param {Array} instruction
+ * @see [Documentation](https://www.remotion.dev/docs/paths/reduce-instructions)
+ */
export const reduceInstructions = (
instruction: Instruction[]
): ReducedInstruction[] => {
diff --git a/packages/paths/src/reset-path.ts b/packages/paths/src/reset-path.ts
index 7a69c7ef66..6d2806d29e 100644
--- a/packages/paths/src/reset-path.ts
+++ b/packages/paths/src/reset-path.ts
@@ -1,6 +1,11 @@
import {getBoundingBox} from './get-bounding-box';
import {translatePath} from './translate-path';
+/**
+ * @description Translates an SVG path so that the top-left corner of the bounding box is at 0, 0.
+ * @param {string} d a valid SVG path
+ * @see [Documentation](https://www.remotion.dev/docs/paths/reset-path)
+ */
export const resetPath = (d: string) => {
const box = getBoundingBox(d);
return translatePath(d, -box.x1, -box.y1);
diff --git a/packages/paths/src/reverse-path.ts b/packages/paths/src/reverse-path.ts
index 56f41c4860..82a8f3da72 100644
--- a/packages/paths/src/reverse-path.ts
+++ b/packages/paths/src/reverse-path.ts
@@ -137,9 +137,9 @@ function reverseNormalizedPath(normalized: string) {
}
/**
- * Reverses a path so the end and start are switched.
+ * @description Reverses a path so the end and start are switched.
* @param {string} path A valid SVG path
- * @link https://remotion.dev/docs/paths/reverse-path
+ * @see [Documentation](https://remotion.dev/docs/paths/reverse-path)
*/
export const reversePath = (path: string) => {
const normalizedPath = normalizePath(path);
diff --git a/packages/paths/src/scale-path.ts b/packages/paths/src/scale-path.ts
index d1de5db70c..333a88cddd 100644
--- a/packages/paths/src/scale-path.ts
+++ b/packages/paths/src/scale-path.ts
@@ -5,6 +5,15 @@ import {reduceInstructions} from './reduce-instructions';
import {serializeInstructions} from './serialize-instructions';
import {translateSegments} from './translate-path';
+/**
+ * @description Allows you to grow or shrink the size of a path.
+ * @param {string} path A valid SVG path
+ * @param {string} d
+ * @param {Number} scaleX
+ * @param {Number} scaleY
+ * @returns a new path with respect to the scale values provided
+ * @see [Documentation](https://www.remotion.dev/docs/paths/scale-path)
+ */
export const scalePath = (d: string, scaleX: number, scaleY: number) => {
const reduced = reduceInstructions(parsePath(d));
diff --git a/packages/paths/src/serialize-instructions.ts b/packages/paths/src/serialize-instructions.ts
index 4efc890438..77ee0448b6 100644
--- a/packages/paths/src/serialize-instructions.ts
+++ b/packages/paths/src/serialize-instructions.ts
@@ -1,5 +1,11 @@
import type {Instruction} from './helpers/types';
+/**
+ * @description Takes an array of Instruction's and serializes it into an SVG path string.
+ * @param {Array} instruction
+ * @returns a serialized SVG path string
+ * @see [Documentation](https://www.remotion.dev/docs/paths/serialize-instructions)
+ */
const serializeInstruction = (instruction: Instruction): string => {
if (instruction.type === 'A') {
return `A ${instruction.rx} ${instruction.ry} ${
diff --git a/packages/paths/src/translate-path.ts b/packages/paths/src/translate-path.ts
index bc91046f51..cd89aa4fb2 100644
--- a/packages/paths/src/translate-path.ts
+++ b/packages/paths/src/translate-path.ts
@@ -119,6 +119,14 @@ export const translateSegments = (
});
};
+/**
+ * @description Translates the path by the given x and y coordinates.
+ * @param {string} path the originalSVG path
+ * @param {Number} x the amount of horizontal translation
+ * @param {Number} y the amount of vertical translation
+ * @returns a new string containing a path, if it is valid
+ * @see [Documentation](https://www.remotion.dev/docs/paths/translate-path)
+ */
export const translatePath = (path: string, x: number, y: number) => {
return serializeInstructions(translateSegments(parsePath(path), x, y));
};
diff --git a/packages/paths/src/warp-path/index.ts b/packages/paths/src/warp-path/index.ts
index 2f4bffcedf..728aeba074 100644
--- a/packages/paths/src/warp-path/index.ts
+++ b/packages/paths/src/warp-path/index.ts
@@ -21,6 +21,11 @@ const getDefaultInterpolationThreshold = (
return longer * 0.01;
};
+/**
+ * @description This function works by splitting SVG instructions into many smaller SVG instructions and then remapping the coordinates of each instruction.
+ * @param {string} path an SVG path string
+ * @see [Documentation](https://www.remotion.dev/docs/paths/warp-path)
+ */
export const warpPath = (
path: string,
transformer: WarpPathFn,
diff --git a/packages/shapes/src/components/circle.tsx b/packages/shapes/src/components/circle.tsx
index f8ded69606..efdace7d59 100644
--- a/packages/shapes/src/components/circle.tsx
+++ b/packages/shapes/src/components/circle.tsx
@@ -6,6 +6,11 @@ import {RenderSvg} from './render-svg';
export type CircleProps = MakeCircleProps & AllShapesProps;
+/**
+ * @description Renders an SVG element drawing a circle.
+ * @param {Number} radius The radius of the circle.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/circle)
+ */
export const Circle: React.FC<CircleProps> = ({radius, ...props}) => {
return <RenderSvg {...makeCircle({radius})} {...props} />;
};
diff --git a/packages/shapes/src/components/ellipse.tsx b/packages/shapes/src/components/ellipse.tsx
index 7330110809..a70dd5d479 100644
--- a/packages/shapes/src/components/ellipse.tsx
+++ b/packages/shapes/src/components/ellipse.tsx
@@ -6,6 +6,13 @@ import {RenderSvg} from './render-svg';
export type EllipseProps = MakeEllipseOptions & AllShapesProps;
+/**
+ * @description Renders an SVG element drawing an ellipse.
+ * @param {Number} rx The radius of the ellipse on the X axis.
+ * @param {Number} ry The radius of the ellipse on the Y axis.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/ellipse)
+ */
+
export const Ellipse: React.FC<EllipseProps> = ({rx, ry, ...props}) => {
return <RenderSvg {...makeEllipse({rx, ry})} {...props} />;
};
diff --git a/packages/shapes/src/components/pie.tsx b/packages/shapes/src/components/pie.tsx
index a75a9ecced..19a485a8e0 100644
--- a/packages/shapes/src/components/pie.tsx
+++ b/packages/shapes/src/components/pie.tsx
@@ -6,6 +6,16 @@ import {RenderSvg} from './render-svg';
export type PieProps = MakePieProps & AllShapesProps;
+/**
+ * @description Renders an SVG element drawing a pie piece.
+ * @param {Number} radius The radius of the circle..
+ * @param {Number} progress The percentage of the circle that is filled. 0 means fully empty, 1 means fully filled.
+ * @param {Boolean} closePath If set to false, no path to the middle of the circle will be drawn, leading to an open arc. Default true.
+ * @param {Boolean} counterClockwise If set, the circle gets filled counterclockwise instead of clockwise. Default false.
+ * @param {Boolean} rotation Add rotation to the path. 0 means no rotation, Math.PI * 2 means 1 full clockwise rotation
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/pie)
+ */
+
export const Pie: React.FC<PieProps> = ({
radius,
progress,
diff --git a/packages/shapes/src/components/rect.tsx b/packages/shapes/src/components/rect.tsx
index 60bf9b805b..5ea0c1adc7 100644
--- a/packages/shapes/src/components/rect.tsx
+++ b/packages/shapes/src/components/rect.tsx
@@ -6,6 +6,14 @@ import {RenderSvg} from './render-svg';
export type RectProps = MakeRectOptions & AllShapesProps;
+/**
+ * @description Renders an SVG element containing a rectangle.
+ * @param {Number} width The width of the Rectangle
+ * @param {Number} height The height of the Rectangle
+ * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
+ * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/rect)
+ */
export const Rect: React.FC<RectProps> = ({
width,
edgeRoundness,
diff --git a/packages/shapes/src/components/star.tsx b/packages/shapes/src/components/star.tsx
index 0afef4b911..83f10eefb7 100644
--- a/packages/shapes/src/components/star.tsx
+++ b/packages/shapes/src/components/star.tsx
@@ -6,6 +6,16 @@ import {RenderSvg} from './render-svg';
export type StarProps = MakeStarProps & Omit<AllShapesProps, 'points'>;
+/**
+ * @description Renders an SVG element containing a star.
+ * @param {Number} innerRadius The inner radius of the star.
+ * @param {Number} outerRadius The outer radius of the star.
+ * @param {Number} points The amount of points of the star.
+ * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
+ * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/star)
+ */
+
export const Star: React.FC<StarProps> = ({
innerRadius,
outerRadius,
diff --git a/packages/shapes/src/components/triangle.tsx b/packages/shapes/src/components/triangle.tsx
index f26c8b8a81..eb50359dc1 100644
--- a/packages/shapes/src/components/triangle.tsx
+++ b/packages/shapes/src/components/triangle.tsx
@@ -6,6 +6,14 @@ import {RenderSvg} from './render-svg';
export type TriangleProps = MakeTriangleProps & AllShapesProps;
+/**
+ * @description Renders an SVG element containing a triangle with same length on all sides.
+ * @param {Number} length The length of one triangle side.
+ * @param {string} direction The direction of the triangle
+ * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
+ * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/triangle)
+ */
export const Triangle: React.FC<TriangleProps> = ({
length,
direction,
diff --git a/packages/shapes/src/utils/make-circle.ts b/packages/shapes/src/utils/make-circle.ts
index ad09259ffc..4b640d404e 100644
--- a/packages/shapes/src/utils/make-circle.ts
+++ b/packages/shapes/src/utils/make-circle.ts
@@ -6,6 +6,11 @@ export type MakeCircleProps = {
radius: number;
};
+/**
+ * @description Generates a circle SVG path.
+ * @param {Number} radius The radius of the circle.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/make-circle)
+ */
export const makeCircle = ({radius}: MakeCircleProps): ShapeInfo => {
const instructions: Instruction[] = [
{
diff --git a/packages/shapes/src/utils/make-ellipse.ts b/packages/shapes/src/utils/make-ellipse.ts
index 41c4436914..101f567d66 100644
--- a/packages/shapes/src/utils/make-ellipse.ts
+++ b/packages/shapes/src/utils/make-ellipse.ts
@@ -7,6 +7,13 @@ export type MakeEllipseOptions = {
ry: number;
};
+/**
+ * @description Generates an ellipse SVG path.
+ * @param {Number} rx The radius of the ellipse on the X axis.
+ * @param {Number} ry The radius of the ellipse on the Y axis.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/make-ellipse)
+ */
+
export const makeEllipse = ({rx, ry}: MakeEllipseOptions): ShapeInfo => {
const instructions: Instruction[] = [
{
diff --git a/packages/shapes/src/utils/make-pie.ts b/packages/shapes/src/utils/make-pie.ts
index b7767e0e78..4e0f930803 100644
--- a/packages/shapes/src/utils/make-pie.ts
+++ b/packages/shapes/src/utils/make-pie.ts
@@ -35,6 +35,15 @@ const getCoord = ({
return rounded;
};
+/**
+ * @description Generates a piece of pie SVG path.
+ * @param {Number} radius The radius of the circle..
+ * @param {Number} progress The percentage of the circle that is filled. 0 means fully empty, 1 means fully filled.
+ * @param {Boolean} closePath If set to false, no path to the middle of the circle will be drawn, leading to an open arc. Default true.
+ * @param {Boolean} counterClockwise If set, the circle gets filled counterclockwise instead of clockwise. Default false.
+ * @param {Boolean} rotation Add rotation to the path. 0 means no rotation, Math.PI * 2 means 1 full clockwise rotation
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/make-pie)
+ */
export const makePie = ({
progress,
radius,
diff --git a/packages/shapes/src/utils/make-rect.ts b/packages/shapes/src/utils/make-rect.ts
index 03f9308cb7..f05bc7fe68 100644
--- a/packages/shapes/src/utils/make-rect.ts
+++ b/packages/shapes/src/utils/make-rect.ts
@@ -10,6 +10,14 @@ export type MakeRectOptions = {
cornerRadius?: number;
};
+/**
+ * @description Generates an SVG rectangle.
+ * @param {Number} width The width of the rectangle.
+ * @param {Number} height The height of the rectangle
+ * @param {Number | null} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
+ * @param {Number} cornerRadius * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/make-rect)
+ */
export const makeRect = ({
width,
height,
diff --git a/packages/shapes/src/utils/make-star.ts b/packages/shapes/src/utils/make-star.ts
index 0ac2b1e10c..3a0e4931c8 100644
--- a/packages/shapes/src/utils/make-star.ts
+++ b/packages/shapes/src/utils/make-star.ts
@@ -23,6 +23,15 @@ export type StarProps = {
cornerRadius: number;
};
+/**
+ * @description Generates a star SVG path.
+ * @param {Number} innerRadius The inner radius of the star.
+ * @param {Number} outerRadius The outer radius of the star.
+ * @param {Number} points The amount of points of the star.
+ * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
+ * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/make-star)
+ */
const star = ({
centerX,
centerY,
diff --git a/packages/shapes/src/utils/make-triangle.ts b/packages/shapes/src/utils/make-triangle.ts
index 53a2a02eec..68fdba9006 100644
--- a/packages/shapes/src/utils/make-triangle.ts
+++ b/packages/shapes/src/utils/make-triangle.ts
@@ -14,6 +14,14 @@ export type MakeTriangleProps = {
cornerRadius?: number;
};
+/**
+ * @description Generates an SVG path for a triangle with the same length on all sides.
+ * @param {Number} length The length of one triangle side.
+ * @param {string} direction The direction of the triangle
+ * @param {null|Number} edgeRoundness Allows to modify the shape by rounding the edges using bezier curves. Default null.
+ * @param {Number} cornerRadius Rounds the corner using an arc. Similar to CSS's border-radius. Cannot be used together with edgeRoundness.
+ * @see [Documentation](https://www.remotion.dev/docs/shapes/make-triangle)
+ */
export const makeTriangle = ({
length,
direction = 'right',