/* eslint-disable multiline-comment-style */

import Plugin from '../Plugin';
import Joplin from './Joplin';

/**
 * @ignore
 */
// 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) {
		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;
	}

}
