"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hljs = require("highlight.js");
const JSON5 = require("json5");
const message_1 = require("./message");
/**
 * MethodMessage is a method call to or from the iframe.
 */
class MethodMessage {
    constructor(kind, data) {
        this.kind = kind;
        this.data = data;
        this.id = `${this.kind}-${data.id}`;
        this.text = message_1.messageLine(data.method, data.params);
    }
    /**
     * @override
     */
    expansion() {
        const { value } = hljs.highlight('js', JSON5.stringify({
            type: 'method',
            method: this.data.method,
            params: this.data.params,
        }, null, 2));
        return `<pre><code class="hljs">${value}</pre></code>`;
    }
}
exports.MethodMessage = MethodMessage;
