🎥 Make videos programmatically with React
rename + export to warppathFn
Jonny Burger1033aa2b5983
diff --git a/packages/paths/src/index.ts b/packages/paths/src/index.tsindex 0adbe67735..990825ab56 100644--- a/packages/paths/src/index.ts+++ b/packages/paths/src/index.ts@@ -21,4 +21,4 @@ export {resetPath} from './reset-path';export {reversePath} from './reverse-path';export {serializeInstructions} from './serialize-instructions';export {translatePath} from './translate-path';-export {warpPath} from './warp-path';+export {warpPath, WarpPathFn} from './warp-path';diff --git a/packages/paths/src/warp-path/index.ts b/packages/paths/src/warp-path/index.tsindex bddb7ff2f3..46ad68e386 100644--- a/packages/paths/src/warp-path/index.ts+++ b/packages/paths/src/warp-path/index.ts@@ -1,7 +1,7 @@import {parsePath} from '../parse-path';import {reduceInstructions} from '../reduce-instructions';import {serializeInstructions} from '../serialize-instructions';-import type {PointTransformer} from './warp-helpers';+import type {WarpPathFn} from './warp-helpers';import {fixZInstruction,svgPathInterpolate,@@ -10,7 +10,7 @@ import {export const warpPath = (path: string,- transformer: PointTransformer,+ transformer: WarpPathFn,interpolationThreshold: number): string => {const reduced = reduceInstructions(parsePath(path));@@ -19,3 +19,5 @@ export const warpPath = (return serializeInstructions(warpTransform(interpolated, transformer));};++export type {WarpPathFn} from './warp-helpers';diff --git a/packages/paths/src/warp-path/warp-helpers.ts b/packages/paths/src/warp-path/warp-helpers.tsindex ddc9527113..62fa83a7fb 100644--- a/packages/paths/src/warp-path/warp-helpers.ts+++ b/packages/paths/src/warp-path/warp-helpers.ts@@ -1,6 +1,6 @@import type {ReducedInstruction} from '../helpers/types';-export type PointTransformer = (point: {x: number; y: number}) => {+export type WarpPathFn = (point: {x: number; y: number}) => {x: number;y: number;};@@ -95,7 +95,7 @@ function warpInterpolate(export const warpTransform = (path: ReducedInstruction[],- transformer: PointTransformer+ transformer: WarpPathFn) => {return pathTransform(path, (segment): ReducedInstruction[] => {if (segment.type === 'L') {