import { ElementRef, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core'; import { NgControl } from '@angular/forms'; import { Subscription } from 'rxjs'; import * as i0 from "@angular/core"; export declare class UsaCharacterCountDirective implements OnInit, OnDestroy { private element; private renderer2; private zone; private control; /** Directive's main input - max length of characters allowed */ usaCharacterCount: number; /** * Id to use for character count message text. Will be auto-generated if not passed in */ messageId: string; private readonly MESSAGE_CLASS; private readonly MESSAGE_INVALID_CLASS; /** * Subscription to form control's value changes if one exists * Allows us to unsubscribe during cleanup */ valueSubscription: Subscription; /** Reference to character count text being displayed to users */ characterCounterText: string; /** * Watch for resize event changes to the host element. We want to keep the character * counter's width attribute in line with host's width for resizable input */ private _inputResizeObserver; /** * Reference to character counter message element. This will be created during init if * one with provided messageId does not already exist as sibling. */ private _messageElement; constructor(element: ElementRef, renderer2: Renderer2, zone: NgZone, control: NgControl); ngOnInit(): void; ngOnDestroy(): void; /** Gets reference to span element that will be used to display character counter text. If one does not exists, it will be created * and attached as sibling to host form element */ private getMessageElement; private inputEventHandler; /** * Sets character counter message based on current number of characters. * The message is appended as sibling element to the element this character count directive * is attached through reference of shared parent element. * @param currentLength */ private setCharacterCountText; /** * Follows logic from USWDS' character counter's JS file so that messaging is consistent * @param currentLength * @param maxLength * @returns - string message to display based on current characters and max characters allowed */ private generateCharacterCounterText; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }