@mobilelivenpm/fds-angular-qa
Version:
This library was generated with [Nx](https://nx.dev).
38 lines (37 loc) • 1.59 kB
TypeScript
import { Observable } from 'rxjs';
import { NgControl } from '@angular/forms';
/** An interface which allows a control to work inside of a `MatFormField`. */
export declare abstract class FdsFormFieldControl<T> {
/** The value of the control. */
value: T | null;
/**
* Stream that emits whenever the state of the control changes such that the parent `MatFormField`
* needs to run change detection.
*/
readonly stateChanges: Observable<void>;
/** The element ID for this control. */
readonly id: string;
/** Gets the NgControl for this control. */
readonly ngControl: NgControl | null;
/** Whether the control is required. */
readonly required: boolean;
/** Whether the control is disabled. */
readonly disabled: boolean;
/** Whether the control is in an error state. */
readonly errorState: boolean;
/**
* An optional name for the control type that can be used to distinguish `mat-form-field` elements
* based on their control type. The form field will add a class,
* `mat-form-field-type-{{controlType}}` to its root element.
*/
readonly controlType?: string;
/**
* Value of `aria-describedby` that should be merged with the described-by ids
* which are set by the form-field.
*/
readonly userAriaDescribedBy?: string;
/** Sets the list of element IDs that currently describe this control. */
abstract setDescribedByIds(ids: string[]): void;
/** Get additional classes for this control. Needs in case of fds-autocomplete */
abstract getClasses?(): any;
}