esm.d.ts 712 B

123456789101112131415161718
  1. /// <reference types="node" />
  2. import { RegisterOptions } from './index';
  3. export declare function registerAndCreateEsmHooks(opts?: RegisterOptions): {
  4. resolve: (specifier: string, context: {
  5. parentURL: string;
  6. }, defaultResolve: any) => Promise<{
  7. url: string;
  8. }>;
  9. getFormat: (url: string, context: {}, defaultGetFormat: any) => Promise<{
  10. format: "module" | "json" | "builtin" | "commonjs" | "dynamic" | "wasm";
  11. }>;
  12. transformSource: (source: string | Buffer, context: {
  13. url: string;
  14. format: "module" | "json" | "builtin" | "commonjs" | "dynamic" | "wasm";
  15. }, defaultTransformSource: any) => Promise<{
  16. source: string | Buffer;
  17. }>;
  18. };