UNPKG

1.82 kBTypeScriptView Raw
1import AmpHtmlValidator from 'next/dist/compiled/amphtml-validator';
2import 'next/dist/next-server/server/node-polyfill-fetch';
3import { FontManifest } from '../next-server/server/font-utils';
4interface AmpValidation {
5 page: string;
6 result: {
7 errors: AmpHtmlValidator.ValidationError[];
8 warnings: AmpHtmlValidator.ValidationError[];
9 };
10}
11interface PathMap {
12 page: string;
13 query?: {
14 [key: string]: string | string[];
15 };
16}
17interface ExportPageInput {
18 path: string;
19 pathMap: PathMap;
20 distDir: string;
21 outDir: string;
22 pagesDataDir: string;
23 renderOpts: RenderOpts;
24 buildExport?: boolean;
25 serverRuntimeConfig: string;
26 subFolders?: boolean;
27 serverless: boolean;
28 optimizeFonts: boolean;
29 optimizeImages?: boolean;
30 optimizeCss: any;
31 disableOptimizedLoading: any;
32 parentSpanId: any;
33}
34interface ExportPageResults {
35 ampValidations: AmpValidation[];
36 fromBuildExportRevalidate?: number;
37 error?: boolean;
38 ssgNotFound?: boolean;
39}
40interface RenderOpts {
41 runtimeConfig?: {
42 [key: string]: any;
43 };
44 params?: {
45 [key: string]: string | string[];
46 };
47 ampPath?: string;
48 ampValidatorPath?: string;
49 ampSkipValidation?: boolean;
50 optimizeFonts?: boolean;
51 optimizeImages?: boolean;
52 disableOptimizedLoading?: boolean;
53 optimizeCss?: any;
54 fontManifest?: FontManifest;
55 locales?: string[];
56 locale?: string;
57 defaultLocale?: string;
58 trailingSlash?: boolean;
59}
60export default function exportPage({ parentSpanId, path, pathMap, distDir, outDir, pagesDataDir, renderOpts, buildExport, serverRuntimeConfig, subFolders, serverless, optimizeFonts, optimizeImages, optimizeCss, disableOptimizedLoading, }: ExportPageInput): Promise<ExportPageResults>;
61export {};