|
|
@ -59,6 +59,38 @@ module.exports = (_options = {}) => { |
|
|
|
})) |
|
|
|
})) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const writeText = (path, text, jobId) => ( |
|
|
|
|
|
|
|
startJob(createJob({ |
|
|
|
|
|
|
|
id: jobId, |
|
|
|
|
|
|
|
action: 'FS', |
|
|
|
|
|
|
|
payload: { method: 'writeFile', args: [path, text] }, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const readText = (path, jobId) => ( |
|
|
|
|
|
|
|
startJob(createJob({ |
|
|
|
|
|
|
|
id: jobId, |
|
|
|
|
|
|
|
action: 'FS', |
|
|
|
|
|
|
|
payload: { method: 'readFile', args: [path, { encoding: 'utf8' }] }, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const removeText = (path, jobId) => ( |
|
|
|
|
|
|
|
startJob(createJob({ |
|
|
|
|
|
|
|
id: jobId, |
|
|
|
|
|
|
|
action: 'FS', |
|
|
|
|
|
|
|
payload: { method: 'unlink', args: [path] }, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FS = (method, args, jobId) => ( |
|
|
|
|
|
|
|
startJob(createJob({ |
|
|
|
|
|
|
|
id: jobId, |
|
|
|
|
|
|
|
action: 'FS', |
|
|
|
|
|
|
|
payload: { method, args }, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const loadLanguage = (langs = 'eng', jobId) => ( |
|
|
|
const loadLanguage = (langs = 'eng', jobId) => ( |
|
|
|
startJob(createJob({ |
|
|
|
startJob(createJob({ |
|
|
|
id: jobId, |
|
|
|
id: jobId, |
|
|
@ -151,6 +183,10 @@ module.exports = (_options = {}) => { |
|
|
|
setResolve, |
|
|
|
setResolve, |
|
|
|
setReject, |
|
|
|
setReject, |
|
|
|
load, |
|
|
|
load, |
|
|
|
|
|
|
|
writeText, |
|
|
|
|
|
|
|
readText, |
|
|
|
|
|
|
|
removeText, |
|
|
|
|
|
|
|
FS, |
|
|
|
loadLanguage, |
|
|
|
loadLanguage, |
|
|
|
initialize, |
|
|
|
initialize, |
|
|
|
setParameters, |
|
|
|
setParameters, |
|
|
|