From e2c09628e32e8d296f1fd08e70f93dfa7ed4c3ff Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 11:21:30 +0200 Subject: [PATCH] Update function signatures in paths.ts to include generic types --- src/document/paths.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/document/paths.ts b/src/document/paths.ts index 3c6cf751..209f5a90 100644 --- a/src/document/paths.ts +++ b/src/document/paths.ts @@ -163,7 +163,7 @@ function clampProgress(progress: number): number { } function resolvePathSegmentSample( - path: ResolvedPathLike, + path: ResolvedPathLike, progress: number ): { segmentIndex: number | null; distance: number } { if (path.segments.length === 0 || path.totalLength <= 0) { @@ -193,7 +193,7 @@ function resolvePathSegmentSample( } function findNonZeroSegmentTangent( - path: ResolvedPathLike, + path: ResolvedPathLike, index: number ): Vec3 { for (let candidateIndex = index; candidateIndex < path.segments.length; candidateIndex += 1) { @@ -230,6 +230,9 @@ function lerpVec3(start: Vec3, end: Vec3, t: number): Vec3 { } function buildSmoothedPolylinePoints(path: ResolvedPathLike): Vec3[] { +function buildSmoothedPolylinePoints( + path: ResolvedPathLike +): Vec3[] { let points = path.points.map((point) => cloneVec3(point.position)); for ( @@ -272,6 +275,9 @@ function buildSmoothedPolylinePoints(path: ResolvedPathLike): Vec3[] { } function buildSmoothedPathSamples(path: ResolvedPathLike): SmoothedPathSample[] { +function buildSmoothedPathSamples( + path: ResolvedPathLike +): SmoothedPathSample[] { if (path.points.length === 0) { return [ { @@ -339,7 +345,7 @@ function buildSmoothedPathSamples(path: ResolvedPathLike): SmoothedPathSample[] } function sampleSmoothedPath( - path: ResolvedPathLike, + path: ResolvedPathLike, progress: number ): { position: Vec3; tangent: Vec3 } { const samples = buildSmoothedPathSamples(path); @@ -663,7 +669,7 @@ export function getScenePathLength(path: Pick): nu } export function sampleResolvedScenePathPosition( - path: ResolvedPathLike, + path: ResolvedPathLike, progress: number, options: { smooth?: boolean } = {} ): Vec3 { @@ -713,7 +719,7 @@ export function sampleScenePathPosition( } export function sampleResolvedScenePathTangent( - path: ResolvedPathLike, + path: ResolvedPathLike, progress: number, options: { smooth?: boolean } = {} ): Vec3 {