import * as _angular_forms from '@angular/forms';
import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
import * as i0 from '@angular/core';
import { ElementRef, Renderer2 } from '@angular/core';

interface AddrInputEvent {
    type?: 'insert' | 'delete' | 'paste';
    pos: number;
    change: string | null;
    value?: string | null;
    previous?: string | null;
}
/**
 * Base directive for ip address input fields.
 */
declare abstract class SiIpInputDirective {
    private static idCounter;
    protected readonly elementRef: ElementRef<any>;
    protected readonly renderer: Renderer2;
    protected readonly inputEl: any;
    /**
     * @defaultValue
     * ```
     * `si-ip-input-${SiIpInputDirective.idCounter++}`
     * ```
     */
    readonly id: i0.InputSignal<string>;
    /**
     * Enable CIDR (Classless Inter-Domain Routing) notation.
     * @defaultValue false
     */
    readonly cidr: i0.InputSignalWithTransform<boolean, unknown>;
    /**
     * Whether the ip address input is disabled.
     * @defaultValue false
     */
    readonly disabledInput: i0.InputSignal<boolean>;
    private readonly disabledNgControl;
    protected readonly disabled: i0.Signal<boolean>;
    protected onTouched: () => void;
    protected onChange: (value: any) => void;
    protected value?: string | null;
    registerOnChange(fn: any): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    writeValue(value?: string | null): void;
    protected onInput(e: Event): void;
    /** @internal */
    protected blur(): void;
    /**
     * Allow to adjust the input value when leaving the input field.
     */
    protected leaveInput(): void;
    /**
     * Enforce a format on user input.
     */
    protected abstract maskInput(e: AddrInputEvent): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SiIpInputDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<SiIpInputDirective, "input[siIpInput]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "cidr": { "alias": "cidr"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

/**
 * Directive for IPv4 address input fields.
 *
 * Usage:
 *
 * ```ts
 * import { SiFormItemComponent } from '@siemens/element-ng/form';
 * import { SiIp4InputDirective } from '@siemens/element-ng/ip-input';
 *
 * @Component({
 *   template: `
 *     <si-form-item label="IPv4 address">
 *       <input type="text" class="form-control" siIpV4 />
 *     </si-form-item>
 *   `,
 *   imports: [SiFormItemComponent, SiIp4InputDirective, ...]
 * })
 * ```
 */
declare class SiIp4InputDirective extends SiIpInputDirective implements ControlValueAccessor, Validator {
    validate(control: AbstractControl): ValidationErrors | null;
    /**
     * Trim leading zeros from each part of the IPv4 address
     */
    protected leaveInput(): void;
    /** @internal */
    protected maskInput(e: AddrInputEvent): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SiIp4InputDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<SiIp4InputDirective, "input[siIpV4]", ["siIpV4"], {}, {}, never, never, true, never>;
}

/**
 * Directive for IPv6 address input fields.
 *
 * Usage:
 *
 * ```ts
 * import { SiFormItemComponent } from '@siemens/element-ng/form';
 * import { SiIp6InputDirective } from '@siemens/element-ng/ip-input';
 *
 * @Component({
 *   template: `
 *     <si-form-item label="IPv6 address">
 *       <input type="text" class="form-control" siIpV6 />
 *     </si-form-item>
 *   `,
 *   imports: [SiFormItemComponent, SiIp6InputDirective, ...]
 * })
 * ```
 */
declare class SiIp6InputDirective extends SiIpInputDirective implements ControlValueAccessor, Validator {
    protected readonly validatorFn: i0.Signal<_angular_forms.ValidatorFn>;
    validate(control: AbstractControl): ValidationErrors | null;
    protected maskInput(e: AddrInputEvent): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SiIp6InputDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<SiIp6InputDirective, "input[siIpV6]", ["siIpV6"], {}, {}, never, never, true, never>;
}

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

/**
 * Validator factory for a IPV6 address.
 */
declare const ipV6Validator: (options: {
    zeroCompression?: boolean;
    cidr?: boolean;
}) => ValidatorFn;
/**
 * Validates a IPV4 address.
 */
declare const ipV4Validator: ValidatorFn;
/**
 * Validates a IPV4 address including CIDR.
 */
declare const ipV4CIDRValidator: ValidatorFn;

export { SiIp4InputDirective, SiIp6InputDirective, ipV4CIDRValidator, ipV4Validator, ipV6Validator };
