import * as _angular_core from '@angular/core';
import { OnChanges, ElementRef, SimpleChanges } from '@angular/core';
import * as _siemens_element_translate_ng_translate from '@siemens/element-translate-ng/translate';
import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
import { SiFormItemControl } from '@siemens/element-ng/form';
import { SelectOption } from '@siemens/element-ng/select';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
/** */
interface PhoneNumberModel {
    /**
     * Country code
     */
    countryCode?: string;
    /**
     * Phone number
     */
    phoneNumber?: string;
}
/**
 * Describes the country information of the phone number.
 */
interface CountryInfo {
    /**
     * The name of the country.
     **/
    name: string;
    /**
     * The country dial code
     */
    countryCode: number;
    /**
     * The country ISO code.
     */
    isoCode: string;
}
/**
 * Describes the phone number, its validity and associated country information.
 */
interface PhoneDetails {
    /**
     * CountryInfo object containing name, countryCode and isoCode of the phone number.
     */
    country?: CountryInfo;
    /**
     * Phone number entered by the user.
     */
    phoneNumber?: string;
    /**
     * Confirms if the phone number is valid or not
     */
    isValid: boolean;
}

declare class SiPhoneNumberInputComponent implements ControlValueAccessor, Validator, OnChanges, SiFormItemControl {
    private static idCounter;
    private phoneUtil;
    private translate;
    private locale;
    private changeDetectorRef;
    private elementRef;
    /**
     * Unique identifier.
     *
     * @defaultValue
     * ```
     * `__si-phone-number-input-${SiPhoneNumberInputComponent.idCounter++}`
     * ```
     */
    readonly id: _angular_core.InputSignal<string>;
    /**
     * ISO_3166-2 Code of the selected country.
     */
    readonly country: _angular_core.ModelSignal<string | undefined>;
    /**
     * ISO_3166-2 Code of the country which shall be used on form-control reset.
     */
    readonly defaultCountry: _angular_core.InputSignal<string | undefined>;
    /**
     * Placeholder text for country search input.
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_PHONE_NUMBER_INPUT.SEARCH_PLACEHOLDER:Search`)
     * ```
     */
    readonly placeholderForSearch: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_PHONE_NUMBER_INPUT.SEARCH_NO-RESULTS_FOUND:No results found`)
     * ```
     */
    readonly searchNoResultsFoundLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * Text for the country dropdown aria-label attribute.
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_PHONE_NUMBER_INPUT.SELECT_COUNTRY:Select country`)
     * ```
     */
    readonly selectCountryAriaLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * Text for the phone number input aria-label attribute.
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_PHONE_NUMBER_INPUT.PHONE_NUMBER_INPUT_LABEL:Enter phone number`)
     * ```
     */
    readonly phoneNumberAriaLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * List of countries in ISO2 format, from which the user is allowed to select one.
     * If no values are provided, the dropdown will show all known countries.
     */
    readonly supportedCountries: _angular_core.InputSignal<readonly string[] | null | undefined>;
    /**
     * @defaultValue
     * ```
     * `${this.id()}-label`
     * ```
     */
    readonly labelledby: _angular_core.InputSignal<string>;
    /** @defaultValue false */
    readonly disabledInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /** @defaultValue false */
    readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
    readonly valueChange: _angular_core.OutputEmitterRef<PhoneDetails>;
    /**
     * This ID will be bound to the `aria-describedby` attribute of the phone-number-input.
     * Use this to reference the element containing the error message(s) for the phone-number-input.
     * It will be picked by the {@link SiFormItemComponent} if the phone-number-input is used inside a form item.
     *
     * @defaultValue
     * ```
     * `${this.id()}-errormessage`
     * ```
     */
    readonly errormessageId: _angular_core.InputSignal<string>;
    protected readonly phoneInput: _angular_core.Signal<ElementRef<HTMLInputElement>>;
    protected selectedCountry?: CountryInfo;
    protected placeholder: string;
    protected readonly countryFocused: _angular_core.WritableSignal<boolean>;
    protected open: boolean;
    protected overlayWidth: number;
    protected readonly disabled: _angular_core.Signal<boolean>;
    protected readonly countryList: _angular_core.Signal<SelectOption<CountryInfo>[]>;
    protected readonly icons: Record<"elementDown2", string>;
    private readonly allowedCountries;
    private readonly disabledNgControl;
    private isValidNumber;
    private phoneNumber?;
    private onChange;
    private onTouched;
    ngOnChanges(changes: SimpleChanges<this>): void;
    /** @internal */
    writeValue(value: string | undefined): void;
    /** @internal */
    registerOnChange(fn: any): void;
    /** @internal */
    registerOnTouched(fn: () => void): void;
    /** @internal */
    setDisabledState(isDisabled: boolean): void;
    /** @internal */
    validate(control: AbstractControl): ValidationErrors | null;
    protected input(): void;
    protected blur(): void;
    protected countryInput(num: CountryInfo): void;
    protected openOverlay(): void;
    protected overlayDetach(): void;
    private writeCountry;
    private getCountryName;
    private updatePlaceholder;
    private parseNumber;
    /**
     * PhoneUtil does not resolve country code early enough when the national prefix is shared among other countries (+1 and +44).
     * This Method fakes a complete number to force PhoneUtil returning a proper region code.
     */
    private getRegionCode;
    private formatPhoneNumber;
    private handleChange;
    private writeTextToInput;
    /**
     * Format and update input text or clear input text if the input value is undefined.
     */
    private writeValueToInput;
    private refreshValueAfterCountryChange;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiPhoneNumberInputComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiPhoneNumberInputComponent, "si-phone-number-input", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "country": { "alias": "country"; "required": false; "isSignal": true; }; "defaultCountry": { "alias": "defaultCountry"; "required": false; "isSignal": true; }; "placeholderForSearch": { "alias": "placeholderForSearch"; "required": false; "isSignal": true; }; "searchNoResultsFoundLabel": { "alias": "searchNoResultsFoundLabel"; "required": false; "isSignal": true; }; "selectCountryAriaLabel": { "alias": "selectCountryAriaLabel"; "required": false; "isSignal": true; }; "phoneNumberAriaLabel": { "alias": "phoneNumberAriaLabel"; "required": false; "isSignal": true; }; "supportedCountries": { "alias": "supportedCountries"; "required": false; "isSignal": true; }; "labelledby": { "alias": "labelledby"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "errormessageId": { "alias": "errormessageId"; "required": false; "isSignal": true; }; }, { "country": "countryChange"; "valueChange": "valueChange"; }, never, never, true, never>;
}

declare class SiPhoneNumberInputModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiPhoneNumberInputModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiPhoneNumberInputModule, never, [typeof SiPhoneNumberInputComponent], [typeof SiPhoneNumberInputComponent]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiPhoneNumberInputModule>;
}

export { SiPhoneNumberInputComponent, SiPhoneNumberInputModule };
export type { CountryInfo, PhoneDetails, PhoneNumberModel };
