租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
910 B

3 months ago
  1. export class ModuleImporter {
  2. /**
  3. * Creates a new instance.
  4. * @param {string} [cwd] The current working directory to resolve from.
  5. */
  6. constructor(cwd?: string);
  7. /**
  8. * The base directory from which paths should be resolved.
  9. * @type {string}
  10. */
  11. cwd: string;
  12. /**
  13. * Resolves a module based on its name or location.
  14. * @param {string} specifier Either an npm package name or
  15. * relative file path.
  16. * @returns {string|undefined} The location of the import.
  17. * @throws {Error} If specifier cannot be located.
  18. */
  19. resolve(specifier: string): string | undefined;
  20. /**
  21. * Imports a module based on its name or location.
  22. * @param {string} specifier Either an npm package name or
  23. * relative file path.
  24. * @returns {Promise<object>} The module's object.
  25. */
  26. import(specifier: string): Promise<object>;
  27. }