UNPKG

arayts

Version:

让 TypeScript 开发如丝般顺滑。ArayTS 提供了一套高效、优雅的算法工具集,包含常用的数据结构与算法实现,帮助开发者轻松构建可靠的应用程序。

23 lines 713 B
type DataType = 'string' | 'number' | 'boolean' | 'date' | 'array' | 'object'; export interface ValidationRule { type: DataType; required?: boolean; defaultValue?: any; transform?: (value: any) => any; } export interface ValidationResult { isValid: boolean; errors: string[]; } export declare class DataValidator { private rules; constructor(rules: Record<string, ValidationRule>); validate(data: Record<string, any>): ValidationResult; private isValidType; } export declare class DataConverter { static convert(value: any, targetType: DataType): any; static handleError(error: Error, context: string): void; } export {}; //# sourceMappingURL=dataValidator.d.ts.map