import { LitElement, TemplateResult, PropertyValues } from 'lit';
import { type DeserializedPayload, type Payload } from '@api-client/core/lib/transformers/PayloadSerializer.js';
import 'prismjs/prism.js';
import 'prismjs/components/prism-json.js';
import 'prismjs/components/prism-javascript.js';
import 'prismjs/components/prism-markdown.js';
import 'prismjs/components/prism-markup.js';
import 'prismjs/components/prism-yaml.js';
import 'prismjs/components/prism-xml-doc.js';
import 'prismjs/components/prism-http.js';
import 'prismjs/plugins/line-numbers/prism-line-numbers.min.js';
declare enum BodyType {
    nil = 0,
    String = 1,
    Blob = 2,
    File = 3,
    FormData = 4,
    Buffer = 5
}
declare enum ViewType {
    Parsed = 0,
    ImageSvg = 1,
    ImageBinary = 2,
    ImageError = 3,
    Pdf = 4,
    Binary = 5,
    UrlEncoded = 6
}
/**
 * Renders the view of the payload message.
 */
export default class LogBody extends LitElement {
    /**
     * The payload to render. When the payload requires de-serialization it will be performed.
     */
    accessor payload: DeserializedPayload | Payload | undefined;
    /**
     * The content type of the payload.
     * @attribute
     */
    accessor contentType: string | undefined;
    /**
     * When set it does not apply formatting for the code. However, it keeps the highlighting.
     * @attribute
     */
    accessor raw: boolean;
    protected accessor renderBody: DeserializedPayload | undefined;
    protected accessor bodyType: BodyType;
    protected accessor viewType: ViewType;
    /**
     * The tokens rendered in the view.
     */
    protected accessor renderTokens: string | undefined;
    willUpdate(cp: PropertyValues<this>): void;
    updated(cp: PropertyValues): void;
    /**
     * When processing a payload from the request editor then the value can be any of the `DeserializedPayload` types.
     * However, when processing a response that came from the `CoreEngine` it is always a Buffer / ArrayBuffer
     * and the contents is determined by the content type.
     */
    protected prepareContent(): Promise<void>;
    protected typeFromType(type: unknown): BodyType;
    protected deserialize(value: Payload | DeserializedPayload): Promise<DeserializedPayload>;
    /**
     * Depending on the body type and the contentType, it prepares the tokens to be rendered in the view.
     */
    protected tokenize(): void;
    protected tokenizeStringContent(body: string, contentType?: string): string;
    protected formatBody(body: string, contentType?: string): string;
    protected tokenizeFormDataContent(body: FormData): string;
    protected tokenizeImageData(body: ArrayBuffer, contentType?: string): string | undefined;
    protected tokenizeBuffer(body: ArrayBuffer, contentType?: string): string | undefined;
    protected tokenizeFile(): string | undefined;
    protected prismComplete(): void;
    /**
     * A handler for the image error event.
     * This occurs when rendering an image via the img tag but the image URL is invalid.
     */
    protected handleImageError(): void;
    protected render(): TemplateResult;
    protected renderStringBody(): TemplateResult;
    protected renderBlobBody(body: Blob): TemplateResult;
    protected renderBufferBody(body: ArrayBuffer): TemplateResult;
    protected renderPdfBody(): TemplateResult;
    protected renderImageSvgBody(): TemplateResult;
    protected renderImageBinaryBody(): TemplateResult;
    protected renderImageError(): TemplateResult;
    protected renderNoData(label?: string): TemplateResult;
    protected renderError(message: string): TemplateResult;
    protected renderUrlEncodedBody(): TemplateResult;
}
export {};
//# sourceMappingURL=LogBody.d.ts.map