"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonToClipboard = exports.textToClipboard = void 0;
function textToClipboard(text, callback) {
    // console.log('textToClipboard', text)
    if (navigator.clipboard) {
        window.navigator.clipboard
            .writeText(text)
            .then(() => {
            callback();
        })
            .catch((err) => {
            callback(err.message);
        });
    }
    else {
        callback(undefined, 'Clipboard API not supported');
    }
}
exports.textToClipboard = textToClipboard;
const jsonToClipboard = (data, callback) => {
    const text = JSON.stringify(data);
    textToClipboard(text, callback);
};
exports.jsonToClipboard = jsonToClipboard;
//# sourceMappingURL=clipboard.js.map