import { AbstractControl } from '@angular/forms'; import { Destroyable, IDestroyable, Observer, Snapshot } from '@marcura/dadesk-ui-common'; import { Observable, Observer as RxObserver, Subscription } from 'rxjs'; export declare abstract class AbstractControlWrapper extends Destroyable { /** * The native Angular form control that this form class is based on */ readonly ngControl: T; readonly observer: Observer; private readonly _isDisabled; get isDisabled$(): Snapshot; private readonly _isEnabled; get isEnabled$(): Snapshot; private readonly _isValid; get isValid$(): Snapshot; private readonly _isInvalid; get isInvalid$(): Snapshot; private readonly _isPending; get isPending$(): Snapshot; constructor( /** * The native Angular form control that this form class is based on */ ngControl: T); /** * Adds a destroyable object to the list of destroyables, to be destroyed when the `destroy` method is called. * It's an alias for calling `this.observer.add(destroyable)`. * * @param destroyable - The destroyable object to add. * @returns The added destroyable object. * @throws {Error} If the destroyable object is already added. */ addDestroyable(destroyable: TDestroyable): TDestroyable; /** * Destroys the object, internal observer and all registered destroyable objects. */ destroy(): void; /** * Listens to an observable and unsubscribes when the form is destroyed. */ listen(observable: Observable, observer?: Partial> | ((value: TValue) => void)): Subscription; /** * Unsubscribes a previously registered subscription in internal observer. */ unlisten(subscription: Subscription): void; }