1 |
|
2 | import LRUCache from 'next/dist/compiled/lru-cache';
|
3 | import { PrerenderManifest } from '../../build';
|
4 | declare type IncrementalCacheValue = {
|
5 | html?: string;
|
6 | pageData?: any;
|
7 | isStale?: boolean;
|
8 | isNotFound?: boolean;
|
9 | isRedirect?: boolean;
|
10 | curRevalidate?: number | false;
|
11 | revalidateAfter: number | false;
|
12 | };
|
13 | export declare class IncrementalCache {
|
14 | incrementalOptions: {
|
15 | flushToDisk?: boolean;
|
16 | pagesDir?: string;
|
17 | distDir?: string;
|
18 | dev?: boolean;
|
19 | };
|
20 | prerenderManifest: PrerenderManifest;
|
21 | cache: LRUCache<string, IncrementalCacheValue>;
|
22 | locales?: string[];
|
23 | constructor({ max, dev, distDir, pagesDir, flushToDisk, locales, }: {
|
24 | dev: boolean;
|
25 | max?: number;
|
26 | distDir: string;
|
27 | pagesDir: string;
|
28 | flushToDisk?: boolean;
|
29 | locales?: string[];
|
30 | });
|
31 | private getSeedPath;
|
32 | private calculateRevalidate;
|
33 | getFallback(page: string): Promise<string>;
|
34 | get(pathname: string): Promise<IncrementalCacheValue | void>;
|
35 | set(pathname: string, data: {
|
36 | html?: string;
|
37 | pageData?: any;
|
38 | isNotFound?: boolean;
|
39 | isRedirect?: boolean;
|
40 | }, revalidateSeconds?: number | false): Promise<void>;
|
41 | }
|
42 | export {};
|