value-accessor.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { AfterViewInit, ElementRef, Injector, OnDestroy } from '@angular/core';
  2. import { ControlValueAccessor } from '@angular/forms';
  3. import * as i0 from "@angular/core";
  4. export declare class ValueAccessor implements ControlValueAccessor, AfterViewInit, OnDestroy {
  5. protected injector: Injector;
  6. protected elementRef: ElementRef;
  7. private onChange;
  8. private onTouched;
  9. protected lastValue: any;
  10. private statusChanges?;
  11. constructor(injector: Injector, elementRef: ElementRef);
  12. writeValue(value: any): void;
  13. /**
  14. * Notifies the ControlValueAccessor of a change in the value of the control.
  15. *
  16. * This is called by each of the ValueAccessor directives when we want to update
  17. * the status and validity of the form control. For example with text components this
  18. * is called when the ionInput event is fired. For select components this is called
  19. * when the ionChange event is fired.
  20. *
  21. * This also updates the Ionic form status classes on the element.
  22. *
  23. * @param el The component element.
  24. * @param value The new value of the control.
  25. */
  26. handleValueChange(el: HTMLElement, value: any): void;
  27. _handleBlurEvent(el: any): void;
  28. registerOnChange(fn: (value: any) => void): void;
  29. registerOnTouched(fn: () => void): void;
  30. setDisabledState(isDisabled: boolean): void;
  31. ngOnDestroy(): void;
  32. ngAfterViewInit(): void;
  33. static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessor, never>;
  34. static ɵdir: i0.ɵɵDirectiveDeclaration<ValueAccessor, never, never, {}, {}, never, never, false, never>;
  35. }
  36. export declare const setIonicClasses: (element: ElementRef) => void;