get-module-build-info.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type { MiddlewareMatcher, RSCModuleType } from '../../analysis/get-page-static-info';
  2. import { webpack } from 'next/dist/compiled/webpack/webpack';
  3. /**
  4. * A getter for module build info that casts to the type it should have.
  5. * We also expose here types to make easier to use it.
  6. */
  7. export declare function getModuleBuildInfo(webpackModule: webpack.Module): {
  8. nextEdgeMiddleware?: EdgeMiddlewareMeta | undefined;
  9. nextEdgeApiFunction?: EdgeMiddlewareMeta | undefined;
  10. nextEdgeSSR?: EdgeSSRMeta | undefined;
  11. nextUsedEnvVars?: Set<string> | undefined;
  12. nextWasmMiddlewareBinding?: AssetBinding | undefined;
  13. nextAssetMiddlewareBinding?: AssetBinding | undefined;
  14. usingIndirectEval?: boolean | Set<string> | undefined;
  15. route?: RouteMeta | undefined;
  16. importLocByPath?: Map<string, any> | undefined;
  17. rootDir?: string | undefined;
  18. rsc?: RSCMeta | undefined;
  19. };
  20. export interface RSCMeta {
  21. type?: RSCModuleType;
  22. requests?: string[];
  23. }
  24. export interface RouteMeta {
  25. page: string;
  26. absolutePagePath: string;
  27. }
  28. export interface EdgeMiddlewareMeta {
  29. page: string;
  30. matchers?: MiddlewareMatcher[];
  31. }
  32. export interface EdgeSSRMeta {
  33. isServerComponent: boolean;
  34. isAppDir?: boolean;
  35. page: string;
  36. }
  37. export interface AssetBinding {
  38. filePath: string;
  39. name: string;
  40. }