react-textmotion
Version:
Lightweight yet powerful library that provides variable animation effects for React applications.
26 lines (25 loc) • 1.23 kB
TypeScript
import type { NodeMotionProps, TextMotionProps } from '../../types';
type UseValidationProps = {
componentName: 'TextMotion' | 'NodeMotion';
props: TextMotionProps | NodeMotionProps;
};
/**
* @description
* Validates the props of a TextMotion or NodeMotion component.
* It checks for required props, invalid values, and logs warnings or throws errors in non-production environments.
*
* @param {'TextMotion' | 'NodeMotion'} componentName - The name of the component to validate ('TextMotion' or 'NodeMotion').
* @param {TextMotionProps | NodeMotionProps} props - The props to validate.
*/
export declare const useValidation: ({ componentName, props }: UseValidationProps) => void;
/**
* @description
* Handles validation errors and warnings by logging them to the console.
* In a non-production environment, it will throw an error if there are any validation errors.
*
* @param {string} componentName - The name of the component being validated.
* @param {string[]} errors - A list of validation error messages.
* @param {string[]} warnings - A list of validation warning messages.
*/
export declare const handleValidation: (componentName: string, errors: string[], warnings: string[]) => void;
export {};