"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.webClipboard = webClipboard;
const APINotImplementedError_1 = require("../../../../exception/APINotImplementedError");
function webClipboard(window, opt) {
    const { navigator } = window;
    const read = async () => {
        if (navigator.clipboard && navigator.clipboard.read) {
            const data = await navigator.clipboard.read();
            return data;
        }
        throw new APINotImplementedError_1.APINotSupportedError('Clipboar Read');
    };
    const readText = async () => {
        if (navigator.clipboard && navigator.clipboard.readText) {
            const text = await navigator.clipboard.readText();
            return text;
        }
        throw new APINotImplementedError_1.APINotSupportedError('Clipboar Read Text');
    };
    const writeText = async (text) => {
        if (navigator.clipboard && navigator.clipboard.writeText) {
            await navigator.clipboard.writeText(text);
        }
        else {
            throw new APINotImplementedError_1.APINotSupportedError('Clipboard Write Text');
        }
    };
    const clipboard = {
        read,
        readText,
        writeText,
    };
    return clipboard;
}
//# sourceMappingURL=clipboard.js.map