@govflanders/vl-widget-module
Advanced tools
Comparing version 1.1.7 to 1.1.9
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DefaultModuleManager=function(){function e(e,t){this.installedModules=[],this.installerPromises=[],this.moduleLoader=e,this.moduleRuntime=t}return e.prototype.getModuleLoader=function(){return this.moduleLoader},e.prototype.getModuleRuntime=function(){return this.moduleRuntime},e.prototype.install=function(e){var t=this,o=null;if("object"===(void 0===e?"undefined":_typeof(e))&&"function"==typeof e.install){var n=this.installedModules.indexOf(e);-1===n&&(n=this.installedModules.push(e)-1,this.installerPromises[n]=new Promise(function(o,n){e.install(t.getModuleRuntime()).then(function(){o(e)}).catch(n)})),o=this.installerPromises[n]}else o=Promise.resolve(e);return o},e.prototype.import=function(e){return this.getModuleLoader().import(e)},e.prototype.resolve=function(e){return this.getModuleLoader().resolve(e)},e}();exports.DefaultModuleManager=DefaultModuleManager; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DefaultModuleManager=function(){function e(e,t){this.installedModules=[],this.installerPromises=[],this.moduleLoader=e,this.moduleRuntime=t}return e.prototype.resolveModuleInstall=function(e){var t=null;return"object"===(void 0===e?"undefined":_typeof(e))&&("object"===_typeof(e.default)&&"function"==typeof e.default.install?t=e.default.install:"function"==typeof e.install&&(t=e.install)),t},e.prototype.getModuleLoader=function(){return this.moduleLoader},e.prototype.getModuleRuntime=function(){return this.moduleRuntime},e.prototype.install=function(e){var t=this,o=null,l=this.resolveModuleInstall(e);if(null!==l){var n=this.installedModules.indexOf(e);-1===n&&(n=this.installedModules.push(e)-1,this.installerPromises[n]=new Promise(function(o,n){Promise.resolve(l.call(e,t.getModuleRuntime())).then(function(){o(e)}).catch(n)})),o=this.installerPromises[n]}else o=Promise.resolve(e);return o},e.prototype.import=function(e){return this.getModuleLoader().import(e)},e.prototype.resolve=function(e){return this.getModuleLoader().resolve(e)},e}();exports.DefaultModuleManager=DefaultModuleManager; |
{ | ||
"name": "@govflanders/vl-widget-module", | ||
"version": "1.1.7", | ||
"version": "1.1.9", | ||
"license": "MIT", | ||
@@ -42,3 +42,3 @@ "contributors": [ | ||
}, | ||
"gitHead": "24e0ed9f996a58c2162b6f1e8389ed56ef5a17af" | ||
"gitHead": "0c58e5600a1a49bf9ac161e020c333cb94457be9" | ||
} |
import { ModuleLoader } from './loader'; | ||
import { ModuleRuntime } from './runtime'; | ||
import { ModuleInstallFunction } from './module'; | ||
/** | ||
@@ -56,2 +57,12 @@ * Interface which describes a module manager. | ||
/** | ||
* Resolve the module install function for given module object. | ||
* | ||
* @param {any} moduleObj | ||
* A module object which should be installed. | ||
* | ||
* @return {ModuleInstallFunction<ModuleRuntimeType>|null} | ||
* The resolved module install function if present, otherwise null. | ||
*/ | ||
protected resolveModuleInstall(moduleObj: any): ModuleInstallFunction<ModuleRuntimeType> | null; | ||
/** | ||
* Get the internal module loader. | ||
@@ -58,0 +69,0 @@ * |
import { ModuleRuntime } from './runtime'; | ||
/** | ||
* Interface which describes a module install function. | ||
*/ | ||
export interface ModuleInstallFunction<ModuleRuntimeType extends ModuleRuntime = ModuleRuntime> { | ||
(runtime: ModuleRuntimeType): Promise<any>; | ||
} | ||
/** | ||
* Interface which describes a module. | ||
@@ -4,0 +10,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11119
12
201