globals-module-info.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. declare type ModuleType = "esm" | "cjs";
  2. /**
  3. * Information that discribes a module to be imported.
  4. */
  5. 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. declare const globalsModuleInfoMap: Required<Record<"react" | "react-dom" | "@storybook/components" | "@storybook/channels" | "@storybook/core-events" | "@storybook/router" | "@storybook/theming" | "@storybook/api" | "@storybook/manager-api" | "@storybook/addons" | "@storybook/client-logger" | "@storybook/types", Required<ModuleInfo>>>;
  30. export { globalsModuleInfoMap };