react-textmotion
Version:
Lightweight yet powerful library that provides variable animation effects for React applications.
26 lines (25 loc) • 1.1 kB
TypeScript
import type { NodeMotionProps, TextMotionProps } from '../../types';
export type ValidationResult = {
errors: string[];
warnings: string[];
};
/**
* @description
* Validates the props for the TextMotion component.
* It checks for the presence and type of the 'text' prop, the value of the 'split' prop,
* and runs validation on the 'motion' prop.
*
* @param {TextMotionProps} props - The props of the TextMotion component to validate.
* @returns {ValidationResult} An object containing arrays of errors and warnings.
*/
export declare const validateTextMotionProps: (props: TextMotionProps) => ValidationResult;
/**
* @description
* Validates the props for the NodeMotion component.
* It warns if the 'children' prop is empty, checks the value of the 'split' prop,
* and runs validation on the 'motion' prop.
*
* @param {NodeMotionProps} props - The props of the NodeMotion component to validate.
* @returns {ValidationResult} An object containing arrays of errors and warnings.
*/
export declare const validateNodeMotionProps: (props: NodeMotionProps) => ValidationResult;