/**
* @class BasePlugin
* The base plugin.
* @memberof THING
*/
class BasePlugin {
/**
* The use of the "static" keyword means that the variable belongs to the class rather than to an instance of the class.
* @type {Boolean}
* @example
* let plug = new THING.BasePlugin()
* let ret = THING.BasePlugin.isBasePlugin;
* // @expect(ret == true)
*/
static isBasePlugin = true;
/**
* This is a constructor function.
* @constructor
*/
constructor() {
this.app = null;
this.camera = null;
this.url = null;
this.installed = false;
}
/**
* The function reInstall executes various callbacks related to uninstalling, installing,
* initializing, and before initializing.
* @param param - The parameter that is passed to the onInstall, onBeforeInit, and onInited methods.
* @private
*/
reInstall(param) {
if (this.onUninstall) {
this.onUninstall();
}
if (this.onInstall) {
this.onInstall(param);
}
if (this.onBeforeInit) {
this.onBeforeInit(param);
}
if (this.onInited) {
this.onInited(param);
}
}
resolveURL(url) {
if (this.url) {
return this.url._appendURL(url);
}
return url;
}
/**
* When plugin installation is complete.
* @callback onInstall
*/
/**
* When plugin uninstall complete.
* @callback onUninstall
*/
/**
* Before the plugin is initialized.
* @callback onBeforeInit
*/
/**
* When plugin initialization.
* @callback onInited
*/
/**
* When update.
* @callback onUpdate
*/
/**
* After the scene is loaded.
* @callback onLoaded
*/
/**
* Before level switching.
* @callback onBeforeChangeLevel
*/
/**
* After level switching.
* @callback onLevelChanged
*/
/**
* When application exit.
* @callback onAppQuit
*/
}
export {
BasePlugin
}