import * as lit from 'lit'; import { LitElement, TemplateResult, PropertyValues } from 'lit'; interface Address { id?: number; display_address?: string; startsub?: string; ErrorString?: string; displayHash?: string; url_address?: string; latlng?: string; sub?: number; nsubs?: number; hash?: string; street?: string; city?: string; state?: string; zipcode?: string; zipcodePrimary?: string; zipcodeSecondary?: string; validator: "melissa" | "attom"; lat?: string; lng?: string; subUnits?: Address[]; signedAddress?: string; unit?: string; unitNumber?: string; fullUnit?: string; deliveryLine?: string; } interface AddressContext { setAddress: (address: Address) => void; setShowDropdown: (value: boolean) => void; /** * Opens the dropdown to show previous search results * This is specifically used when the user clicks on the input * after having closed the dropdown */ reopenDropdownWithResults: () => void; /** * Checks if there are search results available * to be shown when reopening the dropdown */ hasSearchResults: () => boolean; } declare class HvsInputIcon extends LitElement { isLoading: boolean; searchIcon?: string; protected render(): lit.TemplateResult<1>; static styles: lit.CSSResult; } declare global { interface HTMLElementTagNameMap { "hvs-input-icon": HvsInputIcon; } } declare class HvsInput extends LitElement { isLoading: boolean; value?: string; onChange: (value: string) => void; searchIcon?: string; placeholder?: string; input: HTMLInputElement; constructor(); protected render(): lit.TemplateResult<1>; static styles: lit.CSSResult; } declare global { interface HTMLElementTagNameMap { "hvs-input": HvsInput; } } declare class HvsAlertIcon extends LitElement { protected render(): lit.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { "hvs-alert-icon": HvsAlertIcon; } } declare class HvsBuildingIcon extends LitElement { protected render(): lit.TemplateResult<1>; static styles: lit.CSSResult; } declare global { interface HTMLElementTagNameMap { "hvs-building-icon": HvsBuildingIcon; } } declare class HvsArrowRightIcon extends LitElement { protected render(): lit.TemplateResult<1>; static styles: lit.CSSResult; } declare global { interface HTMLElementTagNameMap { "hvs-arrow-right-icon": HvsArrowRightIcon; } } declare class HvsDropdownMenu extends LitElement { addresses: Address[]; isLoading: boolean; isOpen: boolean; noResultsMessage?: string; source?: string; userName?: string; contactID?: string; contactFirstName?: string; contactLastName?: string; contactEmail?: string; reportURL?: string; newWindow?: boolean; address: string; selectedAddress?: Address; isMobile: number; hasAgentDetails: number; protocol: string; redirectUser: string; shouldStoreAddress: boolean; selectedClusterHash?: string; highlightedIndex: number; adressProvider?: AddressContext; value?: string; onChange: (value: string) => void; searchIcon?: string; placeholder?: string; apiKey?: string; private autocomplete; input: HTMLInputElement; constructor(); /** * Handles input click to reopen the dropdown with previous search results * This uses the dedicated context method for this specific purpose */ private handleInputClick; connectedCallback(): void; private storeAddress; private generateSignedLink; /** * Decrypts a signed address and stores it in localStorage * @param address The address to store * @returns A promise that resolves when the address is stored */ private setLocalStorageAddress; /** * Handles address selection, with special handling for building clusters * @param address The selected address */ private onSelectedAddressHandler; private getReportURL; /** * Changes the currently highlighted item in the dropdown * @param direction The direction to move (1 for down, -1 for up) * @param config Optional configuration for skipping items */ changeHighlight(direction: number, config?: { decrement?: number; increment?: number; }): void; private scrollHighlightedItemIntoView; /** * Finds the end index of a cluster in the address list * @param startIndex The index to start looking from * @param startsub The cluster hash to match * @returns The index of the last item in the cluster */ private findLastClusterItemIndex; /** * Finds the parent cluster item for a subunit * @param hash The hash of the subunit's parent cluster * @returns The index of the parent cluster item, or -1 if not found */ private findParentClusterIndex; /** * Handles arrow down keyboard navigation with special handling for building clusters */ handleArrowDown(): void; /** * Handles arrow up keyboard navigation with special handling for building clusters */ handleArrowUp(): void; /** * Determines if an address item can be skipped during keyboard navigation * @param index The index of the item to check * @returns True if the item can be skipped */ canSkipIndex(index: number): boolean; /** * Handles keyboard events for dropdown navigation * @param event The keyboard event */ handleKeydown(event: KeyboardEvent): void; /** * Handles Enter key press on the dropdown */ private handleEnterKey; /** * Determines if an address is a building cluster with multiple units * @param address The address to check * @returns True if the address is a building cluster with multiple units */ private isBuildingCluster; /** * Toggles the visibility of units within a building cluster * @param clusterHash The hash of the cluster to toggle */ private toggleClusterVisibility; /** * Handles item selection from the dropdown * @param item The selected address item */ selectItem(item: Address): void; private constructUsername; private constructQueryParams; /** * Renders animated skeleton loaders while data is being fetched * @returns Template with animated skeleton loaders */ renderSkeleton(): TemplateResult<1>; /** * Creates a highlighted display of an address with query matching * @param displayAddress The full address to display * @returns HTML template with highlighting */ private createHighlightedAddress; /** * Renders address content based on whether it should be a link or plain text * @param address The address to render * @param link Optional link data for the address * @returns HTML template for the address content */ private renderAddressContent; /** * Renders the content of an address item in the dropdown * @param address The address to render * @returns HTML template for the address item content */ renderAddressItemContent(address: Address): TemplateResult; renderAddresses(): TemplateResult<1> | null; private handlingClusterClick; /** * Handles document clicks to determine if the dropdown should be closed * @param event The click event */ private handleDocumentClick; protected firstUpdated(): void; disconnectedCallback(): void; protected updated(changedProperties: Map): void; protected render(): TemplateResult<1>; static styles: lit.CSSResult; } declare global { interface HTMLElementTagNameMap { "hvs-dropdown-menu": HvsDropdownMenu; } } declare class HvsWidget extends LitElement { apikey: string; apiURL?: string; reportUrl?: string; states?: string; preferredStates?: string; limit?: string; noResultsMessage?: string; source?: string; userName?: string; contactID?: string; contactFirstName?: string; contactLastName?: string; contactEmail?: string; newWindow?: boolean; searchIcon?: string; placeholder?: string; isMobile: number; hasAgentDetails: number; protocol: string; redirectUser: string; shouldStoreAddress: boolean; value?: string; country: string; environment: "production" | "staging"; query: string; selectedAddress?: Address; showDropdown: boolean; /** * Tracks whether the user has interacted with the input * after the dropdown was closed */ private userWantsToReopenDropdown; addressProvider: AddressContext; private autocomplete; debounceInputHandler: (...args: unknown[]) => void; onInputChanged(value: string): Promise; firstUpdated(): void; protected updated(_changedProperties: PropertyValues): void; render(): lit.TemplateResult<1>; static styles: lit.CSSResult; } declare global { interface HTMLElementTagNameMap { "hvs-widget": HvsWidget; } } export { HvsWidget as default };