You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Api: Added service to access resource external editing
This commit is contained in:
@ -73,6 +73,20 @@ export default class ResourceEditWatcher {
|
|||||||
return this.eventEmitter_.removeListener(eventName, callback);
|
return this.eventEmitter_.removeListener(eventName, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
externalApi() {
|
||||||
|
return {
|
||||||
|
openAndWatch: async ({ resourceId }:any) => {
|
||||||
|
return this.openAndWatch(resourceId);
|
||||||
|
},
|
||||||
|
stopWatching: async ({ resourceId }:any) => {
|
||||||
|
return this.stopWatching(resourceId);
|
||||||
|
},
|
||||||
|
isWatched: async ({ resourceId }:any) => {
|
||||||
|
return !!this.watchedItemByResourceId(resourceId);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private watch(fileToWatch:string) {
|
private watch(fileToWatch:string) {
|
||||||
if (!this.chokidar_) return;
|
if (!this.chokidar_) return;
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
import ResourceEditWatcher from 'lib/services/ResourceEditWatcher/index';
|
||||||
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
|
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
externalEditWatcher: () => ExternalEditWatcher.instance().externalApi(),
|
externalEditWatcher: () => ExternalEditWatcher.instance().externalApi(),
|
||||||
|
resourceEditWatcher: () => ResourceEditWatcher.instance().externalApi(),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user