UNPKG

credix

Version:

Official SDK for Credix Credit Management System

54 lines 1.89 kB
/** * Validation utilities for SDK inputs */ export declare class Validator { /** * Validates that a value is not null or undefined */ static required<T>(value: T | null | undefined, fieldName: string): T; /** * Validates that a string is not empty */ static notEmpty(value: string | null | undefined, fieldName: string): string; /** * Validates that a value is a positive number */ static positiveNumber(value: number | null | undefined, fieldName: string): number; /** * Validates that a value is a non-negative number */ static nonNegativeNumber(value: number | null | undefined, fieldName: string): number; /** * Validates that a value is within a range */ static inRange(value: number | null | undefined, fieldName: string, min: number, max: number): number; /** * Validates an email address */ static email(value: string | null | undefined, fieldName: string): string; /** * Validates a UUID */ static uuid(value: string | null | undefined, fieldName: string): string; /** * Validates an ISO date string */ static isoDate(value: string | null | undefined, fieldName: string): string; /** * Checks if a string is ISO 8601 format (for validation only) */ static isISO8601(value: string): boolean; /** * Validates an enum value */ static enum<T extends string>(value: T | null | undefined, fieldName: string, validValues: readonly T[]): T; /** * Validates an array is not empty */ static notEmptyArray<T>(value: T[] | null | undefined, fieldName: string): T[]; /** * Validates object has required properties */ static hasProperties<T extends object>(value: T | null | undefined, fieldName: string, requiredProps: (keyof T)[]): T; } //# sourceMappingURL=validator.d.ts.map