abstractmoduleloader.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2009 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview An interface for module loading.
  16. *
  17. */
  18. goog.provide('goog.module.AbstractModuleLoader');
  19. /** @suppress {extraRequire} */
  20. goog.require('goog.module');
  21. goog.require('goog.module.ModuleInfo');
  22. /**
  23. * An interface that loads JavaScript modules.
  24. * @interface
  25. */
  26. goog.module.AbstractModuleLoader = function() {};
  27. /**
  28. * Loads a list of JavaScript modules.
  29. *
  30. * @param {Array<string>} ids The module ids in dependency order.
  31. * @param {Object} moduleInfoMap A mapping from module id to ModuleInfo object.
  32. * @param {function()?=} opt_successFn The callback if module loading is a
  33. * success.
  34. * @param {function(?number)?=} opt_errorFn The callback if module loading is an
  35. * error.
  36. * @param {function()?=} opt_timeoutFn The callback if module loading times out.
  37. * @param {boolean=} opt_forceReload Whether to bypass cache while loading the
  38. * module.
  39. */
  40. goog.module.AbstractModuleLoader.prototype.loadModules = function(
  41. ids, moduleInfoMap, opt_successFn, opt_errorFn, opt_timeoutFn,
  42. opt_forceReload) {};
  43. /**
  44. * Pre-fetches a JavaScript module.
  45. *
  46. * @param {string} id The module id.
  47. * @param {!goog.module.ModuleInfo} moduleInfo The module info.
  48. */
  49. goog.module.AbstractModuleLoader.prototype.prefetchModule = function(
  50. id, moduleInfo) {};