jiti.d.ts 741 B

12345678910111213141516171819
  1. /// <reference types="node" />
  2. import { Module } from "module";
  3. import { TransformOptions, JITIOptions } from "./types";
  4. export type { JITIOptions, TransformOptions } from "./types";
  5. type Require = typeof require;
  6. type Module = typeof module;
  7. type ModuleCache = Record<string, Module>;
  8. export type EvalModuleOptions = Partial<{
  9. id: string;
  10. filename: string;
  11. ext: string;
  12. cache: ModuleCache;
  13. }>;
  14. export interface JITI extends Require {
  15. transform: (opts: TransformOptions) => string;
  16. register: () => () => void;
  17. evalModule: (source: string, options?: EvalModuleOptions) => unknown;
  18. }
  19. export default function createJITI(_filename: string, opts?: JITIOptions, parentModule?: Module, parentCache?: ModuleCache): JITI;