/**
 @license
Copyright 2018 The Advanced REST client authors <arc@mulesoft.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
*/
import { TemplateResult } from 'lit';
import { StyleInfo } from 'lit/directives/style-map.js';
import type { IUrl } from '@api-client/core/models/Url.js';
import ApiElement from '../ApiElement.js';
import type UiList from '../../md/list/internals/List.js';
import '../../md/listbox/ui-listbox.js';
import '../../md/list/ui-list-item.js';
import '../../md/divider/ui-divider.js';
/**
 * The request URL editor
 *
 * The element renders an editor for a HTTP request editor.
 *
 * @fires change - When the value change through user interaction. This event does not bubble.
 * @fires requeststateurlchange - When the value change through user interaction. This even bubbles and is cancelable.
 * @fires requestsend - A bubbling event when the user pressed Enter to send the request.
 */
export default class UrlInput extends ApiElement {
    /**
     * The current URL value.
     * @attribute
     */
    accessor value: string;
    /**
     * When set the editor is in read only mode.
     * @attribute
     */
    accessor readOnly: boolean;
    /**
     * Whether the URL suggestions are rendered.
     */
    protected accessor suggestionsOpened: boolean;
    protected accessor suggestions: IUrl[] | undefined;
    protected accessor renderedSuggestions: IUrl[] | undefined;
    protected previousValue?: string;
    protected isFocused: boolean;
    protected accessor input: HTMLInputElement;
    protected accessor suggestionsContainer: HTMLDivElement;
    protected accessor suggestionsList: UiList;
    /**
     * Computed positioning styles for the suggestion box.
     */
    protected suggestionStyles?: StyleInfo;
    constructor();
    connectedCallback(): void;
    disconnectedCallback(): void;
    /**
     * A handler that is called on input
     */
    notifyChange(): void;
    /**
     * A handler for the `url-value-changed` event.
     * If this element is not the source of the event then it will update the `value` property.
     * It's to be used besides the Polymer's data binding system.
     */
    protected handleUrlChange(e: Event): void;
    /**
     * Queries the data model for history data and sets the suggestions
     * @param q User query from the input field
     */
    protected readAutocomplete(q: string): Promise<void>;
    /**
     * Validates the element.
     */
    checkValidity(): boolean;
    /**
     * @param e A handler for either main input or the details editor value change
     */
    protected handleInput(e: Event): void;
    protected handleInputChange(): void;
    protected handlerFocusBlur(e: Event): void;
    /**
     * Triggers URL suggestions rendering.
     * If there are suggestions to render this will enable the dropdown.
     */
    renderSuggestions(): Promise<void>;
    /**
     * Performs the query on the current suggestions and, if any, renders them.
     */
    protected filterSuggestions(): Promise<void>;
    protected toggleSuggestions(opened: boolean): void;
    protected handleSuggestionClick(e: Event): void;
    protected handleSuggestionSelect(e: CustomEvent): void;
    protected selectSuggestion(key: string): void;
    /**
     * Removes all stored history URLs.
     */
    protected clearSuggestionsHandler(e: Event): void;
    protected handleHistoryDeleted(e: Event): void;
    protected handleHistoryClear(): void;
    /**
     * We handle key events here as we never focus on the list.
     */
    protected handleKeydown(event: KeyboardEvent): void;
    render(): TemplateResult;
    /**
     * @returns A template for the main input element
     */
    protected renderInput(): TemplateResult;
    /**
     * @returns A template for the autocomplete element
     */
    protected renderAutocomplete(): TemplateResult;
    /**
     * @returns The template for the suggestions list.
     */
    protected renderSuggestionList(): TemplateResult[] | string;
    /**
     * @returns The template for an URL suggestion item.
     */
    protected renderSuggestionItem(item: IUrl): TemplateResult;
}
//# sourceMappingURL=UrlInput.d.ts.map