import { TemplateResult, nothing } from 'lit';
import { type IMultipartBody } from '@api-client/core/lib/transformers/PayloadSerializer.js';
import ApiElement from '../ApiElement.js';
import '../../md/icons/ui-icon.js';
import '../../md/switch/ui-switch.js';
import '../../md/icon-button/ui-icon-button.js';
import '../../md/button/ui-button.js';
export declare const hasFormDataSupport: boolean;
/**
 * Multipart payload editor.
 *
 * The element internally uses a generated from a FormData model. It is API Client's `IMultipartBody` array.
 * The FormData is generated on-fly when accessing the `value` getter. It also regenerates the model when
 * the `value` property change. Because of that you should never set the value on the editor but only manipulate the
 * `model` property.
 */
export default class BodyMultipartEditor 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;
    /**
     * @attribute
     */
    accessor allowFormInfo: boolean | undefined;
    /**
     * The value of this form.
     * When reading the `value` it generated the FormData from the model values.
     * When setting this property is regenerates the `model` to the value in the FormData.
     * When setting to anything other than the `FormData` it sets the `model` to an empty array.
     */
    get value(): FormData;
    set value(value: FormData);
    /**
     * The model used by the external application
     */
    protected modelInternal: IMultipartBody[];
    /**
     * 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(): IMultipartBody[];
    set model(value: IMultipartBody[] | undefined);
    /**
     * @returns The FormData from the current model.
     */
    toFormData(): FormData;
    /**
     * Makes an attempt to upgrade old definitions of the `IMultipartBody`.
     * If this fails, the form will show error instead of part field.
     * @param value The current model.
     */
    protected upgradeLegacy(value: IMultipartBody[]): Promise<void>;
    protected upgradeLegacyBlob(part: IMultipartBody): Promise<void>;
    protected upgradeLegacyFile(part: IMultipartBody): Promise<void>;
    protected updateModel(value?: unknown): Promise<void>;
    /**
     * Adds an instance of a file to the form data
     */
    addFile(file: File): Promise<void>;
    /**
     * Removes all parameters.
     */
    clear(): void;
    /**
     * Adds an empty text part item to the form.
     */
    addEmptyText(): void;
    /**
     * Adds an empty file part item to the form.
     */
    addEmptyFile(): void;
    /**
     * Removes a parameter from an index.
     */
    removeProperty(index: number): void;
    /**
     * Toggles enabled state of a parameter.
     */
    toggleProperty(index: number, enabled: boolean): void;
    updatePartName(index: number, value: string): void;
    updateTextPartValue(index: number, value: string): void;
    updateBlobPartValue(index: number, value: string): Promise<void>;
    updateFileValue(index: number, file: File): Promise<void>;
    changePartMime(index: number, value: string): Promise<void>;
    protected handleRemove(e: Event): void;
    protected handleToggle(e: Event): void;
    protected handleFilePick(e: Event): void;
    protected handleFilePartValue(e: Event): void;
    protected handleNameChange(e: Event): void;
    protected handleValueChange(e: Event): void;
    protected handleBlobValueChange(e: Event): void;
    protected handleMimeChange(e: Event): void;
    render(): TemplateResult;
    protected renderFormInfo(): TemplateResult | typeof nothing;
    protected renderList(): TemplateResult;
    protected renderNoSupport(): TemplateResult;
    protected renderEmptyMessage(): TemplateResult;
    protected renderParams(items: IMultipartBody[]): TemplateResult;
    protected renderToggleButton(part: IMultipartBody, index: number): TemplateResult;
    protected renderDeleteParameter(index: number): TemplateResult;
    protected renderNameField(part: IMultipartBody, index: number): TemplateResult;
    protected renderValueField(part: IMultipartBody, index: number): TemplateResult;
    protected renderBlobValueField(part: IMultipartBody, index: number): TemplateResult;
    protected renderMimeField(index: number, value?: string): TemplateResult;
    protected renderParam(part: IMultipartBody, index: number): TemplateResult;
    protected renderTextPart(part: IMultipartBody, index: number): TemplateResult;
    protected renderBlobPart(part: IMultipartBody, index: number): TemplateResult;
    protected renderFilePart(part: IMultipartBody, index: number): TemplateResult;
    protected renderFileField(part: IMultipartBody, index: number): TemplateResult;
    protected renderIncompatiblePart(index: number): TemplateResult;
    protected renderMimeList(): TemplateResult;
}
//# sourceMappingURL=BodyMultipartEditor.d.ts.map