/**
@license
Copyright 2020 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, PropertyValues, nothing } from 'lit';
import { type IProperty } from '@api-client/core/models/Property.js';
import ApiElement from '../ApiElement.js';
import '../../md/icons/ui-icon.js';
import '../../md/icon-button/ui-icon-button.js';
import '../../md/switch/ui-switch.js';
/**
 * A body editor specializing in URL encoded data.
 */
export default class BodyUrlEncodedEditor extends ApiElement {
    /**
     * When set the editor is in read only mode.
     * @attribute
     */
    accessor readOnly: boolean;
    /**
     * When set all controls are disabled in the form
     * @attribute
     */
    accessor disabled: boolean;
    /**
     * When set it automatically encodes and decodes values.
     * @attribute
     */
    accessor autoEncode: boolean;
    /**
     * @attribute
     */
    accessor allowFormInfo: boolean | undefined;
    protected valueInternal: string;
    /**
     * The HTTP body.
     */
    get value(): string | undefined;
    set value(value: string | undefined);
    protected modelInternal: IProperty[];
    /**
     * Computed data model for the view.
     * Don't set both `value` and `model`. If the model exists then
     * set only it or otherwise the `value` setter override the model.
     */
    get model(): IProperty[];
    set model(value: IProperty[]);
    protected update(cp: PropertyValues<this>): void;
    /**
     * Removes all parameters.
     */
    clear(): void;
    /**
     * Removes a parameter from an index.
     */
    removeProperty(index: number): void;
    /**
     * Toggles enabled state of a parameter.
     */
    toggleProperty(index: number, enabled: boolean): void;
    /**
     * Updates name/value of a parameter on a specific index.
     */
    updateProperty(index: number, field: 'name' | 'value', value: string): void;
    addParameter(name?: string, value?: string): void;
    protected updateValue(): void;
    protected modelToValue(): string;
    /**
     * Called when the `value` property change. It generates the view model
     * for the editor.
     */
    protected setupModel(value: string): void;
    focusLast(): Promise<void>;
    /**
     * Encodes current parameters in the model, updated the value, and notifies the change
     */
    encodeParameters(): void;
    /**
     * Encodes current parameters in the model, updated the value, and notifies the change
     */
    decodeParameters(): void;
    protected handleAdd(): void;
    protected handleToggle(e: Event): void;
    protected handleRemove(e: Event): void;
    protected handleNameChange(e: Event): void;
    protected handleValueChange(e: Event): void;
    render(): TemplateResult;
    protected renderFormInfo(): TemplateResult | typeof nothing;
    protected renderEmptyMessage(): TemplateResult;
    protected renderParams(items: IProperty[]): TemplateResult;
    protected renderParam(item: IProperty, index: number): TemplateResult;
    protected renderToggleButton(item: IProperty, index: number): TemplateResult;
    protected renderDeleteParameter(index: number): TemplateResult;
    protected renderNameField(item: IProperty, index: number): TemplateResult;
    protected renderValueField(item: IProperty, index: number): TemplateResult;
}
//# sourceMappingURL=BodyUrlEncodedEditor.d.ts.map