diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-03-26 13:52:30 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-03-29 15:49:30 +0200 |
| commit | 722dcdd88face3724c77d23bc36a00524e552551 (patch) | |
| tree | 9dbf561de29592d5a346b8c7bfd27b5d31345bc8 /apps/web/src/lib/animation | |
| parent | 8db3bead13441a5882d8689dfc6a9f09c82375d9 (diff) | |
| download | opencut-722dcdd88face3724c77d23bc36a00524e552551.tar.gz | |
fix: resolve typescript/lint errors
Diffstat (limited to 'apps/web/src/lib/animation')
| -rw-r--r-- | apps/web/src/lib/animation/effect-param-channel.ts | 10 | ||||
| -rw-r--r-- | apps/web/src/lib/animation/graphic-param-channel.ts | 10 | ||||
| -rw-r--r-- | apps/web/src/lib/animation/keyframe-query.ts | 2 | ||||
| -rw-r--r-- | apps/web/src/lib/animation/keyframes.ts | 4 | ||||
| -rw-r--r-- | apps/web/src/lib/animation/property-registry.ts | 10 | ||||
| -rw-r--r-- | apps/web/src/lib/animation/target-resolver.ts | 16 |
6 files changed, 22 insertions, 30 deletions
diff --git a/apps/web/src/lib/animation/effect-param-channel.ts b/apps/web/src/lib/animation/effect-param-channel.ts index 323d9f54..a614c14f 100644 --- a/apps/web/src/lib/animation/effect-param-channel.ts +++ b/apps/web/src/lib/animation/effect-param-channel.ts @@ -26,11 +26,9 @@ export function buildEffectParamPath({ return `${EFFECT_PARAM_PATH_PREFIX}${effectId}${EFFECT_PARAM_PATH_SUFFIX}${paramKey}`; } -export function isEffectParamPath({ - propertyPath, -}: { - propertyPath: string; -}): propertyPath is EffectParamPath { +export function isEffectParamPath( + propertyPath: string, +): propertyPath is EffectParamPath { return ( propertyPath.startsWith(EFFECT_PARAM_PATH_PREFIX) && propertyPath.includes(EFFECT_PARAM_PATH_SUFFIX) @@ -42,7 +40,7 @@ export function parseEffectParamPath({ }: { propertyPath: string; }): { effectId: string; paramKey: string } | null { - if (!isEffectParamPath({ propertyPath })) { + if (!isEffectParamPath(propertyPath)) { return null; } diff --git a/apps/web/src/lib/animation/graphic-param-channel.ts b/apps/web/src/lib/animation/graphic-param-channel.ts index e77e4c73..7db544e3 100644 --- a/apps/web/src/lib/animation/graphic-param-channel.ts +++ b/apps/web/src/lib/animation/graphic-param-channel.ts @@ -20,11 +20,9 @@ export function buildGraphicParamPath({ return `${GRAPHIC_PARAM_PATH_PREFIX}${paramKey}`; } -export function isGraphicParamPath({ - propertyPath, -}: { - propertyPath: string; -}): propertyPath is GraphicParamPath { +export function isGraphicParamPath( + propertyPath: string, +): propertyPath is GraphicParamPath { return propertyPath.startsWith(GRAPHIC_PARAM_PATH_PREFIX); } @@ -33,7 +31,7 @@ export function parseGraphicParamPath({ }: { propertyPath: string; }): { paramKey: string } | null { - if (!isGraphicParamPath({ propertyPath })) { + if (!isGraphicParamPath(propertyPath)) { return null; } diff --git a/apps/web/src/lib/animation/keyframe-query.ts b/apps/web/src/lib/animation/keyframe-query.ts index 753e31d0..637b0289 100644 --- a/apps/web/src/lib/animation/keyframe-query.ts +++ b/apps/web/src/lib/animation/keyframe-query.ts @@ -20,7 +20,7 @@ export function getElementKeyframes({ if ( !channel || channel.keyframes.length === 0 || - !isAnimationPath({ propertyPath }) + !isAnimationPath(propertyPath) ) { return []; } diff --git a/apps/web/src/lib/animation/keyframes.ts b/apps/web/src/lib/animation/keyframes.ts index 5fa99fb8..13cdf238 100644 --- a/apps/web/src/lib/animation/keyframes.ts +++ b/apps/web/src/lib/animation/keyframes.ts @@ -616,8 +616,8 @@ export function splitAnimationsAtTime({ time: splitTime, fallbackValue: normalizedChannel.keyframes[0].value, }); - const knownPropertyPath = isAnimationPropertyPath({ propertyPath }) - ? (propertyPath as AnimationPropertyPath) + const knownPropertyPath = isAnimationPropertyPath(propertyPath) + ? propertyPath : null; const boundaryInterpolation = knownPropertyPath ? getDefaultInterpolationForProperty({ diff --git a/apps/web/src/lib/animation/property-registry.ts b/apps/web/src/lib/animation/property-registry.ts index 0b28e783..46990754 100644 --- a/apps/web/src/lib/animation/property-registry.ts +++ b/apps/web/src/lib/animation/property-registry.ts @@ -245,12 +245,10 @@ const ANIMATION_PROPERTY_REGISTRY: Record< }, }; -export function isAnimationPropertyPath({ - propertyPath, -}: { - propertyPath: string; -}): boolean { - return propertyPath in ANIMATION_PROPERTY_REGISTRY; +export function isAnimationPropertyPath( + propertyPath: string, +): propertyPath is AnimationPropertyPath { + return Object.hasOwn(ANIMATION_PROPERTY_REGISTRY, propertyPath); } export function getAnimationPropertyDefinition({ diff --git a/apps/web/src/lib/animation/target-resolver.ts b/apps/web/src/lib/animation/target-resolver.ts index e801bc68..10b83775 100644 --- a/apps/web/src/lib/animation/target-resolver.ts +++ b/apps/web/src/lib/animation/target-resolver.ts @@ -204,15 +204,13 @@ function buildEffectParamDescriptor({ }; } -export function isAnimationPath({ - propertyPath, -}: { - propertyPath: string; -}): propertyPath is AnimationPath { +export function isAnimationPath( + propertyPath: string, +): propertyPath is AnimationPath { return ( - isAnimationPropertyPath({ propertyPath }) || - isGraphicParamPath({ propertyPath }) || - isEffectParamPath({ propertyPath }) + isAnimationPropertyPath(propertyPath) || + isGraphicParamPath(propertyPath) || + isEffectParamPath(propertyPath) ); } @@ -223,7 +221,7 @@ export function resolveAnimationTarget({ element: TimelineElement; path: AnimationPath; }): AnimationPathDescriptor | null { - if (isAnimationPropertyPath({ propertyPath: path })) { + if (isAnimationPropertyPath(path)) { const propertyDefinition = getAnimationPropertyDefinition({ propertyPath: path, }); |
