module-info.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. export declare type ModuleType = "esm" | "cjs";
  2. /**
  3. * Information that discribes a module to be imported.
  4. */
  5. export declare type ModuleInfo = {
  6. /**
  7. * Global variable name with which the import statements of the module
  8. * should be replaced.
  9. */
  10. varName: string;
  11. /**
  12. * Type (either `"esm"` or `"cjs"`) that determines the internal behavior of
  13. * this plugin. Defaults to `"esm"`.
  14. */
  15. type?: ModuleType;
  16. /**
  17. * Names of variables that are exported from the module and may be imported
  18. * from another module.
  19. * No effect if `type` is `"cjs"`.
  20. */
  21. namedExports?: readonly string[];
  22. /**
  23. * Set to `false` to prevent emitting code for default import/export
  24. * (which you won't need to unless you are finicky).
  25. * Defaults to `true`. No effect if `type` is `"cjs"`.
  26. */
  27. defaultExport?: boolean;
  28. };
  29. export declare type NormalizedModuleInfo = {
  30. varName: string;
  31. type: ModuleType;
  32. namedExports: readonly string[] | null;
  33. defaultExport: boolean;
  34. };
  35. export declare const normalizeModuleInfo: (
  36. value: string | ModuleInfo
  37. ) => NormalizedModuleInfo;
  38. //# sourceMappingURL=module-info.d.ts.map