/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 *
 * Adapted and influenced from [Material Web](https://github.com/material-components/material-web).
 * The original source code can be found at: [GitHub](https://github.com/material-components/material-web/blob/main/labs/behaviors/form-associated.ts)
 */
import { MixinBase, getFormState, getFormValue, getValidationMessage, inputType, internals, AbstractConstructor } from '../../../constants';
import { FormRestoreReason, FormRestoreState, FormValue, InputType, InputValidationProps } from '../../utils/form-utils';
import { IBaseComponent } from '../../base/base-component';
/**
 * A component that can be associated with a form.
 */
export interface IWithFormAssociation<TValue = FormValue | null> extends IBaseComponent {
    /**
     * The form element that the component is associated with.
     */
    readonly form: HTMLFormElement | null;
    /**
     * The labels associated with the component.
     */
    readonly labels: NodeList;
    /**
     * The HTML name to use in form submission.
     */
    name: string;
    disabled: boolean;
    /**
     * Whether or not the component is readonly.
     */
    readonly: boolean;
    /**
     * The internals of the component.
     */
    readonly [internals]: ElementInternals;
    /**
     * Sets the value type accepted by the component. This is used to set the type of the internal
     * input element and generate validation messages.
     */
    [inputType]: InputType;
    /**
     * Gets the validation message for the component.
     *
     * @param props Validation-affecting properties set on the component as well as the value of the
     * component.
     */
    [getValidationMessage](props: Partial<InputValidationProps>): string | undefined;
    /**
     * Gets the current form value of the component.
     */
    [getFormValue](): FormValue | null;
    /**
     * Gets the current form state of the component, defaulting to the component's `[formValue]`.
     *
     * Used when the component's state is different from its value, such as a checkboxes that have
     * both a boolean `checked` state and a string value.
     */
    [getFormState](): FormValue | null;
    /**
     * A callback for when the component should be enabled or disabled. This can be called when, for
     * example, the component is within a disabled fieldset.
     *
     * @param disabled Whether or not the component should be disabled.
     */
    formDisabledCallback(disabled: boolean): void;
    /**
     * A callback for when the form's value is to be reset.
     */
    formResetCallback(): void;
    /**
     * A callback for when a form restores the state of the component. For example, when a page is
     * reloaded or a form is autofilled.
     *
     * @param state The state to restore or null to reset the component's value.
     * @param reason The reason the state was restored.
     */
    formStateRestoreCallback(state: FormRestoreState | null, reason: FormRestoreReason): void;
    /**
     * An optional callback for when the associated form changes.
     *
     * @param form The new associated form or null if there is none.
     */
    formAssociatedCallback?(form: HTMLFormElement | null): void;
}
export declare abstract class WithFormAssociationContract {
    static readonly formAssociated: boolean;
    get form(): HTMLFormElement | null;
    get labels(): NodeList;
    get name(): string;
    set name(value: string);
    abstract get disabled(): boolean;
    abstract set disabled(value: boolean);
    abstract get readonly(): boolean;
    abstract set readonly(value: boolean);
    abstract get [internals](): ElementInternals;
    abstract [getFormValue](): FormValue | null;
    [getFormState](): FormValue | null;
    formDisabledCallback(disabled: boolean): void;
    abstract formStateRestoreCallback(state: FormRestoreState | null, reason: FormRestoreReason): void;
    abstract formResetCallback(): void;
    set [inputType](type: InputType);
    [getValidationMessage](props: Partial<InputValidationProps>): string | undefined;
}
/**
 * Mixes in form functionality into a base component.
 *
 * @param base The base component to mix into.
 * @returns The mixed-in base component.
 */
export declare function WithFormAssociation<TBase extends MixinBase>(base: TBase): AbstractConstructor<WithFormAssociationContract> & TBase;
