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, isReverseMode,
createRenderConfig, createRenderConfig,
isNullish, isNullish,
debounce,
} from './ts/utils'; } from './ts/utils';
import { Tween } from 'svelte/motion'; import { Tween } from 'svelte/motion';

View file

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

View file

@ -106,27 +106,6 @@ export function createRenderConfig() {
/** /**
* Checks if a value is null or undefined (empty marker check) * 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 === ''; 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);
};
}