import * as i0 from '@angular/core';
import { AfterViewInit, OnDestroy, ElementRef, EventEmitter, ChangeDetectorRef, Renderer2, InjectionToken } from '@angular/core';
import * as i1 from '@fundamental-ngx/core/content-density';
import { ContentDensityObserver } from '@fundamental-ngx/core/content-density';
import { DomPortal } from '@angular/cdk/portal';
import { ControlValueAccessor } from '@angular/forms';
import { FormStates } from '@fundamental-ngx/cdk/forms';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import { FormItemControl } from '@fundamental-ngx/core/form';

interface FdCheckboxValues {
    trueValue?: any;
    falseValue?: any;
    thirdStateValue?: any;
}
declare const FD_CHECKBOX_VALUES_DEFAULT: Readonly<FdCheckboxValues>;

type FdCheckboxTypes = 'checked' | 'unchecked' | 'indeterminate' | 'force-checked';
declare class CheckboxComponent<T = unknown> implements ControlValueAccessor, AfterViewInit, OnDestroy, FormItemControl {
    elementRef: ElementRef<Element>;
    tabIndexValue: number;
    private _changeDetectorRef;
    private renderer;
    readonly _contentDensityObserver: ContentDensityObserver;
    /** @hidden */
    inputElement: ElementRef<HTMLInputElement>;
    /** @hidden */
    labelElement: ElementRef;
    /** Whether input label should be wrapped */
    wrapLabel: boolean;
    /** Vertical position of the label compared to the checkbox box */
    valignLabel: 'top' | 'middle';
    /** Sets the `aria-label` attribute to the element. */
    ariaLabel: Nullable<string>;
    /**
     * Sets the `role` attribute to the element.
     * Default: checkbox
     */
    role: string;
    /** Current selection state of the checkbox component */
    set value(value: T);
    get value(): T;
    /** Sets the `aria-labelledby` attribute to the element. */
    ariaLabelledBy: Nullable<string>;
    /** Sets the `aria-describedby` attribute to the element. */
    ariaDescribedBy: Nullable<string>;
    /** sets checkbox tooltip */
    title: Nullable<string>;
    /** Sets [id] property of input, binds input with input label using [for] property. */
    inputId: string;
    /** State of control, changes visual appearance of control. */
    state?: FormStates | null;
    /** Sets [name] property of input. */
    name: string;
    /** Sets text of control label. */
    label: string;
    /** Allows to disable/enable control. */
    disabled: boolean;
    /** Disables editibility */
    readonly: boolean;
    /** Enables controls third state. */
    tristate: boolean;
    /** Allows to prevent user from manually selecting controls third state. */
    tristateSelectable: boolean;
    /** Assigns given class to checkbox label element */
    labelClass: string;
    /** If it is mandatory field */
    required: boolean;
    /** Whether the checkbox should be rendered in display-only mode. */
    displayOnly: boolean;
    /** Sets values returned by control. */
    set values(checkboxValues: FdCheckboxValues);
    get values(): FdCheckboxValues;
    /** Whether checkbox should be rendered standalone (without any text). */
    standalone: boolean;
    /** @hidden */
    readonly position = "relative";
    /** @hidden */
    readonly outline = "none";
    /** Emits event on focus change */
    focusChange: EventEmitter<boolean>;
    /** @hidden */
    private readonly _domPortalContent;
    /** @hidden */
    private readonly _portalOutlet;
    /** Stores current checkbox value. */
    checkboxValue: T;
    /** Stores current checkbox state. */
    checkboxState: FdCheckboxTypes;
    /** @hidden */
    _projectedContent: boolean;
    /** @hidden Used to define if control is in 'indeterminate' state.*/
    get isIndeterminate(): boolean;
    /** @hidden Used to define if control is in 'checked' / 'unchecked' state. */
    get isChecked(): boolean;
    /** @hidden */
    _domPortal: DomPortal<HTMLElement>;
    /** @hidden */
    protected get inputStateClasses(): string;
    /** @hidden */
    private _subscriptions;
    /** @hidden values returned by control. */
    private _values;
    /** @hidden */
    constructor(elementRef: ElementRef<Element>, tabIndexValue: number | undefined, _changeDetectorRef: ChangeDetectorRef, renderer: Renderer2, _contentDensityObserver: ContentDensityObserver);
    /** @hidden Reference to callback provided by FormControl.*/
    onTouched: () => void;
    /** @hidden Reference to callback provided by FormControl.*/
    onValueChange: (value: T) => void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /**
     * @hidden ControlValueAccessor interface
     * - sets new control value
     * - updates control state
     */
    writeValue(value: T): void;
    /** @hidden ControlValueAccessor interface method - sets onValueChange callback.*/
    registerOnChange(fn: (value: T) => void): void;
    /** @hidden ControlValueAccessor interface method - sets onTouched callback.*/
    registerOnTouched(fn: () => void): void;
    /** @hidden Called by FormControl - used to disable / enable control.*/
    setDisabledState(disabled: boolean): void;
    /** @hidden Called by FormControl - used to disable editablity.*/
    setReadOnlyState(readonly: boolean): void;
    /** @hidden */
    setStyleState(state: FormStates | null): void;
    /**
     * @hidden
     * Based on current control state:
     * - sets next control value
     * - emits new control value
     * - updates control state based on new control value
     * */
    nextValue(previousValue?: FdCheckboxTypes): void;
    /** @hidden handles blur event */
    _onBlur(): void;
    /** @hidden handles focus event */
    _onFocus(): void;
    /** @hidden handles click on the label associated with native checkbox input */
    _onLabelClick(event: MouseEvent): void;
    /**
     * @hidden
     * Event handler for cases when checkbox was toggled with the help of keyboard.
     * @param event
     */
    _onLabelKeydown(event: Event): void;
    /** @hidden handles click on the native checkbox input */
    _onInputClick(event: MouseEvent): void;
    /** @hidden */
    private _handleDisplayAndReadOnly;
    /** @hidden Based on current control value sets new control state. */
    private _setState;
    /** Method to trigger change detection in component */
    private _detectChanges;
    static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent<any>, [null, { attribute: "tabIndexValue"; }, null, null, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent<any>, "fd-checkbox", never, { "wrapLabel": { "alias": "wrapLabel"; "required": false; }; "valignLabel": { "alias": "valignLabel"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "role": { "alias": "role"; "required": false; }; "value": { "alias": "value"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; }; "title": { "alias": "title"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "state": { "alias": "state"; "required": false; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "tristate": { "alias": "tristate"; "required": false; }; "tristateSelectable": { "alias": "tristateSelectable"; "required": false; }; "labelClass": { "alias": "labelClass"; "required": false; }; "required": { "alias": "required"; "required": false; }; "displayOnly": { "alias": "displayOnly"; "required": false; }; "values": { "alias": "values"; "required": false; }; "standalone": { "alias": "standalone"; "required": false; }; }, { "focusChange": "focusChange"; }, never, ["*"], true, never>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class CheckboxModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<CheckboxModule, never, [typeof i1.ContentDensityModule, typeof CheckboxComponent], [typeof CheckboxComponent, typeof i1.ContentDensityModule]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<CheckboxModule>;
}

declare const FD_CHECKBOX_COMPONENT: InjectionToken<unknown>;

export { CheckboxComponent, CheckboxModule, FD_CHECKBOX_COMPONENT, FD_CHECKBOX_VALUES_DEFAULT };
export type { FdCheckboxTypes, FdCheckboxValues };
