juvo-rafa-library
Version:
A comprehensive Angular component library featuring real-world components and validators extracted from the Juvo Rafa backoffice application. Now with improved select components and bug fixes.
29 lines (28 loc) • 869 B
TypeScript
import { ValidatorFn } from '@angular/forms';
/**
* Validator function for IPv4 addresses
*
* @description
* Validates that the input value matches a valid IPv4 address format.
* Supports standard IPv4 notation (e.g., 192.168.1.1, 10.0.0.1, 255.255.255.255).
*
* @example
* ```typescript
* // Basic usage in FormControl
* const ipControl = new FormControl('', [ipAddressValidator()]);
*
* // Usage in reactive forms
* this.networkForm = this.fb.group({
* serverIp: ['', [Validators.required, ipAddressValidator()]]
* });
*
* // Valid inputs: '192.168.1.1', '10.0.0.1', '127.0.0.1'
* // Invalid inputs: '256.1.1.1', '192.168.1', 'invalid-ip'
* ```
*
* @returns ValidatorFn that returns null if valid, or validation error object if invalid
*
* @since 2.0.0
* @author Juvo Rafa Team
*/
export declare function ipAddressValidator(): ValidatorFn;