"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class TextToClipboard extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['text'],
            o: [],
        }, {}, system, _ids_1.ID_TEXT_TO_CLIPBOARD);
    }
    async f({ text }, done) {
        const { api: { clipboard: { writeText }, }, } = this.__system;
        try {
            await writeText(text);
        }
        catch (err) {
            done(undefined, err.message);
            return;
        }
        done();
    }
}
exports.default = TextToClipboard;
//# sourceMappingURL=index.js.map