const { clipboard } = require('electron');
exports.readText = () => {
    try {
		if (process.platform == 'darwin' || process.platform == 'win32') {
			return clipboard.readText();
		} else {
			return clipboard.readText("selection");
		}
	} catch (err) {
		return "";
	}
}
exports.writeText = (text) => {
    try {
		if (process.platform == 'darwin' || process.platform == 'win32') {
			clipboard.writeText(text)
		} else {
			clipboard.writeText(text, "selection")
		}
	} catch (err) {

	}
}
exports.readHTML = () => {
    try {
		if (process.platform == 'darwin' || process.platform == 'win32') {
            return clipboard.readHTML();
        } else {
            return clipboard.readHTML("selection");
        }
	} catch (err) {
		return "";
	}
}
exports.writeHTML = (text) => {
    try {
		if (process.platform == 'darwin' || process.platform == 'win32') {
			clipboard.writeHTML(text)
		} else {
			clipboard.writeHTML(text, "selection")
		}
	} catch (err) {

	}
}
exports.readRTF = () => {
    try {
		if (process.platform == 'darwin' || process.platform == 'win32') {
            return clipboard.readRTF();
        } else {
            return clipboard.readRTF("selection");
        }
	} catch (err) {

	}
}
exports.writeRTF = (text) => {
    try {
		if (process.platform == 'darwin' || process.platform == 'win32') {
			clipboard.writeRTF(text)
		} else {
			clipboard.writeRTF(text, "selection")
		}
	} catch (err) {

	}
}
