mirror of
https://github.com/laurent22/joplin.git
synced 2025-02-01 19:15:01 +02:00
Api: Added service to access resource external editing
This commit is contained in:
parent
089d6a5c9e
commit
d25fa796c0
@ -73,6 +73,20 @@ export default class ResourceEditWatcher {
|
||||
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) {
|
||||
if (!this.chokidar_) return;
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
import ResourceEditWatcher from 'lib/services/ResourceEditWatcher/index';
|
||||
const ExternalEditWatcher = require('lib/services/ExternalEditWatcher');
|
||||
|
||||
export default {
|
||||
|
||||
externalEditWatcher: () => ExternalEditWatcher.instance().externalApi(),
|
||||
resourceEditWatcher: () => ResourceEditWatcher.instance().externalApi(),
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user