IModuleLoader.cs 533 B

12345678910111213141516171819
  1. using Esprima.Ast;
  2. namespace Jint.Runtime.Modules;
  3. /// <summary>
  4. /// Module loader interface that allows defining how module loadings requests are handled.
  5. /// </summary>
  6. public interface IModuleLoader
  7. {
  8. /// <summary>
  9. /// Resolves a specifier to a path or module
  10. /// </summary>
  11. ResolvedSpecifier Resolve(string? referencingModuleLocation, string specifier);
  12. /// <summary>
  13. /// Loads a module from given location.
  14. /// </summary>
  15. public Module LoadModule(Engine engine, ResolvedSpecifier resolved);
  16. }