IModuleLoader.cs 554 B

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