1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

All: Add support for application plugins (#3257)

This commit is contained in:
Laurent
2020-10-09 18:35:46 +01:00
committed by GitHub
parent 833fb1264f
commit fe41d37f8f
804 changed files with 95622 additions and 5307 deletions

View File

@ -0,0 +1,35 @@
import { ExportContext } from '../plugins/api/types';
import InteropService_Exporter_Base from './InteropService_Exporter_Base';
import { ExportOptions, Module } from './types';
export default class InteropService_Exporter_Custom extends InteropService_Exporter_Base {
private customContext_:ExportContext;
private module_:Module = null;
constructor(module:Module) {
super();
this.module_ = module;
}
async init(destPath:string, options:ExportOptions) {
this.customContext_ = {
destPath: destPath,
options: options,
};
return this.module_.onInit(this.customContext_);
}
async processItem(itemType:number, item:any) {
return this.module_.onProcessItem(this.customContext_, itemType, item);
}
async processResource(resource:any, filePath:string) {
return this.module_.onProcessResource(this.customContext_, resource, filePath);
}
async close() {
return this.module_.onClose(this.customContext_);
}
}