1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/lib/services/plugins/api/Global.ts

36 lines
1017 B
TypeScript
Raw Normal View History

/* eslint-disable multiline-comment-style */
import Plugin from '../Plugin';
import Joplin from './Joplin';
/**
* @ignore
*/
2021-01-27 19:42:58 +02:00
// const builtinModules = require('builtin-modules');
/**
* @ignore
*/
export default class Global {
private joplin_: Joplin;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
public constructor(implementation: any, plugin: Plugin, store: any) {
2021-06-20 14:46:50 +02:00
this.joplin_ = new Joplin(implementation, plugin, store);
}
public get joplin(): Joplin {
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.
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
public get process(): any {
return process;
}
}