load-components.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import type { AppType, DocumentType, NextComponentType } from '../shared/lib/utils';
  2. import type { PageConfig, GetStaticPaths, GetServerSideProps, GetStaticProps } from 'next/types';
  3. import { BuildManifest } from './get-page-files';
  4. export declare type ManifestItem = {
  5. id: number | string;
  6. files: string[];
  7. };
  8. export declare type ReactLoadableManifest = {
  9. [moduleId: string]: ManifestItem;
  10. };
  11. export declare type LoadComponentsReturnType = {
  12. Component: NextComponentType;
  13. pageConfig: PageConfig;
  14. buildManifest: BuildManifest;
  15. subresourceIntegrityManifest?: Record<string, string>;
  16. reactLoadableManifest: ReactLoadableManifest;
  17. serverComponentManifest?: any;
  18. Document: DocumentType;
  19. App: AppType;
  20. getStaticProps?: GetStaticProps;
  21. getStaticPaths?: GetStaticPaths;
  22. getServerSideProps?: GetServerSideProps;
  23. ComponentMod: any;
  24. isAppPath?: boolean;
  25. pathname: string;
  26. };
  27. export declare function loadDefaultErrorComponents(distDir: string): Promise<{
  28. App: any;
  29. Document: any;
  30. Component: any;
  31. pageConfig: {};
  32. buildManifest: any;
  33. reactLoadableManifest: {};
  34. ComponentMod: any;
  35. pathname: string;
  36. }>;
  37. export declare function loadComponents({ distDir, pathname, serverless, hasServerComponents, isAppPath, }: {
  38. distDir: string;
  39. pathname: string;
  40. serverless: boolean;
  41. hasServerComponents: boolean;
  42. isAppPath: boolean;
  43. }): Promise<LoadComponentsReturnType>;