2020-10-09 19:35:46 +02:00
|
|
|
import Plugin from '../Plugin';
|
|
|
|
import Joplin from './Joplin';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
2021-01-27 19:42:58 +02:00
|
|
|
// const builtinModules = require('builtin-modules');
|
2020-10-09 19:35:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ignore
|
|
|
|
*/
|
|
|
|
export default class Global {
|
|
|
|
|
|
|
|
private joplin_: Joplin;
|
|
|
|
|
2021-07-23 12:05:21 +02:00
|
|
|
public constructor(implementation: any, plugin: Plugin, store: any) {
|
2021-06-20 14:46:50 +02:00
|
|
|
this.joplin_ = new Joplin(implementation, plugin, store);
|
2020-10-09 19:35:46 +02:00
|
|
|
}
|
|
|
|
|
2021-07-23 12:05:21 +02:00
|
|
|
public get joplin(): Joplin {
|
2020-10-09 19:35:46 +02:00
|
|
|
return this.joplin_;
|
|
|
|
}
|
|
|
|
|
|
|
|
// To get webpack to work with Node module we need to set the parameter `target: "node"`, however
|
|
|
|
// when setting this, the code generated by webpack will try to access the `process` global variable,
|
|
|
|
// which won't be defined in the sandbox. So here we simply forward the variable, which makes it all work.
|
2021-07-23 12:05:21 +02:00
|
|
|
public get process(): any {
|
2020-10-09 19:35:46 +02:00
|
|
|
return process;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|