1
0
mirror of https://github.com/Lightcord/Lightcord.git synced 2025-04-12 00:55:40 +02:00
2020-09-05 13:50:45 -07:00

25 lines
978 B
JavaScript

// [adill] This is not context aware and, as such, won't load in newer Electron versions
// We can and should strip `discord_spellcheck` down to CLD only once all channels are on Electron 9
function getLegacySpellchecker() {
const Spellchecker = require('spellchecker').Spellchecker;
const instance = new Spellchecker();
return {
setDictionary: instance.setDictionary.bind(instance),
getAvailableDictionaries: instance.getAvailableDictionaries.bind(instance),
isMisspelled: instance.isMisspelled.bind(instance),
getCorrectionsForMisspelling: instance.getCorrectionsForMisspelling.bind(instance),
};
}
// [adill] This is not context aware and, as such, won't load in newer Electron versions
// We can and should strip `discord_spellcheck` down to CLD only once all channels are on Electron 9
function getKeyboardLayout() {
return require('keyboard-layout');
}
module.exports = {
cld: require('cld'),
getLegacySpellchecker,
getKeyboardLayout,
};