resolve linting errors

This commit is contained in:
Sudev Kiyada 2025-12-04 09:25:44 +05:30
parent 8414c1079b
commit 92e72ce7be
Failed to extract signature
3 changed files with 33 additions and 56 deletions

View file

@ -11,7 +11,6 @@
isReverseMode,
createRenderConfig,
isNullish,
debounce,
} from './ts/utils';
import { Tween } from 'svelte/motion';

View file

@ -1,44 +1,43 @@
// Types
import type { Snippet } from 'svelte';
import {
type Config,
type DotLottie as DotLottieType,
type Config,
type DotLottie as DotLottieType,
} from '@lottiefiles/dotlottie-web';
import { type LottieState } from './lottieState.svelte';
type DotlottieProps = {
autoplay?: Config['autoplay'];
backgroundColor?: Config['backgroundColor'];
data?: Config['data'];
loop?: Config['loop'];
mode?: Config['mode'];
renderConfig?: Config['renderConfig'];
segment?: Config['segment'];
speed?: Config['speed'];
src: Config['src'];
useFrameInterpolation?: Config['useFrameInterpolation'];
marker?: Config['marker'] | undefined;
layout?: Config['layout'];
animationId?: Config['animationId'];
themeId?: Config['themeId'];
playOnHover?: boolean;
themeData?: string;
dotLottieRefCallback?: (dotLottie: DotLottieType) => void;
onLoad?: () => void;
onRender?: () => void;
onComplete?: () => void;
autoplay?: Config['autoplay'];
backgroundColor?: Config['backgroundColor'];
data?: Config['data'];
loop?: Config['loop'];
mode?: Config['mode'];
renderConfig?: Config['renderConfig'];
segment?: Config['segment'];
speed?: Config['speed'];
src: Config['src'];
useFrameInterpolation?: Config['useFrameInterpolation'];
marker?: Config['marker'] | undefined;
layout?: Config['layout'];
animationId?: Config['animationId'];
themeId?: Config['themeId'];
playOnHover?: boolean;
themeData?: string;
dotLottieRefCallback?: (dotLottie: DotLottieType) => void;
onLoad?: () => void;
onRender?: () => void;
onComplete?: () => void;
};
export type Props = DotlottieProps & {
// Additional properties can be added here if needed
lottiePlayer?: DotLottieType | undefined;
showDebugInfo?: boolean;
height?: string;
lottieState?: LottieState;
progress?: number;
tweenDuration?: number;
easing?: (t: number) => number;
/** Children render function */
children?: Snippet;
// Additional properties can be added here if needed
lottiePlayer?: DotLottieType | undefined;
showDebugInfo?: boolean;
height?: string;
lottieState?: LottieState;
progress?: number;
tweenDuration?: number;
easing?: (t: number) => number;
/** Children render function */
children?: Snippet;
};

View file

@ -106,27 +106,6 @@ export function createRenderConfig() {
/**
* Checks if a value is null or undefined (empty marker check)
*/
export function isNullish(value: any): boolean {
export function isNullish(value: unknown): boolean {
return value === null || value === undefined || value === '';
}
/**
* Returns a debounced version of the given function.
* @template T
* @param {T} func - The function to debounce.
* @param {number} [delay=0] - The debounce delay in milliseconds.
* @returns {(...args: Parameters<T>) => void} The debounced function.
*/
export function debounce<T extends (...args: unknown[]) => void>(
func: T,
delay = 0
) {
let timeoutId: ReturnType<typeof setTimeout> | undefined;
return (...args: Parameters<T>) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
func(...args);
}, delay);
};
}