/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { OnDestroy, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, NgControl, ValidationErrors, Validator } from '@angular/forms';
import { TranslationService } from '@vcd/i18n';
import { SelectOption } from '../../common/interfaces';
import { SubscriptionTracker } from '../../common/subscription';
import { Unit } from '../../utils/unit/unit';
import { UnitFormatter } from '../../utils/unit/unit-formatter';
import { BaseFormControl } from '../base-form-control';
import { FormSelectComponent } from '../form-select/form-select.component';
/**
 * Directive for adding min, max inputs to {@link NumberWithUnitFormInputComponent} and also add min, max validators to
 * the list of {@link NumberWithUnitFormInputComponent.formControl} validators
 */
export declare class MinMaxValidator implements Validator {
    min: number;
    max: number;
    validate(control: AbstractControl): ValidationErrors | null;
}
/**
 * -1 is the number to specify a value of unlimited.
 */
export declare const UNLIMITED = -1;
/**
 * A numerical form input component with unit selection and unlimited checkbox.
 * It doesn't take custom validation because it serve a specific use case.
 */
export declare class NumberWithUnitFormInputComponent extends BaseFormControl implements OnInit, OnDestroy {
    private fb;
    private translationService;
    private unitFormattter;
    unitDropdown: FormSelectComponent;
    tracker: SubscriptionTracker;
    /**
     * Show the Unlimited checkbox
     */
    showUnlimitedOption: boolean;
    /**
     * List of available units
     */
    set unitOptions(unitOptions: Unit[]);
    get unitOptions(): Unit[];
    /**
     * Input 'placeholder' field.
     */
    placeholder: string;
    /**
     * The value when the component is set to unlimited.
     */
    unlimitedValue: number;
    /**
     * Minimum value allowed.
     * (This is an input specified in the component attribute.)
     */
    min: number;
    /**
     * Maximum value allowed.
     * (This is an input specified in the component attribute.)
     */
    max: number;
    /**
     * Input 'size' field.
     */
    size: number;
    /**
     * Maximum number of characters (in UTF-16 code units) that the user can enter.
     */
    maxlength: number;
    /**
     * The direction for displaying the hint
     */
    hintPosition: string;
    /**
     * Hint to display in the content of a signpost
     */
    hint: string;
    /**
     * The unit of FormControl.value. Not required when a single {@link unitOptions} is passed in
     */
    inputValueUnit: Unit;
    formGroup: FormGroup;
    private _unitOptions;
    /**
     * A drop down of available units
     *
     * This list is constructed from list of
     * available units in _unitOptions
     */
    comboOptions: SelectOption[];
    /**
     * Map of SelectOption and Unit which is used to
     * extract Unit for a given SelectOption.
     *
     */
    private comboOptionUnitMap;
    private bestValue;
    private bestUnit;
    constructor(controlDirective: NgControl, fb: FormBuilder, translationService: TranslationService, unitFormattter: UnitFormatter);
    ngOnInit(): void;
    writeValue(value: number): void;
    private computeBestUnitAndValue;
    private value;
    private updateUiDisabledState;
    get displayValue(): string;
    /**
     * Set the unit in the dropdown.
     * @param value Should be one of the value that you pass in {@link #unitOptions} to select the Unit.
     */
    set selectedUnit(value: number);
    ngOnDestroy(): void;
    setDisabledState(isDisabled: boolean): void;
}
