/** * Validation utilities for input validation * @module */ /** * Validates a resource key format * * Resource keys follow the format: {game_id}.{resource_type}.{id} * Examples: * - League: "423.l.12345" * - Team: "423.l.12345.t.1" * - Player: "423.p.8888" * * @param key - The resource key to validate * @param resourceType - Optional resource type to validate against ('l', 't', 'p', etc.) * @throws {ValidationError} If the key format is invalid * * @example * ```typescript * validateResourceKey('423.l.12345', 'l'); // Valid * validateResourceKey('invalid-key'); // Throws ValidationError * ``` */ export declare function validateResourceKey(key: string, resourceType?: string): void; /** * Validates a league key format * * @param key - The league key to validate * @throws {ValidationError} If the key is not a valid league key * * @example * ```typescript * validateLeagueKey('423.l.12345'); // Valid * validateLeagueKey('423.t.1'); // Throws - not a league key * ``` */ export declare function validateLeagueKey(key: string): void; /** * Validates a team key format * * @param key - The team key to validate * @throws {ValidationError} If the key is not a valid team key * * @example * ```typescript * validateTeamKey('423.l.12345.t.1'); // Valid * validateTeamKey('423.l.12345'); // Throws - not a team key * ``` */ export declare function validateTeamKey(key: string): void; /** * Validates a player key format * * @param key - The player key to validate * @throws {ValidationError} If the key is not a valid player key * * @example * ```typescript * validatePlayerKey('423.p.8888'); // Valid * validatePlayerKey('423.l.12345'); // Throws - not a player key * ``` */ export declare function validatePlayerKey(key: string): void; /** * Validates a game code * * @param code - The game code to validate * @throws {ValidationError} If the code is not a valid game code * * @example * ```typescript * validateGameCode('nhl'); // Valid * validateGameCode('invalid'); // Throws * ``` */ export declare function validateGameCode(code: string): void; /** * Validates a date string in YYYY-MM-DD format * * @param date - The date string to validate * @param fieldName - Optional field name for error messages * @throws {ValidationError} If the date format is invalid * * @example * ```typescript * validateDate('2024-11-15'); // Valid * validateDate('2024-13-01'); // Throws - invalid month * validateDate('11/15/2024'); // Throws - wrong format * ``` */ export declare function validateDate(date: string, fieldName?: string): void; /** * Validates a week number for NFL * * @param week - The week number to validate * @throws {ValidationError} If the week is invalid * * @example * ```typescript * validateWeek(1); // Valid * validateWeek(18); // Valid * validateWeek(0); // Throws * validateWeek(20); // Throws * ``` */ export declare function validateWeek(week: number): void; /** * Validates pagination parameters * * @param start - Starting index * @param count - Number of items * @throws {ValidationError} If parameters are invalid * * @example * ```typescript * validatePagination(0, 25); // Valid * validatePagination(-1, 25); // Throws * validatePagination(0, 0); // Throws * ``` */ export declare function validatePagination(start?: number, count?: number): void; /** * Validates that a required parameter is provided * * @param value - The value to check * @param fieldName - The field name for error messages * @throws {ValidationError} If the value is null or undefined * * @example * ```typescript * validateRequired('value', 'fieldName'); // Valid * validateRequired(null, 'fieldName'); // Throws * validateRequired(undefined, 'fieldName'); // Throws * ``` */ export declare function validateRequired(value: T | null | undefined, fieldName: string): asserts value is T; /** * Validates that a value is one of a set of allowed values * * @param value - The value to check * @param allowedValues - Array of allowed values * @param fieldName - The field name for error messages * @throws {ValidationError} If the value is not in the allowed set * * @example * ```typescript * validateEnum('active', ['active', 'inactive'], 'status'); // Valid * validateEnum('pending', ['active', 'inactive'], 'status'); // Throws * ``` */ export declare function validateEnum(value: string, allowedValues: readonly T[], fieldName: string): asserts value is T; //# sourceMappingURL=validators.d.ts.map